2022-11-21 17:40:18 +00:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchPypi, python, coverage, lsof, glibcLocales, coreutils, pytestCheckHook }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sh";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "1.14.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-09-30 11:47:45 +00:00
|
|
|
sha256 = "sha256-5ARbbHMtnOddVxx59awiNO3Zrk9fqdWbCXBQgr3KGMc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's#/usr/bin/env python#${python.interpreter}#' test.py
|
2020-08-20 17:08:02 +00:00
|
|
|
sed -i 's#/bin/sleep#${coreutils.outPath}/bin/sleep#' test.py
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
checkInputs = [ coverage lsof glibcLocales pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# A test needs the HOME directory to be different from $TMPDIR.
|
|
|
|
preCheck = ''
|
|
|
|
export LC_ALL="en_US.UTF-8"
|
|
|
|
HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python subprocess interface";
|
|
|
|
homepage = "https://pypi.python.org/pypi/sh/";
|
2020-08-20 17:08:02 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ siriobalmelli ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|