[python] PY-58278 run PyEnvTestCase on vanilla Python 2.7

2.7 has no usable venv (no built-in venv, and virtualenv-py3.pyz/uv reject
it), so drop VENV_2_7 and run 2.7 tests on the plain interpreter, matching
the JUnit5 env tests (PyDebuggerPython2Test/Python27ProfilerTest).


(cherry picked from commit 66722d369a9f2fc9326b23c869b5dbc57a2fcdc5)

IJ-MR-210769

GitOrigin-RevId: 1f54f7142ce2575efec24537d29d81d6b7bcc882
This commit is contained in:
Vitaly Legchilkin
2026-07-07 22:16:41 +00:00
committed by intellij-monorepo-bot
parent bd2f766348
commit eeff548d96
2 changed files with 8 additions and 12 deletions
@@ -16,18 +16,14 @@ import org.jetbrains.annotations.ApiStatus
enum class PredefinedPyEnvironments(val spec: PyEnvironmentSpec<*>) {
/**
* Python 2.7.18
* Python 2.7.18 (plain interpreter, no venv).
* ID: python2.7
* Tags: python2.7
* Packages: virtualenv
*
* Python 2.7 has no usable venv: the built-in `venv` module is absent and neither the bundled
* `virtualenv-py3.pyz` nor `uv` can target it. Tests run directly on the interpreter (this is also
* what the JUnit5 env framework does, see `PyDebuggerPython2Test` / `Python27ProfilerTest`).
*/
VENV_2_7(venvEnvironment {
pythonVersion = pythonVersion("2.7")
libraries {
+"virtualenv"
}
}),
VANILLA_2_7(pythonEnvironment {
pythonVersion = pythonVersion("2.7")
}),
@@ -223,7 +219,7 @@ enum class PredefinedPyEnvironments(val spec: PyEnvironmentSpec<*>) {
* Environment tags for finding which tags an environment supports
*/
val ENVIRONMENTS_TO_TAGS: Map<PredefinedPyEnvironments, Set<String>> = mapOf(
VENV_2_7 to setOf("python2.7"),
VANILLA_2_7 to setOf("python2.7"),
VENV_3_8_FULL to setOf(
"python3", "python3.8", "pytest", "django", "django2", "behave", "behave-django",
"ipython", "ipython780", "skeletons", "tox", "jinja2", "packaging", "nose",
+2 -2
View File
@@ -31,7 +31,7 @@ import java.util.List;
import java.util.Set;
import static com.intellij.python.test.env.common.PredefinedPyEnvironments.Companion;
import static com.intellij.python.test.env.common.PredefinedPyEnvironments.VENV_2_7;
import static com.intellij.python.test.env.common.PredefinedPyEnvironments.VANILLA_2_7;
import static com.intellij.python.test.env.common.PredefinedPyEnvironments.VENV_3_10;
import static com.intellij.python.test.env.common.PredefinedPyEnvironments.VENV_3_11;
import static com.intellij.python.test.env.common.PredefinedPyEnvironments.VENV_3_12;
@@ -88,7 +88,7 @@ public abstract class PyEnvTestCase {
* All predefined environments used by PyEnvTestCase by default
*/
public static final List<PredefinedPyEnvironments> ALL_ENVIRONMENTS = List.of(
VENV_2_7,
VANILLA_2_7,
VENV_3_8_FULL,
VENV_3_9,
VENV_3_10,