python3: fix passthru tests after b937eac

Changed files
+13 -13
pkgs
development
interpreters
python
tests
test_environments
+12 -12
pkgs/development/interpreters/python/tests.nix
···
# we aim to support.
environmentTests =
let
-
envs =
let
inherit python;
pythonEnv = python.withPackages (ps: with ps; [ ]);
···
{
# Plain Python interpreter
plain = rec {
-
env = python;
-
interpreter = env.interpreter;
is_venv = "False";
is_nixenv = "False";
is_virtualenv = "False";
···
# Fails on darwin with
# virtualenv: error: argument dest: the destination . is not write-able at /nix/store
nixenv-virtualenv = rec {
-
env = runCommand "${python.name}-virtualenv" { } ''
${pythonVirtualEnv.interpreter} -m virtualenv venv
mv venv $out
'';
-
interpreter = "${env}/bin/${python.executable}";
is_venv = "False";
is_nixenv = "True";
is_virtualenv = "True";
···
// lib.optionalAttrs (python.implementation != "graal") {
# Python Nix environment (python.buildEnv)
nixenv = rec {
-
env = pythonEnv;
-
interpreter = env.interpreter;
is_venv = "False";
is_nixenv = "True";
is_virtualenv = "False";
···
# Python 2 does not support venv
# TODO: PyPy executable name is incorrect, it should be pypy-c or pypy-3c instead of pypy and pypy3.
plain-venv = rec {
-
env = runCommand "${python.name}-venv" { } ''
${python.interpreter} -m venv $out
'';
-
interpreter = "${env}/bin/${python.executable}";
is_venv = "True";
is_nixenv = "False";
is_virtualenv = "False";
···
# TODO: Cannot create venv from a nix env
# Error: Command '['/nix/store/ddc8nqx73pda86ibvhzdmvdsqmwnbjf7-python3-3.7.6-venv/bin/python3.7', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
nixenv-venv = rec {
-
env = runCommand "${python.name}-venv" { } ''
${pythonEnv.interpreter} -m venv $out
'';
-
interpreter = "${env}/bin/${pythonEnv.executable}";
is_venv = "True";
is_nixenv = "True";
is_virtualenv = "False";
···
'';
in
-
lib.mapAttrs testfun envs;
# Integration tests involving the package set.
# All PyPy package builds are broken at the moment
···
# we aim to support.
environmentTests =
let
+
environments =
let
inherit python;
pythonEnv = python.withPackages (ps: with ps; [ ]);
···
{
# Plain Python interpreter
plain = rec {
+
environment = python;
+
interpreter = environment.interpreter;
is_venv = "False";
is_nixenv = "False";
is_virtualenv = "False";
···
# Fails on darwin with
# virtualenv: error: argument dest: the destination . is not write-able at /nix/store
nixenv-virtualenv = rec {
+
environment = runCommand "${python.name}-virtualenv" { } ''
${pythonVirtualEnv.interpreter} -m virtualenv venv
mv venv $out
'';
+
interpreter = "${environment}/bin/${python.executable}";
is_venv = "False";
is_nixenv = "True";
is_virtualenv = "True";
···
// lib.optionalAttrs (python.implementation != "graal") {
# Python Nix environment (python.buildEnv)
nixenv = rec {
+
environment = pythonEnv;
+
interpreter = environment.interpreter;
is_venv = "False";
is_nixenv = "True";
is_virtualenv = "False";
···
# Python 2 does not support venv
# TODO: PyPy executable name is incorrect, it should be pypy-c or pypy-3c instead of pypy and pypy3.
plain-venv = rec {
+
environment = runCommand "${python.name}-venv" { } ''
${python.interpreter} -m venv $out
'';
+
interpreter = "${environment}/bin/${python.executable}";
is_venv = "True";
is_nixenv = "False";
is_virtualenv = "False";
···
# TODO: Cannot create venv from a nix env
# Error: Command '['/nix/store/ddc8nqx73pda86ibvhzdmvdsqmwnbjf7-python3-3.7.6-venv/bin/python3.7', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
nixenv-venv = rec {
+
environment = runCommand "${python.name}-venv" { } ''
${pythonEnv.interpreter} -m venv $out
'';
+
interpreter = "${environment}/bin/${pythonEnv.executable}";
is_venv = "True";
is_nixenv = "True";
is_virtualenv = "False";
···
'';
in
+
lib.mapAttrs testfun environments;
# Integration tests involving the package set.
# All PyPy package builds are broken at the moment
+1 -1
pkgs/development/interpreters/python/tests/test_environments/test_python.py
···
import site
-
ENV = "@env@"
INTERPRETER = "@interpreter@"
PYTHON_VERSION = "@pythonVersion@"
···
import site
+
ENV = "@environment@"
INTERPRETER = "@interpreter@"
PYTHON_VERSION = "@pythonVersion@"