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

Add a "cpNNN-none-any" tag #541

Merged
merged 5 commits into from Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
7 changes: 5 additions & 2 deletions packaging/tags.py
Expand Up @@ -499,6 +499,9 @@ def sys_tags(*, warn: bool = False) -> Iterator[Tag]:
yield from generic_tags()

if interp_name == "pp":
yield from compatible_tags(interpreter="pp3")
interp = "pp3"
elif interp_name == "cp":
interp = "cp" + interpreter_version(warn=warn)
else:
yield from compatible_tags()
interp = None
yield from compatible_tags(interpreter=interp)
12 changes: 12 additions & 0 deletions tests/test_tags.py
Expand Up @@ -1226,3 +1226,15 @@ def test_pypy_first_none_any_tag(self, monkeypatch):
break

assert tag == tags.Tag("pp3", "none", "any")

def test_cpython_first_none_any_tag(self, monkeypatch):
# When building the complete list of cpython tags, make sure the first
# <interpreter>-none-any one is cpxx-none-any
monkeypatch.setattr(tags, "interpreter_name", lambda: "cp")

for tag in tags.sys_tags():
brettcannon marked this conversation as resolved.
Show resolved Hide resolved
if tag.abi == "none" and tag.platform == "any":
break

interpreter = "cp" + tags._version_nodot(sys.version_info[:2])
brettcannon marked this conversation as resolved.
Show resolved Hide resolved
assert tag == tags.Tag(interpreter, "none", "any")