1{ lib, buildPythonPackage, fetchPypi, python, coverage, lsof, glibcLocales, coreutils }:
2
3buildPythonPackage rec {
4 pname = "sh";
5 version = "1.14.2";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "9d7bd0334d494b2a4609fe521b2107438cdb21c0e469ffeeb191489883d6fe0d";
10 };
11
12 patches = [
13 # Disable tests that fail on Darwin sandbox
14 ./disable-broken-tests-darwin.patch
15 ];
16
17 postPatch = ''
18 sed -i 's#/usr/bin/env python#${python.interpreter}#' test.py
19 sed -i 's#/bin/sleep#${coreutils.outPath}/bin/sleep#' test.py
20 '';
21
22 checkInputs = [ coverage lsof glibcLocales ];
23
24 # A test needs the HOME directory to be different from $TMPDIR.
25 preCheck = ''
26 export LC_ALL="en_US.UTF-8"
27 HOME=$(mktemp -d)
28 '';
29
30 meta = with lib; {
31 description = "Python subprocess interface";
32 homepage = "https://pypi.python.org/pypi/sh/";
33 license = licenses.mit;
34 maintainers = with maintainers; [ siriobalmelli ];
35 };
36}