nixpkgs/pkgs/development/python-modules/cmd2/default.nix

61 lines
1.5 KiB
Nix
Raw Normal View History

2018-06-14 01:25:58 +00:00
{ stdenv, fetchPypi, buildPythonPackage, pythonOlder, isPy3k
2019-01-18 11:01:06 +00:00
, pyperclip, six, pyparsing, vim, wcwidth, colorama, attrs
2018-10-15 10:10:30 +00:00
, contextlib2 ? null, typing ? null, setuptools_scm
, pytest, mock ? null, pytest-mock
, which, glibcLocales
}:
buildPythonPackage rec {
pname = "cmd2";
version = "0.9.16";
2018-06-14 01:25:58 +00:00
src = fetchPypi {
inherit pname version;
sha256 = "0ggvh38mc1kkrlqdicjz5a16j5v6f6z0nwmcvv8i3y5gaffkfy2b";
};
LC_ALL="en_US.UTF-8";
postPatch = stdenv.lib.optional stdenv.isDarwin ''
# Fake the impure dependencies pbpaste and pbcopy
mkdir bin
echo '#${stdenv.shell}' > bin/pbpaste
echo '#${stdenv.shell}' > bin/pbcopy
chmod +x bin/{pbcopy,pbpaste}
export PATH=$(realpath bin):$PATH
'';
2018-06-14 01:25:58 +00:00
disabled = !isPy3k;
2018-08-30 17:12:47 +00:00
buildInputs = [
setuptools_scm
];
propagatedBuildInputs = [
2018-06-14 01:25:58 +00:00
colorama
pyperclip
six
pyparsing
2018-06-14 01:25:58 +00:00
wcwidth
2019-01-18 11:01:06 +00:00
attrs
]
2018-10-15 10:10:30 +00:00
++ stdenv.lib.optionals (pythonOlder "3.5") [contextlib2 typing]
;
2018-10-15 10:10:30 +00:00
doCheck = !stdenv.isDarwin;
# pytest-cov
# argcomplete will generate errors
checkInputs= [ pytest mock which vim glibcLocales pytest-mock ]
++ stdenv.lib.optional (pythonOlder "3.6") [ mock ];
checkPhase = ''
# test_path_completion_user_expansion might be fixed in the next release
py.test -k 'not test_path_completion_user_expansion'
'';
meta = with stdenv.lib; {
description = "Enhancements for standard library's cmd module";
homepage = https://github.com/python-cmd2/cmd2;
maintainers = with maintainers; [ teto ];
};
}