Skip to content

Future Python versions might be problematic with the definition of Environment Marker Variable python_version #560

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

Closed
finefoot opened this issue Jan 28, 2018 · 3 comments

Comments

@finefoot
Copy link

There might be a problem with

- ``platform.python_version()[:3]``

in the future.

What if the Python version will consist of more than 3 characters?

I originally posted this as a question on Stack Overflow https://stackoverflow.com/questions/48119291/whats-with-the-definition-of-environment-marker-variable-python-version-in-pe Just as Martijn Pieters wrote there, something like ".".join(platform.python_version_tuple()[:2]) would fix the problem.

I also posted about this at pypa/packaging#119

@ncoghlan
Copy link
Contributor

Posted to distutils-sig here: https://mail.python.org/pipermail/distutils-sig/2018-January/031920.html

(I don't expect anyone to object to that plan, but I'll give folks some time to comment before making the change)

@brettcannon
Copy link
Member

@emmi474 I would say the mailing list would be the best place to start the conversation and then once the solution was agreed upon, then update the PEP.

@ncoghlan
Copy link
Contributor

ncoghlan commented Feb 2, 2018

My distutils-sig post didn't generate any objections, so I think the next step would be a PR against PEP 508 to make the change I describe in my post: make the change, and then add a PEP 440 style errata section stating the change that was made and and briefly explaining why (i.e. future-proofing against the possibility of a 3.10 release).

pganssle added a commit to pganssle/peps that referenced this issue Jul 18, 2019
Per pythonGH-560, the current definition of `python_version` is not compatible
with a 2+ digit major or minor version. There were no objections to
changing the definition to more accurately reflect the semantic content
intended to be conveyed (i.e. the major and minor version).
ncoghlan pushed a commit that referenced this issue Jul 20, 2019
Per GH-560, the current definition of `python_version` is not compatible
with a 2+ digit major or minor version. There were no objections to
changing the definition to more accurately reflect the semantic content
intended to be conveyed (i.e. the major and minor version).
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

3 participants