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

Current PY_VERSION 3.10.0a7+ does not conform to PEP 440 #88166

Closed
jouve mannequin opened this issue May 1, 2021 · 4 comments
Closed

Current PY_VERSION 3.10.0a7+ does not conform to PEP 440 #88166

jouve mannequin opened this issue May 1, 2021 · 4 comments

Comments

@jouve
Copy link
Mannequin

jouve mannequin commented May 1, 2021

BPO 44000
Nosy @ned-deily, @ambv, @JelleZijlstra, @jouve, @pablogsal

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2021-05-01.17:59:25.275>
created_at = <Date 2021-05-01.17:06:30.701>
labels = []
title = 'Current PY_VERSION 3.10.0a7+ does not conform to PEP 440'
updated_at = <Date 2021-05-01.17:59:25.275>
user = 'https://github.com/jouve'

bugs.python.org fields:

activity = <Date 2021-05-01.17:59:25.275>
actor = 'Cyril Jouve'
assignee = 'none'
closed = True
closed_date = <Date 2021-05-01.17:59:25.275>
closer = 'Cyril Jouve'
components = []
creation = <Date 2021-05-01.17:06:30.701>
creator = 'Cyril Jouve'
dependencies = []
files = []
hgrepos = []
issue_num = 44000
keywords = []
message_count = 3.0
messages = ['392607', '392609', '392613']
nosy_count = 5.0
nosy_names = ['ned.deily', 'lukasz.langa', 'JelleZijlstra', 'Cyril Jouve', 'pablogsal']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue44000'
versions = []

@jouve
Copy link
Mannequin Author

jouve mannequin commented May 1, 2021

It was changed from 3.10.0a7 to 3.10.0a7+ in
04eecf7

According to https://www.python.org/dev/peps/pep-0440/#public-version-identifiers, it should be something like 3.10.0a7.post1

or with https://www.python.org/dev/peps/pep-0440/#local-version-identifiers, it should be something like 3.10.0a7+post

see also implementation in packaging: https://github.com/pypa/packaging/blob/main/packaging/version.py#L225

@JelleZijlstra
Copy link
Member

PEP-440 applies to Python packages, not to CPython itself. The "+" convention has been used in CPython for a long time, and changing it without a strong justification seems risky.

@jouve
Copy link
Mannequin Author

jouve mannequin commented May 1, 2021

sure, I'll raise the issue with poetry then.

@radoering
Copy link

The "+" convention has been used in CPython for a long time, and changing it without a strong justification seems risky.

It might not be a strong justification but at least an argument:

According to PEP 508 python_full_version is equal to platform.python_version(). Although I could not find a direct reference, the sample values for python_full_version in PEP 508 seem to indicate that it should be PEP 440 compliant.

However, there is an escape hatch for non-compliant versions:

The <version_cmp> operators use the PEP 440 version comparison rules when those are defined (that is when both sides have a valid version specifier). If there is no defined PEP 440 behaviour and the operator exists in Python, then the operator falls back to the Python behaviour.

So far, so good.

However, if I'm right that implies a marker like python_full_version >= "3.9.0" is fulfilled for Python 3.10.0, but not for Python 3.10.0+. (IIUC, a version comparison should be used for the first one and a string comparison for the second one.)

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

No branches or pull requests

2 participants