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 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
46
47 preCheck = ''
48 export HOME=$TMP
49 '';
50
51 disabledTests = [
52 # broken in nix env
53 "test_change_env"
54 "test_dictlike"
55 "test_local"
56 # incompatible with pytest 7
57 "test_incorrect_login"
58 ];
59
60 disabledTestPaths = [
61 # incompatible with pytest7
62 # https://github.com/tomerfiliba/plumbum/issues/594
63 "tests/test_remote.py"
64 ];
65
66 meta = with lib; {
67 description = "Module Shell Combinators";
68 changelog = "https://github.com/tomerfiliba/plumbum/releases/tag/v${version}";
69 homepage = " https://github.com/tomerfiliba/plumbum";
70 license = licenses.mit;
71 maintainers = [ ];
72 };
73}