-
Notifications
You must be signed in to change notification settings - Fork 151
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
Python tag should reflect python_requires #336
Comments
I've been wondering: how can wheel conclusively determine from |
One way could be to construct a list of tags and their relevant supported versions:
Then for each tag, if its associated version satisfies the |
I thought of that too, but given your example of |
I've used patch=99 for this, that is, dict(
py27='2.7.99',
)
I would really like to see at least a warning for projects that set universal=True but have a |
Is there a function in |
Sure, you get a SpecifierSet out of it. https://github.com/joerick/cibuildwheel/blob/d223db13d833ec81f6303b042029a46a2462b916/cibuildwheel/__main__.py#L173 Then you check if a version is "contained": https://github.com/joerick/cibuildwheel/blob/d223db13d833ec81f6303b042029a46a2462b916/cibuildwheel/util.py#L76-L77 |
PS. Since you are making a wheel, I assume you'd parse Requires-Python, the metadata slot, not the input |
Perhaps an option would be to ignore |
How about this concrete proposal (cross posted from pypa/twine#739 since it involves wheel more than twine):
|
Just as a minor note, PEP 425 does not say anywhere that Python 3.7 must support the The reality is, of course, that the |
Excellent point, I didn't realize that - in fact, I originally didn't know that py36 was loadable on py37, as I'm more familiar with built wheels where it's one-version only. Stage 1: Implement the above proposal, but only with py2 / py3 in step 3. |
…ypa/wheel#336 the installer decides this behavior so it maybe safe to leave the default python version and just insert an abi3 tag
Closing as not relevant to this project anymore as |
In jaraco/zipp#37 and others, I've learned that universal wheels are essentially meaningless as they declare "work on all Python 2 and Python 3 versions" when in fact they have minimum Python 2 and Python 3 versions.
The baseline packaging default for generating wheels for pure-python distributions was bad enough when it required specifying
universal=1
for wheels to get py2/3 compatibility, but now I learn that behavior is unsatisfactory for projects targeting Python 3 and now users are demanding that the python tag be updated to declare the minimum supported Python version(s).The Requires-Python (python_requires distutils option) was created to declare these requirements more directly, but this functionality didn't supersede the PEP 425 expectations that the Python tag should indicate the minimum supported Python version (or versions) that the build supports.
What this means ultimately is that package maintainers are required to declare their supported Python versions in at least two, maybe three places:
I'm excluding Trove classifiers from this discussion.
I propose that bdist_wheel, instead of defaulting to the
py3
orpy2
should default to a value matching the Requires-Python directive, and determine the minimum python 2 and python 3 versions relevant to the project and use that. So ifpython_requires = '>=3.6'
, it should usepy36
for the tag. And ifpython_requires = '>=2.7.13,!=3.0.*,!=3.1.*'
, the python tag should bepy27.py32
.This scheme would allow the packager to declare the supported versions in one place and derive the (default) python tags for the build.
The text was updated successfully, but these errors were encountered: