From bd650e9a6422809b9b5a707ec39f03ab08c9cbee Mon Sep 17 00:00:00 2001 From: Michael Alan Dorman Date: Sun, 6 Dec 2020 07:36:16 -0500 Subject: [PATCH] pytest_xdist - make version conditional on python interpreter Like a number of other modules, the newer version of `pytest_xdist` simply does not work on a python 2.x interpreter, resulting in instantiation errors for tools using the 2.x interpreter like: ``` error: pytest-xdist-2.1.0 not supported for interpreter python2.7 (use '--show-trace' to show detailed location information) ``` This change uses the same strategy as those other modules to conditionalize the version that is selected on the version of the python interpreter. I would like to keep this working for a while, at least, since the DeDRM plugin for Calibre only works under python2 for the moment. --- pkgs/top-level/python-packages.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 40ec8314d9e83..f5eb591525369 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5823,11 +5823,10 @@ in { pytest-watch = callPackage ../development/python-modules/pytest-watch { }; - pytest_xdist_1 = callPackage ../development/python-modules/pytest-xdist { }; - - pytest_xdist_2 = callPackage ../development/python-modules/pytest-xdist/2.nix { }; - - pytest_xdist = self.pytest_xdist_2; + pytest_xdist = if isPy3k then + callPackage ../development/python-modules/pytest-xdist/2.nix { } + else + callPackage ../development/python-modules/pytest-xdist { }; pytest-xprocess = callPackage ../development/python-modules/pytest-xprocess { };