1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, hatchling
5, hatch-vcs
6, openssh
7, ps
8, psutil
9, pytest-mock
10, pytest-timeout
11, pytestCheckHook
12}:
13
14buildPythonPackage rec {
15 pname = "plumbum";
16 version = "1.8.2";
17 format = "pyproject";
18
19 src = fetchFromGitHub {
20 owner = "tomerfiliba";
21 repo = "plumbum";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-b8JcGRHiZSv/ViyEogpLgGXOMHHSC+cjWT0FqhkolcA=";
24 };
25
26 postPatch = ''
27 substituteInPlace pyproject.toml \
28 --replace '"--cov-config=setup.cfg", ' ""
29 '';
30
31 SETUPTOOLS_SCM_PRETEND_VERSION = version;
32
33 nativeBuildInputs = [
34 hatchling
35 hatch-vcs
36 ];
37
38 nativeCheckInputs = [
39 openssh
40 ps
41 psutil
42 pytest-mock
43 pytest-timeout
44 pytestCheckHook
45 ];
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 changelog = "https://github.com/tomerfiliba/plumbum/releases/tag/v${version}";
68 description = " Plumbum: Shell Combinators ";
69 homepage = " https://github.com/tomerfiliba/plumbum ";
70 license = licenses.mit;
71 maintainers = with maintainers; [ ];
72 };
73}