about summary refs log tree commit diff
path: root/pkgs/development/python-modules/plumbum/default.nix
blob: 6bc5ec7da710fd03176c5706001fff5b78f315e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{ lib
, buildPythonPackage
, fetchFromGitHub
, hatchling
, hatch-vcs
, openssh
, ps
, psutil
, pytest-mock
, pytest-timeout
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "plumbum";
  version = "1.8.1";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "tomerfiliba";
    repo = "plumbum";
    rev = "refs/tags/v${version}";
    hash = "sha256-5nRI9y2Y7itkqDdLRSX4qWfh96WmhqdP1Eo7HLoRHaQ=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace '"--cov-config=setup.cfg", ' ""
  '';

  SETUPTOOLS_SCM_PRETEND_VERSION = version;

  nativeBuildInputs = [
    hatchling
    hatch-vcs
  ];

  nativeCheckInputs = [
    openssh
    ps
    psutil
    pytest-mock
    pytest-timeout
    pytestCheckHook
  ];

  preCheck = ''
    export HOME=$TMP
  '';

  disabledTests = [
    # broken in nix env
    "test_change_env"
    "test_dictlike"
    "test_local"
    # incompatible with pytest 7
    "test_incorrect_login"
  ];

  disabledTestPaths = [
    # incompatible with pytest7
    # https://github.com/tomerfiliba/plumbum/issues/594
    "tests/test_remote.py"
  ];

  meta = with lib; {
    changelog = "https://github.com/tomerfiliba/plumbum/releases/tag/v${version}";
    description = " Plumbum: Shell Combinators ";
    homepage = " https://github.com/tomerfiliba/plumbum ";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
  };
}