depot/third_party/nixpkgs/pkgs/development/python-modules/sh/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

46 lines
1.2 KiB
Nix

{ lib, stdenv, buildPythonPackage, fetchPypi, python, coverage, lsof, glibcLocales, coreutils, pytestCheckHook }:
buildPythonPackage rec {
pname = "sh";
version = "1.14.3";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-5ARbbHMtnOddVxx59awiNO3Zrk9fqdWbCXBQgr3KGMc=";
};
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 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/";
license = licenses.mit;
maintainers = with maintainers; [ siriobalmelli ];
};
}