Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py marker means any python not CPython #2460

Merged
merged 1 commit into from Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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