From 4853c2d3759bb5d7a894a3457684b71bd8b9c79c Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 18 Dec 2021 14:43:50 +0100 Subject: [PATCH] python2.tests.nixenv-virtualenv: fix test by using a python env that ignores collisions in the backports packages. --- pkgs/development/interpreters/python/tests.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/tests.nix b/pkgs/development/interpreters/python/tests.nix index 764ab29e919b..49dfe0e4644e 100644 --- a/pkgs/development/interpreters/python/tests.nix +++ b/pkgs/development/interpreters/python/tests.nix @@ -20,7 +20,15 @@ let envs = let inherit python; pythonEnv = python.withPackages(ps: with ps; [ ]); - pythonVirtualEnv = python.withPackages(ps: with ps; [ virtualenv ]); + pythonVirtualEnv = if python.isPy3k + then + python.withPackages(ps: with ps; [ virtualenv ]) + else + python.buildEnv.override { + extraLibs = with python.pkgs; [ virtualenv ]; + # Collisions because of namespaces __init__.py + ignoreCollisions = true; + }; in { # Plain Python interpreter plain = rec {