nav: init at 1.2.1 (#356071)
[NixPkgs.git] / pkgs / development / python-modules / sh / default.nix
blob06ae4cd49b4d695223b651c2779c44a4e393c419
2   lib,
3   stdenv,
4   buildPythonPackage,
5   fetchFromGitHub,
6   poetry-core,
7   pytestCheckHook,
8 }:
10 buildPythonPackage rec {
11   pname = "sh";
12   version = "2.0.7";
13   format = "pyproject";
15   src = fetchFromGitHub {
16     owner = "amoffat";
17     repo = "sh";
18     rev = "refs/tags/${version}";
19     hash = "sha256-O0jS/hO31ou9h0xsMSKAy76vEELjryaHKbvdfzYevJc=";
20   };
22   nativeBuildInputs = [ poetry-core ];
24   nativeCheckInputs = [ pytestCheckHook ];
26   pytestFlagsArray = [ "tests" ];
28   # A test needs the HOME directory to be different from $TMPDIR.
29   preCheck = ''
30     export HOME=$(mktemp -d)
31   '';
33   disabledTests =
34     [
35       # Disable tests that fail on Hydra
36       "test_no_fd_leak"
37       "test_piped_exception1"
38       "test_piped_exception2"
39       "test_unicode_path"
40       # fails to import itself after modifying the environment
41       "test_environment"
42       # timing sensitive through usage of sleep(1) and signal handling
43       # https://github.com/amoffat/sh/issues/684
44       "test_general_signal"
45     ]
46     ++ lib.optionals stdenv.hostPlatform.isDarwin [
47       # Disable tests that fail on Darwin sandbox
48       "test_background_exception"
49       "test_cwd"
50       "test_ok_code"
51     ];
53   meta = with lib; {
54     description = "Python subprocess interface";
55     homepage = "https://pypi.python.org/pypi/sh/";
56     license = licenses.mit;
57     maintainers = with maintainers; [ siriobalmelli ];
58   };