1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-03 14:22:35 +03:00
nixpkgs/pkgs/development/python-modules/cmd2/default.nix

79 lines
1.5 KiB
Nix
Raw Normal View History

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