1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, openssh
5, ps
6, psutil
7, pytest-mock
8, pytest-timeout
9, pytestCheckHook
10, setuptools-scm
11}:
12
13buildPythonPackage rec {
14 pname = "plumbum";
15 version = "1.7.2";
16
17 src = fetchFromGitHub {
18 owner = "tomerfiliba";
19 repo = "plumbum";
20 rev = "v${version}";
21 sha256 = "sha256-bCCcNFz+ZsbKSF7aCfy47lBHb873tDYN0qFuSCxJp1w=";
22 };
23
24 postPatch = ''
25 substituteInPlace setup.cfg \
26 --replace "--cov-config=setup.cfg" ""
27 '';
28
29 SETUPTOOLS_SCM_PRETEND_VERSION = version;
30
31 nativeBuildInputs = [
32 setuptools-scm
33 ];
34
35 checkInputs = [
36 openssh
37 ps
38 psutil
39 pytest-mock
40 pytest-timeout
41 pytestCheckHook
42 ];
43
44 preCheck = ''
45 export HOME=$TMP
46 '';
47
48 disabledTests = [
49 # broken in nix env
50 "test_change_env"
51 "test_dictlike"
52 "test_local"
53 # incompatible with pytest 7
54 "test_incorrect_login"
55 ];
56
57 disabledTestPaths = [
58 # incompatible with pytest7
59 # https://github.com/tomerfiliba/plumbum/issues/594
60 "tests/test_remote.py"
61 ];
62
63 meta = with lib; {
64 description = " Plumbum: Shell Combinators ";
65 homepage = " https://github.com/tomerfiliba/plumbum ";
66 license = licenses.mit;
67 maintainers = with maintainers; [ ];
68 };
69}