13da32182d
GitOrigin-RevId: a7855f2235a1876f97473a76151fec2afa02b287
63 lines
1.1 KiB
Nix
63 lines
1.1 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, freezegun
|
|
, gettext
|
|
, importlib-metadata
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
, setuptools
|
|
, setuptools-scm
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
version = "4.3.0";
|
|
pname = "humanize";
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "python-humanize";
|
|
repo = pname;
|
|
rev = version;
|
|
hash = "sha256-sccv3HtCgG/znZs/sfmeeOHK3xchv9zRrNX/SxyEbCQ=";
|
|
};
|
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
nativeBuildInputs = [
|
|
setuptools-scm
|
|
gettext
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
setuptools
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
importlib-metadata
|
|
];
|
|
|
|
postBuild = ''
|
|
scripts/generate-translation-binaries.sh
|
|
'';
|
|
|
|
postInstall = ''
|
|
cp -r 'src/humanize/locale' "$out/lib/"*'/site-packages/humanize/'
|
|
'';
|
|
|
|
checkInputs = [
|
|
freezegun
|
|
pytestCheckHook
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"humanize"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Python humanize utilities";
|
|
homepage = "https://github.com/python-humanize/humanize";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ rmcgibbo Luflosi ];
|
|
};
|
|
}
|