2024-06-05 15:53:02 +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";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "2.4.3";
|
|
|
|
format = "setuptools";
|
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;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-cYc8Efcr0Z4rHbV4IUcW8NT3yPolAJPGASZamnF97lI=";
|
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
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ setuptools-scm ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[
|
|
|
|
attrs
|
|
|
|
colorama
|
|
|
|
pyperclip
|
|
|
|
wcwidth
|
|
|
|
]
|
|
|
|
++ 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 = [
|
2023-03-15 16:39:30 +00:00
|
|
|
# Don't require vim for tests, it causes lots of rebuilds
|
2022-07-14 12:49:19 +00:00
|
|
|
"test_find_editor_not_specified"
|
|
|
|
"test_transcript"
|
2021-09-18 10:52:07 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +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;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "cmd2" ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
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";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/python-cmd2/cmd2/releases/tag/${version}";
|
2021-09-22 15:38:15 +00:00
|
|
|
license = with licenses; [ mit ];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ teto ];
|
|
|
|
};
|
|
|
|
}
|