2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, attrs
|
|
|
|
, buildPythonPackage
|
|
|
|
, colorama
|
|
|
|
, fetchPypi
|
|
|
|
, glibcLocales
|
|
|
|
, importlib-metadata
|
|
|
|
, pyperclip
|
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools-scm
|
|
|
|
, typing-extensions
|
|
|
|
, vim
|
|
|
|
, wcwidth
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cmd2";
|
2022-01-13 20:06:32 +00:00
|
|
|
version = "2.3.3";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-01-13 20:06:32 +00:00
|
|
|
sha256 = "750d7eb04d55c3bc2a413e191bc177856f388102de47d11f2210a35266543640";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
LC_ALL = "en_US.UTF-8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-06-04 09:07:49 +00:00
|
|
|
setuptools-scm
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
attrs
|
2020-04-24 23:36:52 +00:00
|
|
|
colorama
|
|
|
|
pyperclip
|
|
|
|
wcwidth
|
2021-09-18 10:52:07 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
typing-extensions
|
|
|
|
importlib-metadata
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
glibcLocales
|
|
|
|
pytest-mock
|
|
|
|
vim
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "/--cov/d" setup.cfg
|
|
|
|
'' + lib.optionalString 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
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "cmd2" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Enhancements for standard library's cmd module";
|
|
|
|
homepage = "https://github.com/python-cmd2/cmd2";
|
2021-09-22 15:38:15 +00:00
|
|
|
license = with licenses; [ mit ];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ teto ];
|
|
|
|
};
|
|
|
|
}
|