python3: fix passthru tests after b937eac

This commit is contained in:
Martin Weinelt
2025-07-23 00:47:13 +02:00
parent 125c8e0441
commit 08aed995ea
2 changed files with 13 additions and 13 deletions

View File

@@ -19,7 +19,7 @@ let
# we aim to support.
environmentTests =
let
envs =
environments =
let
inherit python;
pythonEnv = python.withPackages (ps: with ps; [ ]);
@@ -36,8 +36,8 @@ let
{
# Plain Python interpreter
plain = rec {
env = python;
interpreter = env.interpreter;
environment = python;
interpreter = environment.interpreter;
is_venv = "False";
is_nixenv = "False";
is_virtualenv = "False";
@@ -48,11 +48,11 @@ let
# 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" { } ''
environment = runCommand "${python.name}-virtualenv" { } ''
${pythonVirtualEnv.interpreter} -m virtualenv venv
mv venv $out
'';
interpreter = "${env}/bin/${python.executable}";
interpreter = "${environment}/bin/${python.executable}";
is_venv = "False";
is_nixenv = "True";
is_virtualenv = "True";
@@ -61,8 +61,8 @@ let
// lib.optionalAttrs (python.implementation != "graal") {
# Python Nix environment (python.buildEnv)
nixenv = rec {
env = pythonEnv;
interpreter = env.interpreter;
environment = pythonEnv;
interpreter = environment.interpreter;
is_venv = "False";
is_nixenv = "True";
is_virtualenv = "False";
@@ -73,10 +73,10 @@ let
# 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" { } ''
environment = runCommand "${python.name}-venv" { } ''
${python.interpreter} -m venv $out
'';
interpreter = "${env}/bin/${python.executable}";
interpreter = "${environment}/bin/${python.executable}";
is_venv = "True";
is_nixenv = "False";
is_virtualenv = "False";
@@ -88,10 +88,10 @@ let
# 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" { } ''
environment = runCommand "${python.name}-venv" { } ''
${pythonEnv.interpreter} -m venv $out
'';
interpreter = "${env}/bin/${pythonEnv.executable}";
interpreter = "${environment}/bin/${pythonEnv.executable}";
is_venv = "True";
is_nixenv = "True";
is_virtualenv = "False";
@@ -117,7 +117,7 @@ let
'';
in
lib.mapAttrs testfun envs;
lib.mapAttrs testfun environments;
# Integration tests involving the package set.
# All PyPy package builds are broken at the moment

View File

@@ -12,7 +12,7 @@ import unittest
import site
ENV = "@env@"
ENV = "@environment@"
INTERPRETER = "@interpreter@"
PYTHON_VERSION = "@pythonVersion@"