Skip to content

Commit 28f4067

Browse files
authored
Py marker means any python not CPython (#2460)
Resolves tox-dev/tox#2566
1 parent da92625 commit 28f4067

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

docs/changelog/2460.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A ``py`` or ``python`` spec means any Python rather than ``CPython`` - by :user:`gaborbernat`.

src/virtualenv/discovery/py_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _int_or_none(val):
5656
else:
5757
impl = groups["impl"]
5858
if impl == "py" or impl == "python":
59-
impl = "CPython"
59+
impl = None
6060
arch = _int_or_none(groups["arch"])
6161

6262
if not ok:

tests/unit/discovery/test_py_spec.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import itertools
21
import sys
32
from copy import copy
43

@@ -46,7 +45,7 @@ def test_spec_satisfies_arch():
4645

4746
@pytest.mark.parametrize(
4847
("req", "spec"),
49-
list(itertools.combinations(["py", "CPython", "python"], 2)) + [("jython", "jython")] + [("CPython", "cpython")],
48+
[("py", "python"), ("jython", "jython"), ("CPython", "cpython")],
5049
)
5150
def test_spec_satisfies_implementation_ok(req, spec):
5251
spec_1 = PythonSpec.from_string_spec(req)
@@ -56,7 +55,7 @@ def test_spec_satisfies_implementation_ok(req, spec):
5655

5756

5857
def test_spec_satisfies_implementation_nok():
59-
spec_1 = PythonSpec.from_string_spec("python")
58+
spec_1 = PythonSpec.from_string_spec("cpython")
6059
spec_2 = PythonSpec.from_string_spec("jython")
6160
assert spec_2.satisfies(spec_1) is False
6261
assert spec_1.satisfies(spec_2) is False

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ setenv =
6767
skip_install = true
6868
deps =
6969
coverage>=6.5
70-
diff_cover>=7.1
70+
diff_cover>=7.2
7171
extras =
7272
parallel_show_output = true
7373
commands =
@@ -91,7 +91,7 @@ description = check that the long description is valid (need for PyPI)
9191
skip_install = true
9292
deps =
9393
build>=0.9
94-
twine>=4.0.1
94+
twine>=4.0.2
9595
extras =
9696
commands =
9797
python -m build -o {envtmpdir} --wheel --sdist .

0 commit comments

Comments
 (0)