python39Packages.cliff: fix missing dependency, tests and adopt to openstack team
This commit is contained in:
parent
1efdeb8767
commit
54cca75528
2 changed files with 56 additions and 24 deletions
|
@ -1,17 +1,14 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, autopage
|
||||
, cmd2
|
||||
, pbr
|
||||
, prettytable
|
||||
, pyparsing
|
||||
, six
|
||||
, stevedore
|
||||
, pyyaml
|
||||
, cmd2
|
||||
, pytestCheckHook
|
||||
, testtools
|
||||
, fixtures
|
||||
, which
|
||||
, stevedore
|
||||
, callPackage
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
|
@ -23,34 +20,35 @@ buildPythonPackage rec {
|
|||
sha256 = "95363e9b43e2ec9599e33b5aea27a6953beda2d0673557916fa4f5796857daa3";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
# only a small portion of the listed packages are actually needed for running the tests
|
||||
# so instead of removing them one by one remove everything
|
||||
rm test-requirements.txt
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [
|
||||
autopage
|
||||
cmd2
|
||||
pbr
|
||||
prettytable
|
||||
pyparsing
|
||||
six
|
||||
stevedore
|
||||
pyyaml
|
||||
cmd2
|
||||
stevedore
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e '/cmd2/c\cmd2' -e '/PrettyTable/c\PrettyTable' requirements.txt
|
||||
'';
|
||||
# check in passthru.tests.pytest to escape infinite recursion with stestr
|
||||
doCheck = false;
|
||||
|
||||
checkInputs = [ fixtures pytestCheckHook testtools which ];
|
||||
# add some tests
|
||||
pytestFlagsArray = [
|
||||
"cliff/tests/test_utils.py"
|
||||
"cliff/tests/test_app.py"
|
||||
"cliff/tests/test_command.py"
|
||||
"cliff/tests/test_help.py"
|
||||
"cliff/tests/test_lister.py"
|
||||
];
|
||||
pythonImportsCheck = [ "cliff" ];
|
||||
|
||||
passthru.tests = {
|
||||
pytest = callPackage ./tests.nix { };
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Command Line Interface Formulation Framework";
|
||||
homepage = "https://docs.openstack.org/cliff/latest/";
|
||||
homepage = "https://github.com/openstack/cliff";
|
||||
license = licenses.asl20;
|
||||
maintainers = [ maintainers.costrouc ];
|
||||
maintainers = teams.openstack.members;
|
||||
};
|
||||
}
|
||||
|
|
34
pkgs/development/python-modules/cliff/tests.nix
Normal file
34
pkgs/development/python-modules/cliff/tests.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ stdenv
|
||||
, buildPythonPackage
|
||||
, cliff
|
||||
, docutils
|
||||
, stestr
|
||||
, testscenarios
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "cliff";
|
||||
inherit (cliff) version;
|
||||
|
||||
src = cliff.src;
|
||||
|
||||
postPatch = ''
|
||||
# only a small portion of the listed packages are actually needed for running the tests
|
||||
# so instead of removing them one by one remove everything
|
||||
rm test-requirements.txt
|
||||
'';
|
||||
|
||||
dontBuild = true;
|
||||
dontInstall = true;
|
||||
|
||||
checkInputs = [
|
||||
cliff
|
||||
docutils
|
||||
stestr
|
||||
testscenarios
|
||||
];
|
||||
|
||||
checkPhase = ''
|
||||
stestr run
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue