perlPackages.NetAsyncWebSocket: 0.13 -> 0.14 (#352432)
[NixPkgs.git] / pkgs / development / python-modules / iso4217 / default.nix
blobb9dd6d2f9f7bf9169a1cedd5e3a40e4e454d4930
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   fetchurl,
6   importlib-resources,
7   pytestCheckHook,
8   python,
9   pythonOlder,
10   setuptools,
12 let
13   table = fetchurl {
14     # See https://github.com/dahlia/iso4217/blob/main/setup.py#L19
15     url = "https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml";
16     hash = "sha256-r1mRvI/qcOYOGKVzXHJGFdYxc+YlzpcdnWJExaF0Mp0=";
17   };
19 buildPythonPackage rec {
20   pname = "iso4217";
21   version = "1.12";
22   pyproject = true;
24   disabled = pythonOlder "3.7";
26   src = fetchFromGitHub {
27     owner = "dahlia";
28     repo = "iso4217";
29     rev = "refs/tags/${version}";
30     hash = "sha256-xOKfdk8Bn9f5oszS0IHUD6HgzL9VSa5GBZ28n4fvAck=";
31   };
33   build-system = [ setuptools ];
35   dependencies = lib.optionals (pythonOlder "3.9") [ importlib-resources ];
37   nativeCheckInputs = [ pytestCheckHook ];
39   preBuild = ''
40     # The table is already downloaded
41     export ISO4217_DOWNLOAD=0
42     # Copy the table file to satifiy the build process
43     cp -r ${table} iso4217/table.xml
44   '';
46   postInstall = ''
47     # Copy the table file
48     cp -r ${table} $out/${python.sitePackages}/iso4217/table.xml
49   '';
51   pytestFlagsArray = [ "iso4217/test.py" ];
53   pythonImportsCheck = [ "iso4217" ];
55   meta = with lib; {
56     description = "ISO 4217 currency data package for Python";
57     homepage = "https://github.com/dahlia/iso4217";
58     license = with licenses; [ publicDomain ];
59     maintainers = with maintainers; [ fab ];
60   };