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 pp3-none-any tag #466

Merged
merged 4 commits into from Oct 29, 2021
Merged

add a pp3-none-any tag #466

merged 4 commits into from Oct 29, 2021

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Oct 14, 2021

Closes #311. Now that this project is used by pip and wheel, the discussion there about where to make the change is less relevant, I hope that reading the description below convinces the maintainers that the change is justified.

This inserts a pp3-none-any tag as the first any-platform tag.

This subject came up again for the vmprof project, which is a statistical profiler for cpython/pypy. The project has two parts: a pure-python front end, and a backend. On CPython, the backend is a c-extension module. On PyPy, the backend is built into the interpreter and understands the JIT. So when making wheels for the project, we want c-extension binary wheels for CPython and a pure-python wheel for PyPy.

Here is a snippet of the output of tags.sys_tags() using PyPy 3.7 on ubuntu 20.04/x86_64.

...
 <py30-none-manylinux_2_7_x86_64 @ 140603724368544>,
 <py30-none-manylinux_2_6_x86_64 @ 140603724368600>,
 <py30-none-manylinux_2_5_x86_64 @ 140603724368656>,
 <py30-none-manylinux1_x86_64 @ 140603724368712>,
 <py30-none-linux_x86_64 @ 140603724368768>,
 <pp3-none-any @ 140603724368824>,    # <---------- here
 <py37-none-any @ 140603724368880>,
 <py3-none-any @ 140603724368936>,
 <py36-none-any @ 140603724369440>,
 <py35-none-any @ 140603724369496>,
 <py34-none-any @ 140603724369552>,
...

@mattip
Copy link
Contributor Author

mattip commented Oct 15, 2021

Rebased to pull in #467

tests/test_tags.py Outdated Show resolved Hide resolved
tests/test_tags.py Outdated Show resolved Hide resolved
@brettcannon
Copy link
Member

Won't this affect PyPy 2's tags since it's hard-coded to pp3? Or is that not a concern?

@mattip
Copy link
Contributor Author

mattip commented Oct 16, 2021

Won't this affect PyPy 2's tags since it's hard-coded to pp3?

I think the trove classifier specifies "Programming Language :: Python :: 3 :: Only" so python2 is not relevant, correct?

Co-authored-by: Brett Cannon <brett@python.org>
@brettcannon
Copy link
Member

I'm thinking from a tag perspective. If I'm reading the code right, the logic right now only checks if the interpreter type is pp, and if it is it then adds the proposed pp3-none-any triple. But what about if the interpreter is PyPy 2? There's no way for that tag to be legitimate in that case, so I'm trying to figure out if the current logic is too lax/simple by not checking the interpreter version.

@mattip
Copy link
Contributor Author

mattip commented Oct 18, 2021

But what about if the interpreter is PyPy 2?

The code cannot be called by pypy2, it errors out on the typing sytax

INTERPRETER_SHORT_NAMES: Dict[str, str] = {

Co-authored-by: Brett Cannon <brett@python.org>
@brettcannon brettcannon self-assigned this Oct 26, 2021
@brettcannon brettcannon self-requested a review October 29, 2021 18:38
@brettcannon brettcannon changed the title add a pp3-none-any tag add a pp3-none-any tag Oct 29, 2021
@brettcannon
Copy link
Member

LGTM; just waiting on CI after fast-forwarding to the latest on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

packaging.tags does not support *-none-any wheels for non-py* interpreter tags
2 participants