1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 freezegun,
6 gettext,
7 pytestCheckHook,
8 pythonOlder,
9 python,
10 hatch-vcs,
11 hatchling,
12}:
13
14buildPythonPackage rec {
15 pname = "humanize";
16 version = "4.12.3";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "python-humanize";
23 repo = "humanize";
24 tag = version;
25 hash = "sha256-VsB59tS2KRZ0JKd1FzA+RTEzpkUyj9RhhSopseHg+m8=";
26 };
27
28 nativeBuildInputs = [
29 hatch-vcs
30 hatchling
31 gettext
32 ];
33
34 postBuild = ''
35 scripts/generate-translation-binaries.sh
36 '';
37
38 postInstall = ''
39 cp -r 'src/humanize/locale' "$out/${python.sitePackages}/humanize/"
40 '';
41
42 nativeCheckInputs = [
43 freezegun
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [ "humanize" ];
48
49 meta = with lib; {
50 description = "Python humanize utilities";
51 homepage = "https://github.com/python-humanize/humanize";
52 changelog = "https://github.com/python-humanize/humanize/releases/tag/${version}";
53 license = licenses.mit;
54 maintainers = with maintainers; [
55 rmcgibbo
56 Luflosi
57 ];
58 };
59}