From 243294b2b46d1d865eb490f61d601bedc05a5dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 11 Sep 2021 12:11:59 +0200 Subject: [PATCH] python39Packages.oslo-config: init at 8.7.1 --- .../python-modules/oslo-config/default.nix | 57 +++++++++++++++++++ .../python-modules/oslo-config/tests.nix | 43 ++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 102 insertions(+) create mode 100644 pkgs/development/python-modules/oslo-config/default.nix create mode 100644 pkgs/development/python-modules/oslo-config/tests.nix diff --git a/pkgs/development/python-modules/oslo-config/default.nix b/pkgs/development/python-modules/oslo-config/default.nix new file mode 100644 index 000000000000..fface886eb94 --- /dev/null +++ b/pkgs/development/python-modules/oslo-config/default.nix @@ -0,0 +1,57 @@ +{ lib +, buildPythonPackage +, fetchPypi +, debtcollector +, netaddr +, oslo-i18n +, pbr +, pyyaml +, requests +, rfc3986 +, stevedore +, callPackage +}: + +buildPythonPackage rec { + pname = "oslo-config"; + version = "8.7.1"; + + src = fetchPypi { + pname = "oslo.config"; + inherit version; + sha256 = "a0c346d778cdc8870ab945e438bea251b5f45fae05d6d99dfe4953cca2277b60"; + }; + + 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 = [ + debtcollector + netaddr + oslo-i18n + pbr + pyyaml + requests + rfc3986 + stevedore + ]; + + # check in passthru.tests.pytest to escape infinite recursion with other oslo components + doCheck = false; + + passthru.tests = { + pytest = callPackage ./tests.nix {}; + }; + + pythonImportsCheck = [ "oslo_config" ]; + + meta = with lib; { + description = "Oslo Configuration API"; + homepage = "https://github.com/openstack/oslo.config"; + license = licenses.asl20; + maintainers = teams.openstack.members; + }; +} diff --git a/pkgs/development/python-modules/oslo-config/tests.nix b/pkgs/development/python-modules/oslo-config/tests.nix new file mode 100644 index 000000000000..0c9fd661d6a3 --- /dev/null +++ b/pkgs/development/python-modules/oslo-config/tests.nix @@ -0,0 +1,43 @@ +{ stdenv +, buildPythonPackage +, oslo-config +, docutils +, oslo-log +, oslotest +, requests-mock +, sphinx +, stestr +, testscenarios +}: + +buildPythonPackage rec { + pname = "oslo-config-tests"; + inherit (oslo-config) version; + + src = oslo-config.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 = [ + oslo-config + docutils + oslo-log + oslotest + requests-mock + sphinx + stestr + testscenarios + ]; + + checkPhase = '' + stestr run + + ''; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fbe5f0f9c810..e433d4549838 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5156,6 +5156,8 @@ in { oslo-concurrency = callPackage ../development/python-modules/oslo-concurrency { }; + oslo-config = callPackage ../development/python-modules/oslo-config { }; + osqp = callPackage ../development/python-modules/osqp { }; outcome = callPackage ../development/python-modules/outcome { };