Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / tbm-utils / default.nix
blob4fa46defe2cb989102c37a1235cb500d214c5893
1 { stdenv
2 , lib
3 , buildPythonPackage
4 , fetchFromGitHub
5 , attrs
6 , pendulum
7 , poetry-core
8 , pprintpp
9 , pytestCheckHook
10 , pythonRelaxDepsHook
11 , wrapt
14 buildPythonPackage rec {
15   pname = "tbm-utils";
16   version = "2.6.0";
17   format = "pyproject";
19   src = fetchFromGitHub {
20     owner = "thebigmunch";
21     repo = pname;
22     rev = "refs/tags/${version}";
23     hash = "sha256-AEKawsAxDSDNkIaXEFFgdEBOY2PpASDrhlDrsnM5eyA=";
24   };
26   postPatch = ''
27     substituteInPlace pyproject.toml \
28       --replace 'poetry>=1.0.0' 'poetry-core' \
29       --replace 'poetry.masonry.api' 'poetry.core.masonry.api'
30   '';
32   nativeBuildInputs = [
33     poetry-core
34     pythonRelaxDepsHook
35   ];
37   propagatedBuildInputs = [
38     attrs
39     pendulum
40     pprintpp
41     wrapt
42   ];
44   pythonRelaxDeps = [
45     "attrs"
46   ];
48   nativeCheckInputs = [
49     pytestCheckHook
50   ];
52   disabledTests = lib.optionals stdenv.isDarwin [
53     # Skip on macOS because /etc/localtime is accessed through the pendulum
54     # library, which is not allowed in a sandboxed build.
55     "test_create_parser_filter_dates"
56     "test_parse_args"
57   ];
59   disabledTestPaths = lib.optionals stdenv.isDarwin [
60     # Skip on macOS because /etc/localtime is accessed through the pendulum
61     # library, which is not allowed in a sandboxed build.
62     "tests/test_datetime.py"
63     "tests/test_misc.py"
64   ];
66   pythonImportsCheck = [
67     "tbm_utils"
68   ];
70   meta = {
71     description = "A commonly-used set of utilities";
72     homepage = "https://github.com/thebigmunch/tbm-utils";
73     changelog = "https://github.com/thebigmunch/tbm-utils/blob/${version}/CHANGELOG.md";
74     license = [ lib.licenses.mit ];
75   };