mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-17 03:03:37 +00:00
python3Packages.cmd2: fix build
This commit is contained in:
parent
167a7d9e23
commit
6256ef474f
@ -1,21 +1,58 @@
|
||||
{ lib, stdenv, fetchPypi, buildPythonPackage, pythonOlder, isPy3k
|
||||
, pyperclip, six, pyparsing, vim, wcwidth, colorama, attrs
|
||||
, contextlib2 ? null, typing ? null, setuptools-scm
|
||||
, pytest, mock ? null, pytest-mock
|
||||
, which, glibcLocales
|
||||
{ lib
|
||||
, stdenv
|
||||
, attrs
|
||||
, buildPythonPackage
|
||||
, colorama
|
||||
, fetchPypi
|
||||
, glibcLocales
|
||||
, importlib-metadata
|
||||
, pyperclip
|
||||
, pytest-mock
|
||||
, pytestCheckHook
|
||||
, pythonOlder
|
||||
, setuptools-scm
|
||||
, typing-extensions
|
||||
, vim
|
||||
, wcwidth
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "cmd2";
|
||||
version = "2.1.2";
|
||||
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "25dbb2e9847aaa686a8a21e84e3d101db8b79f5cb992e044fc54210ab8c0ad41";
|
||||
};
|
||||
|
||||
LC_ALL="en_US.UTF-8";
|
||||
LC_ALL = "en_US.UTF-8";
|
||||
|
||||
postPatch = lib.optionalString stdenv.isDarwin ''
|
||||
buildInputs = [
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
attrs
|
||||
colorama
|
||||
pyperclip
|
||||
wcwidth
|
||||
] ++ lib.optionals (pythonOlder "3.8") [
|
||||
typing-extensions
|
||||
importlib-metadata
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
glibcLocales
|
||||
pytest-mock
|
||||
vim
|
||||
];
|
||||
|
||||
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
|
||||
@ -24,33 +61,9 @@ buildPythonPackage rec {
|
||||
export PATH=$(realpath bin):$PATH
|
||||
'';
|
||||
|
||||
disabled = !isPy3k;
|
||||
|
||||
buildInputs = [
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
colorama
|
||||
pyperclip
|
||||
six
|
||||
pyparsing
|
||||
wcwidth
|
||||
attrs
|
||||
]
|
||||
++ lib.optionals (pythonOlder "3.5") [contextlib2 typing]
|
||||
;
|
||||
|
||||
|
||||
doCheck = !stdenv.isDarwin;
|
||||
# pytest-cov
|
||||
# argcomplete will generate errors
|
||||
checkInputs= [ pytest mock which vim glibcLocales pytest-mock ]
|
||||
++ lib.optional (pythonOlder "3.6") [ mock ];
|
||||
checkPhase = ''
|
||||
# test_path_completion_user_expansion might be fixed in the next release
|
||||
py.test -k 'not test_path_completion_user_expansion'
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "cmd2" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Enhancements for standard library's cmd module";
|
||||
|
Loading…
Reference in New Issue
Block a user