python39Packages.pbr: enable tests, adopt into openstack team

This commit is contained in:
Sandro Jäckel 2021-09-12 22:07:48 +02:00
parent a13bf1828b
commit bd6c0565b2
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5
2 changed files with 64 additions and 4 deletions

View File

@ -1,4 +1,9 @@
{ lib, buildPythonPackage, fetchPypi, setuptools }:
{ lib
, buildPythonPackage
, fetchPypi
, setuptools
, callPackage
}:
buildPythonPackage rec {
pname = "pbr";
@ -11,13 +16,19 @@ buildPythonPackage rec {
propagatedBuildInputs = [ setuptools ];
# circular dependencies with fixtures
# check in passthru.tests.pytest to escape infinite recursion with fixtures
doCheck = false;
passthru.tests = {
pytest = callPackage ./tests.nix { };
};
pythonImportsCheck = [ "pbr" ];
meta = with lib; {
homepage = "http://docs.openstack.org/developer/pbr/";
license = licenses.asl20;
description = "Python Build Reasonableness";
homepage = "https://github.com/openstack/pbr";
license = licenses.asl20;
maintainers = teams.openstack.members;
};
}

View File

@ -0,0 +1,49 @@
{ stdenv
, buildPythonPackage
, git
, gnupg
, pbr
, mock
, sphinx
, stestr
, testresources
, testscenarios
, virtualenv
}:
buildPythonPackage rec {
pname = "pbr";
inherit (pbr) version;
src = pbr.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 = [
pbr
git
gnupg
mock
sphinx
stestr
testresources
testscenarios
virtualenv
];
checkPhase = ''
stestr run -e <(echo "
pbr.tests.test_core.TestCore.test_console_script_develop
pbr.tests.test_core.TestCore.test_console_script_install
pbr.tests.test_wsgi.TestWsgiScripts.test_with_argument
pbr.tests.test_wsgi.TestWsgiScripts.test_wsgi_script_run
")
'';
}