about summary refs log tree commit diff
path: root/pkgs/development/python-modules/iso4217/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/iso4217/default.nix')
-rw-r--r--pkgs/development/python-modules/iso4217/default.nix54
1 files changed, 25 insertions, 29 deletions
diff --git a/pkgs/development/python-modules/iso4217/default.nix b/pkgs/development/python-modules/iso4217/default.nix
index 50268536bda5..b9dd6d2f9f7b 100644
--- a/pkgs/development/python-modules/iso4217/default.nix
+++ b/pkgs/development/python-modules/iso4217/default.nix
@@ -1,60 +1,56 @@
-{ lib
-, buildPythonPackage
-, fetchFromGitHub
-, fetchurl
-, importlib-resources
-, pytestCheckHook
-, python
-, pythonOlder
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  fetchurl,
+  importlib-resources,
+  pytestCheckHook,
+  python,
+  pythonOlder,
+  setuptools,
 }:
 let
   table = fetchurl {
     # See https://github.com/dahlia/iso4217/blob/main/setup.py#L19
-    url = "http://www.currency-iso.org/dam/downloads/lists/list_one.xml";
-    hash = "sha256-bp8uTMR1YRaI2cJLo0kdt9xD4nNaWK+LdlheWQ26qy0=";
+    url = "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml";
+    hash = "sha256-r1mRvI/qcOYOGKVzXHJGFdYxc+YlzpcdnWJExaF0Mp0=";
   };
 in
 buildPythonPackage rec {
   pname = "iso4217";
-  version = "1.11";
-  format = "setuptools";
+  version = "1.12";
+  pyproject = true;
 
   disabled = pythonOlder "3.7";
 
   src = fetchFromGitHub {
     owner = "dahlia";
-    repo = pname;
-    rev = version;
-    hash = "sha256-zJYtEIrsuHKPwnSoRjyZC/0rgAZoNMZ0Oh8gQcIb20Q=";
+    repo = "iso4217";
+    rev = "refs/tags/${version}";
+    hash = "sha256-xOKfdk8Bn9f5oszS0IHUD6HgzL9VSa5GBZ28n4fvAck=";
   };
 
-  propagatedBuildInputs = lib.optionals (pythonOlder "3.9") [
-    importlib-resources
-  ];
+  build-system = [ setuptools ];
 
-  nativeCheckInputs = [
-    pytestCheckHook
-  ];
+  dependencies = lib.optionals (pythonOlder "3.9") [ importlib-resources ];
+
+  nativeCheckInputs = [ pytestCheckHook ];
 
   preBuild = ''
     # The table is already downloaded
     export ISO4217_DOWNLOAD=0
     # Copy the table file to satifiy the build process
-    cp -r ${table} $pname/table.xml
+    cp -r ${table} iso4217/table.xml
   '';
 
   postInstall = ''
     # Copy the table file
-    cp -r ${table} $out/${python.sitePackages}/$pname/table.xml
+    cp -r ${table} $out/${python.sitePackages}/iso4217/table.xml
   '';
 
-  pytestFlagsArray = [
-    "$pname/test.py"
-  ];
+  pytestFlagsArray = [ "iso4217/test.py" ];
 
-  pythonImportsCheck = [
-    "iso4217"
-  ];
+  pythonImportsCheck = [ "iso4217" ];
 
   meta = with lib; {
     description = "ISO 4217 currency data package for Python";