summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/cement/default.nix
blob: 460a5d87ebcb30238dce05a0cec9a0bf331b720c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
  lib,
  stdenv,
  buildPythonPackage,
  colorlog,
  fetchFromGitHub,
  jinja2,
  mock,
  pdm-backend,
  pylibmc,
  pystache,
  pytest-cov-stub,
  pytestCheckHook,
  pyyaml,
  redis,
  requests,
  tabulate,
  watchdog,
}:

buildPythonPackage rec {
  pname = "cement";
  version = "3.0.14";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "datafolklabs";
    repo = "cement";
    tag = version;
    hash = "sha256-hZ9kKQmMomjy5nnHKQ2RWB+6vIID8XMn3qutg0wCBq8=";
  };

  build-system = [ pdm-backend ];

  optional-dependencies = {
    colorlog = [ colorlog ];
    jinja2 = [ jinja2 ];
    mustache = [ pystache ];
    generate = [ pyyaml ];
    redis = [ redis ];
    memcached = [ pylibmc ];
    tabulate = [ tabulate ];
    watchdog = [ watchdog ];
    yaml = [ pyyaml ];
    cli = [
      jinja2
      pyyaml
    ];
  };

  nativeCheckInputs = [
    mock
    pytest-cov-stub
    pytestCheckHook
    requests
  ]
  ++ lib.concatAttrValues optional-dependencies;

  pythonImportsCheck = [ "cement" ];

  # Tests are failing on Darwin
  doCheck = !stdenv.hostPlatform.isDarwin;

  disabledTests = [
    # Test only works with the source from PyPI
    "test_get_version"
  ];

  disabledTestPaths = [
    # Tests require network access
    "tests/ext/test_ext_memcached.py"
    "tests/ext/test_ext_redis.py"
    "tests/ext/test_ext_smtp.py"
  ];

  meta = {
    description = "CLI Application Framework for Python";
    homepage = "https://builtoncement.com/";
    changelog = "https://github.com/datafolklabs/cement/blob/${version}/CHANGELOG.md";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ eqyiel ];
    mainProgram = "cement";
  };
}