From 5836d578ded885255162f2f8e798741d4260f6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 11 Sep 2021 12:16:21 +0200 Subject: [PATCH] python39Packages.oslotest: init at 4.5.0 --- .../python-modules/oslotest/default.nix | 41 +++++++++++++++++++ .../python-modules/oslotest/tests.nix | 32 +++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 75 insertions(+) create mode 100644 pkgs/development/python-modules/oslotest/default.nix create mode 100644 pkgs/development/python-modules/oslotest/tests.nix diff --git a/pkgs/development/python-modules/oslotest/default.nix b/pkgs/development/python-modules/oslotest/default.nix new file mode 100644 index 000000000000..66e06c8b3e72 --- /dev/null +++ b/pkgs/development/python-modules/oslotest/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchPypi +, fixtures +, pbr +, subunit +, callPackage +}: + +buildPythonPackage rec { + pname = "oslotest"; + version = "4.5.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "360ad2c41ba3ad6f059c7c6e7291450d082c2e5dbb0012e839a829978053dfe6"; + }; + + nativeBuildInputs = [ pbr ]; + + propagatedBuildInputs = [ + fixtures + subunit + ]; + + # check in passthru.tests.pytest to escape infinite recursion with other oslo components + doCheck = false; + + passthru.tests = { + pytest = callPackage ./tests.nix {}; + }; + + pythonImportsCheck = [ "oslotest" ]; + + meta = with lib; { + description = "Oslo test framework"; + homepage = "https://github.com/openstack/oslotest"; + license = licenses.asl20; + maintainers = teams.openstack.members; + }; +} diff --git a/pkgs/development/python-modules/oslotest/tests.nix b/pkgs/development/python-modules/oslotest/tests.nix new file mode 100644 index 000000000000..3c07a35c17d8 --- /dev/null +++ b/pkgs/development/python-modules/oslotest/tests.nix @@ -0,0 +1,32 @@ +{ stdenv +, buildPythonPackage +, oslo-config +, oslotest +, stestr +}: + +buildPythonPackage rec { + pname = "oslotest-tests"; + inherit (oslotest) version; + + src = oslotest.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 = [ + oslotest + oslo-config + stestr + ]; + + checkPhase = '' + stestr run + ''; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 67f1f62147f7..7e7fe5d375e3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5170,6 +5170,8 @@ in { oslo-utils = callPackage ../development/python-modules/oslo-utils { }; + oslotest = callPackage ../development/python-modules/oslotest { }; + osqp = callPackage ../development/python-modules/osqp { }; outcome = callPackage ../development/python-modules/outcome { };