summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernát Gábor <gaborjbernat@gmail.com>2022-12-05 10:29:55 -0800
committerGitHub <noreply@github.com>2022-12-05 10:29:55 -0800
commit28f40672503974bdbf2c83d5174b738dcf45a5e5 (patch)
tree194e03dc1075e76845752332f7080014a967f717
parentda9262539911fa0c6efb01bff3843aeb74843d87 (diff)
downloadvirtualenv-28f40672503974bdbf2c83d5174b738dcf45a5e5.tar.gz
Py marker means any python not CPython (#2460)
Resolves https://github.com/tox-dev/tox/issues/2566
-rw-r--r--docs/changelog/2460.bugfix.rst1
-rw-r--r--src/virtualenv/discovery/py_spec.py2
-rw-r--r--tests/unit/discovery/test_py_spec.py5
-rw-r--r--tox.ini4
4 files changed, 6 insertions, 6 deletions
diff --git a/docs/changelog/2460.bugfix.rst b/docs/changelog/2460.bugfix.rst
new file mode 100644
index 0000000..60cd166
--- /dev/null
+++ b/docs/changelog/2460.bugfix.rst
@@ -0,0 +1 @@
+A ``py`` or ``python`` spec means any Python rather than ``CPython`` - by :user:`gaborbernat`.
diff --git a/src/virtualenv/discovery/py_spec.py b/src/virtualenv/discovery/py_spec.py
index 058d8be..103c7ae 100644
--- a/src/virtualenv/discovery/py_spec.py
+++ b/src/virtualenv/discovery/py_spec.py
@@ -56,7 +56,7 @@ class PythonSpec:
else:
impl = groups["impl"]
if impl == "py" or impl == "python":
- impl = "CPython"
+ impl = None
arch = _int_or_none(groups["arch"])
if not ok:
diff --git a/tests/unit/discovery/test_py_spec.py b/tests/unit/discovery/test_py_spec.py
index ba1b00e..641429e 100644
--- a/tests/unit/discovery/test_py_spec.py
+++ b/tests/unit/discovery/test_py_spec.py
@@ -1,4 +1,3 @@
-import itertools
import sys
from copy import copy
@@ -46,7 +45,7 @@ def test_spec_satisfies_arch():
@pytest.mark.parametrize(
("req", "spec"),
- list(itertools.combinations(["py", "CPython", "python"], 2)) + [("jython", "jython")] + [("CPython", "cpython")],
+ [("py", "python"), ("jython", "jython"), ("CPython", "cpython")],
)
def test_spec_satisfies_implementation_ok(req, spec):
spec_1 = PythonSpec.from_string_spec(req)
@@ -56,7 +55,7 @@ def test_spec_satisfies_implementation_ok(req, spec):
def test_spec_satisfies_implementation_nok():
- spec_1 = PythonSpec.from_string_spec("python")
+ spec_1 = PythonSpec.from_string_spec("cpython")
spec_2 = PythonSpec.from_string_spec("jython")
assert spec_2.satisfies(spec_1) is False
assert spec_1.satisfies(spec_2) is False
diff --git a/tox.ini b/tox.ini
index 4396d1a..53fc515 100644
--- a/tox.ini
+++ b/tox.ini
@@ -67,7 +67,7 @@ setenv =
skip_install = true
deps =
coverage>=6.5
- diff_cover>=7.1
+ diff_cover>=7.2
extras =
parallel_show_output = true
commands =
@@ -91,7 +91,7 @@ description = check that the long description is valid (need for PyPI)
skip_install = true
deps =
build>=0.9
- twine>=4.0.1
+ twine>=4.0.2
extras =
commands =
python -m build -o {envtmpdir} --wheel --sdist .