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
|
|
|
|
, 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-08-12 12:06:08 +00:00
|
|
|
version = "2.4.2";
|
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-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-Bz5VXAWFOw9pZfPQMym6vfnjil8s6gKOYaZM1+63StU=";
|
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
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
pytestCheckHook
|
|
|
|
glibcLocales
|
|
|
|
pytest-mock
|
2022-07-14 12:49:19 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# don't require vim for tests, it causes lots of rebuilds
|
|
|
|
"test_find_editor_not_specified"
|
|
|
|
"test_transcript"
|
2021-09-18 10:52:07 +00:00
|
|
|
];
|
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 ];
|
|
|
|
};
|
|
|
|
}
|