From 02a5e643207ab8d78d5cf7ab21e961368030794a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 11 Sep 2021 12:18:16 +0200 Subject: [PATCH] python39Packages.stestr: init at 3.2.0 --- .../python-modules/stestr/default.nix | 54 +++++++++++++++++++ .../python-modules/stestr/tests.nix | 32 +++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 88 insertions(+) create mode 100644 pkgs/development/python-modules/stestr/default.nix create mode 100644 pkgs/development/python-modules/stestr/tests.nix diff --git a/pkgs/development/python-modules/stestr/default.nix b/pkgs/development/python-modules/stestr/default.nix new file mode 100644 index 000000000000..88259dc718e1 --- /dev/null +++ b/pkgs/development/python-modules/stestr/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchPypi +, cliff +, fixtures +, future +, pbr +, subunit +, testtools +, voluptuous +, callPackage +}: + +buildPythonPackage rec { + pname = "stestr"; + version = "3.2.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "fb492cbdf3d3fdd6812645804efc84a99a68bb60dd7705f15c1a2949c8172bc4"; + }; + + 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 = [ + cliff + fixtures + future + pbr + subunit + testtools + voluptuous + ]; + + # check in passthru.tests.pytest to escape infinite recursion with other oslo components + doCheck = false; + + passthru.tests = { + pytest = callPackage ./tests.nix { }; + }; + + pythonImportsCheck = [ "stestr" ]; + + meta = with lib; { + description = "A parallel Python test runner built around subunit"; + homepage = "https://github.com/mtreinish/stestr"; + license = licenses.asl20; + maintainers = teams.openstack.members; + }; +} diff --git a/pkgs/development/python-modules/stestr/tests.nix b/pkgs/development/python-modules/stestr/tests.nix new file mode 100644 index 000000000000..7a5d47b5dcfe --- /dev/null +++ b/pkgs/development/python-modules/stestr/tests.nix @@ -0,0 +1,32 @@ +{ stdenv +, buildPythonPackage +, ddt +, sqlalchemy +, stestr +, subunit2sql +}: + +buildPythonPackage rec { + pname = "stestr-tests"; + inherit (stestr) version; + + src = stestr.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 = [ + stestr + ]; + + checkPhase = '' + export PATH=$out/bin:$PATH + export HOME=$TMPDIR + ''; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 672eb46acf83..92e422543f9f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8553,6 +8553,8 @@ in { stem = callPackage ../development/python-modules/stem { }; + stestr = callPackage ../development/python-modules/stestr { }; + stevedore = callPackage ../development/python-modules/stevedore { }; stm32loader = callPackage ../development/python-modules/stm32loader { };