2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-12-30 13:39:12 +00:00
|
|
|
, fetchFromGitHub
|
2022-05-18 14:49:53 +00:00
|
|
|
, freezegun
|
2022-07-14 12:49:19 +00:00
|
|
|
, gettext
|
2022-05-18 14:49:53 +00:00
|
|
|
, importlib-metadata
|
|
|
|
, pytestCheckHook
|
2021-12-30 13:39:12 +00:00
|
|
|
, pythonOlder
|
2021-02-16 17:04:54 +00:00
|
|
|
, setuptools
|
2022-05-18 14:49:53 +00:00
|
|
|
, setuptools-scm
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "4.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "humanize";
|
2021-12-30 13:39:12 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-12-30 13:39:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-05-18 14:49:53 +00:00
|
|
|
owner = "python-humanize";
|
2021-12-30 13:39:12 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-08-21 13:32:41 +00:00
|
|
|
hash = "sha256-sccv3HtCgG/znZs/sfmeeOHK3xchv9zRrNX/SxyEbCQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
2022-07-14 12:49:19 +00:00
|
|
|
gettext
|
2021-12-30 13:39:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
setuptools
|
2022-05-18 14:49:53 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
2021-12-30 13:39:12 +00:00
|
|
|
];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
postBuild = ''
|
|
|
|
scripts/generate-translation-binaries.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cp -r 'src/humanize/locale' "$out/lib/"*'/site-packages/humanize/'
|
|
|
|
'';
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
checkInputs = [
|
|
|
|
freezegun
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"humanize"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python humanize utilities";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://github.com/python-humanize/humanize";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ rmcgibbo Luflosi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|