nixpkgs/pkgs/development/python-modules/cmd2/default.nix

75 lines
1.4 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
, vim
, wcwidth
}:
2021-09-01 13:11:09 +01:00
buildPythonPackage rec {
pname = "cmd2";
2021-08-26 20:38:06 +01:00
version = "2.1.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;
2021-08-26 20:38:06 +01:00
sha256 = "25dbb2e9847aaa686a8a21e84e3d101db8b79f5cb992e044fc54210ab8c0ad41";
};
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
vim
];
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 ];
};
}