2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2018-10-16 03:36:16 +00:00
|
|
|
, buildPythonPackage
|
2021-12-28 00:16:13 +00:00
|
|
|
, fetchFromGitHub
|
2022-05-17 15:08:07 +00:00
|
|
|
, freezegun
|
2022-07-03 18:27:18 +00:00
|
|
|
, gettext
|
2022-05-17 15:08:07 +00:00
|
|
|
, importlib-metadata
|
|
|
|
, pytestCheckHook
|
2021-12-28 00:16:13 +00:00
|
|
|
, pythonOlder
|
2021-02-13 22:56:04 +00:00
|
|
|
, setuptools
|
2022-05-17 15:08:07 +00:00
|
|
|
, setuptools-scm
|
2018-10-16 03:36:16 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-09-21 18:37:29 +00:00
|
|
|
version = "4.4.0";
|
2018-10-16 03:36:16 +00:00
|
|
|
pname = "humanize";
|
2021-12-28 00:16:13 +00:00
|
|
|
format = "pyproject";
|
2018-10-16 03:36:16 +00:00
|
|
|
|
2022-05-17 15:08:07 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-12-28 00:16:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-05-17 15:08:07 +00:00
|
|
|
owner = "python-humanize";
|
2021-12-28 00:16:13 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-09-21 18:37:29 +00:00
|
|
|
hash = "sha256-XxlmOs3sfHOLTkrKGsHRiBWpuCIPJua2VkKxDmjOeWE=";
|
2018-10-16 03:36:16 +00:00
|
|
|
};
|
|
|
|
|
2021-12-28 00:16:13 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
2022-07-03 18:27:18 +00:00
|
|
|
gettext
|
2021-12-28 00:16:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
setuptools
|
2022-05-17 15:08:07 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
2021-12-28 00:16:13 +00:00
|
|
|
];
|
|
|
|
|
2022-07-03 18:27:18 +00:00
|
|
|
postBuild = ''
|
|
|
|
scripts/generate-translation-binaries.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cp -r 'src/humanize/locale' "$out/lib/"*'/site-packages/humanize/'
|
|
|
|
'';
|
|
|
|
|
2021-12-28 00:16:13 +00:00
|
|
|
checkInputs = [
|
|
|
|
freezegun
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2018-10-16 03:36:16 +00:00
|
|
|
|
2022-05-17 15:08:07 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"humanize"
|
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-10-16 03:36:16 +00:00
|
|
|
description = "Python humanize utilities";
|
2022-05-17 15:08:07 +00:00
|
|
|
homepage = "https://github.com/python-humanize/humanize";
|
2018-10-16 03:36:16 +00:00
|
|
|
license = licenses.mit;
|
2022-07-03 18:03:02 +00:00
|
|
|
maintainers = with maintainers; [ rmcgibbo Luflosi ];
|
2018-10-16 03:36:16 +00:00
|
|
|
};
|
|
|
|
}
|