Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions pkgs/development/python-modules/sh/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, buildPythonPackage, fetchPypi, python, coverage, lsof, glibcLocales, coreutils }:
{ lib, stdenv, buildPythonPackage, fetchPypi, python, coverage, lsof, glibcLocales, coreutils, pytestCheckHook }:

buildPythonPackage rec {
pname = "sh";
Expand All @@ -9,24 +9,34 @@ buildPythonPackage rec {
sha256 = "sha256-5ARbbHMtnOddVxx59awiNO3Zrk9fqdWbCXBQgr3KGMc=";
};

patches = [
# Disable tests that fail on Darwin sandbox
./disable-broken-tests-darwin.patch
];

postPatch = ''
sed -i 's#/usr/bin/env python#${python.interpreter}#' test.py
sed -i 's#/bin/sleep#${coreutils.outPath}/bin/sleep#' test.py
'';

checkInputs = [ coverage lsof glibcLocales ];
checkInputs = [ coverage lsof glibcLocales pytestCheckHook ];

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

pytestFlagsArray = [ "test.py" ];

disabledTests = [
# Disable tests that fail on Hydra
"test_no_fd_leak"
"test_piped_exception1"
"test_piped_exception2"
"test_unicode_path"
] ++ lib.optionals stdenv.isDarwin [
# Disable tests that fail on Darwin sandbox
"test_background_exception"
"test_cwd"
"test_ok_code"
];

meta = with lib; {
description = "Python subprocess interface";
homepage = "https://pypi.python.org/pypi/sh/";
Expand Down

This file was deleted.