1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 colorlog,
6 fetchFromGitHub,
7 jinja2,
8 mock,
9 pdm-backend,
10 pylibmc,
11 pystache,
12 pytest-cov-stub,
13 pytestCheckHook,
14 pythonOlder,
15 pyyaml,
16 redis,
17 requests,
18 tabulate,
19 watchdog,
20}:
21
22buildPythonPackage rec {
23 pname = "cement";
24 version = "3.0.12";
25 pyproject = true;
26
27 disabled = pythonOlder "3.8";
28
29 src = fetchFromGitHub {
30 owner = "datafolklabs";
31 repo = "cement";
32 tag = version;
33 hash = "sha256-weBqmNEjeSh5YQfHK48VVFW3UbZQmV4MiIQ3UPQKTTI=";
34 };
35
36 build-system = [ pdm-backend ];
37
38 optional-dependencies = {
39 colorlog = [ colorlog ];
40 jinja2 = [ jinja2 ];
41 mustache = [ pystache ];
42 generate = [ pyyaml ];
43 redis = [ redis ];
44 memcached = [ pylibmc ];
45 tabulate = [ tabulate ];
46 watchdog = [ watchdog ];
47 yaml = [ pyyaml ];
48 cli = [
49 jinja2
50 pyyaml
51 ];
52 };
53
54 nativeCheckInputs = [
55 mock
56 pytest-cov-stub
57 pytestCheckHook
58 requests
59 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
60
61 pythonImportsCheck = [ "cement" ];
62
63 # Tests are failing on Darwin
64 doCheck = !stdenv.hostPlatform.isDarwin;
65
66 disabledTests = [
67 # Test only works with the source from PyPI
68 "test_get_version"
69 ];
70
71 disabledTestPaths = [
72 # Tests require network access
73 "tests/ext/test_ext_memcached.py"
74 "tests/ext/test_ext_redis.py"
75 "tests/ext/test_ext_smtp.py"
76 ];
77
78 meta = with lib; {
79 description = "CLI Application Framework for Python";
80 homepage = "https://builtoncement.com/";
81 changelog = "https://github.com/datafolklabs/cement/blob/${version}/CHANGELOG.md";
82 license = licenses.bsd3;
83 maintainers = with maintainers; [ eqyiel ];
84 mainProgram = "cement";
85 };
86}