python3Packages.iso4217: init at 1.6
This commit is contained in:
parent
ca2ece2bd4
commit
d96e16638f
52
pkgs/development/python-modules/iso4217/default.nix
Normal file
52
pkgs/development/python-modules/iso4217/default.nix
Normal file
@ -0,0 +1,52 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, fetchurl
|
||||
, pytestCheckHook
|
||||
, python
|
||||
}:
|
||||
let
|
||||
table = fetchurl {
|
||||
# See https://github.com/dahlia/iso4217/blob/main/setup.py#L18
|
||||
url = "http://www.currency-iso.org/dam/downloads/lists/list_one.xml";
|
||||
sha256 = "0frhicc7s8gqglr41hzx61fic3ckvr4sg773ahp1s28n5by3y7ac";
|
||||
};
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
pname = "iso4217";
|
||||
version = "1.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dahlia";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "0mdpf5a0xr5lrcfgvqi1sdn7ln2w6pkc3lg0laqkbx5mhxky0fla";
|
||||
};
|
||||
|
||||
checkInputs = [
|
||||
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
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
# Copy the table file
|
||||
cp -r ${table} $out/${python.sitePackages}/$pname/table.xml
|
||||
'';
|
||||
|
||||
pytestFlagsArray = [ "$pname/test.py" ];
|
||||
|
||||
pythonImportsCheck = [ "iso4217" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "ISO 4217 currency data package for Python";
|
||||
homepage = "https://github.com/dahlia/iso4217";
|
||||
license = with licenses; [ publicDomain ];
|
||||
maintainers = with maintainers; [ fab ];
|
||||
};
|
||||
}
|
@ -3753,6 +3753,8 @@ in {
|
||||
|
||||
iso-639 = callPackage ../development/python-modules/iso-639 { };
|
||||
|
||||
iso4217 = callPackage ../development/python-modules/iso4217 { };
|
||||
|
||||
iso8601 = callPackage ../development/python-modules/iso8601 { };
|
||||
|
||||
isodate = callPackage ../development/python-modules/isodate { };
|
||||
|
Loading…
Reference in New Issue
Block a user