summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/sh/default.nix
blob: 562f0375beadb63645fd06c25c12b27d93a35847 (plain)
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
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  poetry-core,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "sh";
  version = "2.2.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "amoffat";
    repo = "sh";
    tag = version;
    hash = "sha256-5B+Bsxv2X1BHEMg8uv56ex//6EKEcLmte7ozcKzul/c=";
  };

  nativeBuildInputs = [ poetry-core ];

  nativeCheckInputs = [ pytestCheckHook ];

  enabledTestPaths = [ "tests" ];

  # A test needs the HOME directory to be different from $TMPDIR.
  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  disabledTests = [
    # Disable tests that fail on Hydra
    "test_no_fd_leak"
    "test_piped_exception1"
    "test_piped_exception2"
    "test_unicode_path"
    # fails to import itself after modifying the environment
    "test_environment"
    # timing sensitive through usage of sleep(1) and signal handling
    # https://github.com/amoffat/sh/issues/684
    "test_general_signal"
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    # Disable tests that fail on Darwin sandbox
    "test_background_exception"
    "test_cwd"
    "test_ok_code"
  ];

  meta = {
    description = "Python subprocess interface";
    homepage = "https://pypi.python.org/pypi/sh/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ siriobalmelli ];
  };
}