3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/cmd2/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
1.5 KiB
Nix
Raw Normal View History

2021-09-01 13:11:09 +01:00
{ lib
, stdenv
, attrs
, buildPythonPackage
, colorama
, fetchPypi
, glibcLocales
, importlib-metadata
, pyperclip
, pytest-mock
, pytestCheckHook
, pythonOlder
, setuptools-scm
, typing-extensions
, wcwidth
}:
2021-09-01 13:11:09 +01:00
buildPythonPackage rec {
pname = "cmd2";
2022-07-16 11:59:02 +01:00
version = "2.4.2";
2021-09-01 13:11:09 +01:00
disabled = pythonOlder "3.6";
2018-06-14 02:25:58 +01:00
src = fetchPypi {
inherit pname version;
2022-07-16 11:59:02 +01:00
sha256 = "sha256-Bz5VXAWFOw9pZfPQMym6vfnjil8s6gKOYaZM1+63StU=";
};
2021-09-01 13:11:09 +01:00
LC_ALL = "en_US.UTF-8";
2018-08-30 18:12:47 +01:00
buildInputs = [
setuptools-scm
2018-08-30 18:12:47 +01:00
];
propagatedBuildInputs = [
2021-09-01 13:11:09 +01:00
attrs
2018-06-14 02:25:58 +01:00
colorama
pyperclip
2018-06-14 02:25:58 +01:00
wcwidth
2021-09-01 13:11:09 +01:00
] ++ lib.optionals (pythonOlder "3.8") [
typing-extensions
importlib-metadata
];
2021-09-01 13:11:09 +01:00
checkInputs = [
pytestCheckHook
glibcLocales
pytest-mock
];
disabledTests = [
# don't require vim for tests, it causes lots of rebuilds
"test_find_editor_not_specified"
"test_transcript"
2021-09-01 13:11:09 +01:00
];
2018-10-15 11:10:30 +01:00
2021-09-01 13:11:09 +01: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
2018-10-15 11:10:30 +01:00
'';
2021-09-01 13:11:09 +01:00
doCheck = !stdenv.isDarwin;
pythonImportsCheck = [ "cmd2" ];
meta = with lib; {
description = "Enhancements for standard library's cmd module";
2020-04-06 14:18:39 +01:00
homepage = "https://github.com/python-cmd2/cmd2";
2021-09-22 12:55:12 +01:00
license = with licenses; [ mit ];
maintainers = with maintainers; [ teto ];
};
}