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 {
|
|
|
|
pname = "humanize";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "4.5.0";
|
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;
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-vTfK45sZ9m7TUQJwZpQWhOXgZzO46CwCsnNP+PI1YfA=";
|
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/'
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-30 13:39:12 +00:00
|
|
|
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";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/python-humanize/humanize/releases/tag/${version}";
|
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
|
|
|
};
|
|
|
|
}
|