16 buildPythonPackage rec {
21 disabled = pythonOlder "3.9";
23 src = fetchFromGitHub {
24 owner = "thebigmunch";
26 rev = "refs/tags/${version}";
27 hash = "sha256-AEKawsAxDSDNkIaXEFFgdEBOY2PpASDrhlDrsnM5eyA=";
31 # Migrate to pendulum > 3, https://github.com/thebigmunch/tbm-utils/pull/3
33 name = "support-pendulum-3.patch";
34 url = "https://github.com/thebigmunch/tbm-utils/commit/473534fae2d9a8dea9100cead6c54cab3f5cd0cd.patch";
35 hash = "sha256-3T0KhSmO9r1vM67FWEnTZMQV4b5jS2xtPHI0t9NnCmI=";
38 name = "update-testsupport-pendulum-3.patch";
39 url = "https://github.com/thebigmunch/tbm-utils/commit/a0331d0c15f11cd26bfbb42eebd17296167161ed.patch";
40 hash = "sha256-KG6yfnnBltavbNvIBTdbK+CPXwZTLYl14925RY2a8vs=";
45 substituteInPlace pyproject.toml \
46 --replace-fail 'poetry>=1.0.0' 'poetry-core' \
47 --replace-fail 'poetry.masonry.api' 'poetry.core.masonry.api'
50 pythonRelaxDeps = [ "attrs" ];
52 build-system = [ poetry-core ];
55 propagatedBuildInputs = [
62 nativeCheckInputs = [ pytestCheckHook ];
64 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
65 # Skip on macOS because /etc/localtime is accessed through the pendulum
66 # library, which is not allowed in a sandboxed build.
67 "test_create_parser_filter_dates"
71 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
72 # Skip on macOS because /etc/localtime is accessed through the pendulum
73 # library, which is not allowed in a sandboxed build.
74 "tests/test_datetime.py"
78 pythonImportsCheck = [ "tbm_utils" ];
81 description = "Commonly-used set of utilities";
82 homepage = "https://github.com/thebigmunch/tbm-utils";
83 changelog = "https://github.com/thebigmunch/tbm-utils/blob/${version}/CHANGELOG.md";
84 license = licenses.mit;