Skip to content

Commit

Permalink
Py marker means any python not CPython (#2460)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat committed Dec 5, 2022
1 parent da92625 commit 28f4067
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/changelog/2460.bugfix.rst
@@ -0,0 +1 @@
A ``py`` or ``python`` spec means any Python rather than ``CPython`` - by :user:`gaborbernat`.
2 changes: 1 addition & 1 deletion src/virtualenv/discovery/py_spec.py
Expand Up @@ -56,7 +56,7 @@ def _int_or_none(val):
else:
impl = groups["impl"]
if impl == "py" or impl == "python":
impl = "CPython"
impl = None
arch = _int_or_none(groups["arch"])

if not ok:
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/discovery/test_py_spec.py
@@ -1,4 +1,3 @@
import itertools
import sys
from copy import copy

Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Expand Up @@ -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 =
Expand All @@ -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 .
Expand Down

0 comments on commit 28f4067

Please sign in to comment.