diff --git a/pkgs/development/python-modules/python-octaviaclient/default.nix b/pkgs/development/python-modules/python-octaviaclient/default.nix index 42c6552612a2..0b1b4bf9c162 100644 --- a/pkgs/development/python-modules/python-octaviaclient/default.nix +++ b/pkgs/development/python-modules/python-octaviaclient/default.nix @@ -2,30 +2,21 @@ lib, buildPythonPackage, cliff, - doc8, - docutils, fetchPypi, - hacking, keystoneauth1, makePythonPath, openstackdocstheme, installer, osc-lib, - oslotest, oslo-serialization, oslo-utils, pbr, - pygments, python-neutronclient, - python-openstackclient, requests, - requests-mock, setuptools, sphinx, sphinxcontrib-apidoc, - stestr, - subunit, - testscenarios, + callPackage, }: buildPythonPackage rec { @@ -39,8 +30,8 @@ buildPythonPackage rec { hash = "sha256-5brfxkpJQousEcXl0YerzYDjrfl0XyWV0RXPTz146Y4="; }; - # somehow python-neutronclient cannot be found despite it being supplied - pythonRemoveDeps = [ "python-neutronclient" ]; + # NOTE(vinetos): This explicit dependency is removed to avoid infinite recursion + pythonRemoveDeps = [ "python-openstackclient" ]; build-system = [ setuptools @@ -57,40 +48,18 @@ buildPythonPackage rec { cliff keystoneauth1 python-neutronclient - python-openstackclient osc-lib oslo-serialization oslo-utils requests ]; - preInstall = '' - # TODO: I have really no idea why installer is missing... - export PYTHONPATH=$PYTHONPATH:${makePythonPath [ installer ]} - ''; + # Checks moved to 'passthru.tests' to workaround infinite recursion + doCheck = false; - nativeCheckInputs = [ - hacking - requests-mock - doc8 - docutils - pygments - subunit - oslotest - stestr - testscenarios - ]; - - checkPhase = '' - runHook preCheck - - # TODO: no idea why PYTHONPATH is broken here - export PYTHONPATH=$PYTHONPATH:${makePythonPath nativeCheckInputs} - - stestr run - - runHook postCheck - ''; + passthru.tests = { + tests = callPackage ./tests.nix { }; + }; pythonImportsCheck = [ "octaviaclient" ]; diff --git a/pkgs/development/python-modules/python-octaviaclient/tests.nix b/pkgs/development/python-modules/python-octaviaclient/tests.nix new file mode 100644 index 000000000000..eec943f04668 --- /dev/null +++ b/pkgs/development/python-modules/python-octaviaclient/tests.nix @@ -0,0 +1,45 @@ +{ + buildPythonPackage, + python-octaviaclient, + python-openstackclient, + hacking, + requests-mock, + doc8, + docutils, + pygments, + subunit, + oslotest, + stestr, + testscenarios, +}: + +buildPythonPackage { + pname = "python-octaviaclient-tests"; + inherit (python-octaviaclient) version src; + format = "other"; + + dontBuild = true; + dontInstall = true; + + nativeCheckInputs = [ + python-octaviaclient + python-openstackclient + hacking + requests-mock + doc8 + docutils + pygments + subunit + oslotest + stestr + testscenarios + ]; + + checkPhase = '' + runHook preCheck + + stestr run + + runHook postCheck + ''; +} diff --git a/pkgs/development/python-modules/python-openstackclient/default.nix b/pkgs/development/python-modules/python-openstackclient/default.nix index b08dad39b6ba..41cad8e5e65f 100644 --- a/pkgs/development/python-modules/python-openstackclient/default.nix +++ b/pkgs/development/python-modules/python-openstackclient/default.nix @@ -18,6 +18,7 @@ python-manilaclient, python-mistralclient, python-neutronclient, + python-octaviaclient, python-openstackclient, python-watcherclient, python-zaqarclient, @@ -89,6 +90,7 @@ buildPythonPackage rec { python-manilaclient python-mistralclient python-neutronclient + python-octaviaclient python-watcherclient python-zaqarclient python-zunclient