1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hatch-vcs,
6 hatchling,
7 paramiko,
8 psutil,
9 pytest-cov-stub,
10 pytest-mock,
11 pytest-timeout,
12 pytestCheckHook,
13 pythonOlder,
14}:
15
16buildPythonPackage rec {
17 pname = "plumbum";
18 version = "1.9.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.10";
22
23 src = fetchFromGitHub {
24 owner = "tomerfiliba";
25 repo = "plumbum";
26 tag = "v${version}";
27 hash = "sha256-3PAvSjZ0+BMq+/g4qNNZl27KnAm01fWFYxBBY+feNTU=";
28 };
29
30 build-system = [
31 hatchling
32 hatch-vcs
33 ];
34
35 optional-dependencies = {
36 ssh = [ paramiko ];
37 };
38
39 nativeCheckInputs = [
40 psutil
41 pytest-cov-stub
42 pytest-mock
43 pytest-timeout
44 pytestCheckHook
45 ]
46 ++ lib.flatten (builtins.attrValues optional-dependencies);
47
48 preCheck = ''
49 export HOME=$TMP
50 '';
51
52 disabledTests = [
53 # broken in nix env
54 "test_change_env"
55 "test_dictlike"
56 "test_local"
57 # incompatible with pytest 7
58 "test_incorrect_login"
59 ];
60
61 disabledTestPaths = [
62 # incompatible with pytest7
63 # https://github.com/tomerfiliba/plumbum/issues/594
64 "tests/test_remote.py"
65 ];
66
67 meta = with lib; {
68 description = "Module Shell Combinators";
69 changelog = "https://github.com/tomerfiliba/plumbum/releases/tag/v${version}";
70 homepage = "https://github.com/tomerfiliba/plumbum";
71 license = licenses.mit;
72 maintainers = [ ];
73 };
74}