1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, freezegun 5, gettext 6, pytestCheckHook 7, pythonOlder 8, hatch-vcs 9, hatchling 10}: 11 12buildPythonPackage rec { 13 pname = "humanize"; 14 version = "4.8.0"; 15 format = "pyproject"; 16 17 disabled = pythonOlder "3.8"; 18 19 src = fetchFromGitHub { 20 owner = "python-humanize"; 21 repo = pname; 22 rev = "refs/tags/${version}"; 23 hash = "sha256-bKTzygQtZ/0UB+zM9735a/xwH4KaoU6C8kUGurbHs2Y="; 24 }; 25 26 SETUPTOOLS_SCM_PRETEND_VERSION = version; 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/lib/"*'/site-packages/humanize/' 40 ''; 41 42 nativeCheckInputs = [ 43 freezegun 44 pytestCheckHook 45 ]; 46 47 pythonImportsCheck = [ 48 "humanize" 49 ]; 50 51 meta = with lib; { 52 description = "Python humanize utilities"; 53 homepage = "https://github.com/python-humanize/humanize"; 54 changelog = "https://github.com/python-humanize/humanize/releases/tag/${version}"; 55 license = licenses.mit; 56 maintainers = with maintainers; [ rmcgibbo Luflosi ]; 57 }; 58}