-
Notifications
You must be signed in to change notification settings - Fork 62
added first language for Python versions #501
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
base: main
Are you sure you want to change the base?
Conversation
tutorials/pyproject-toml.md
Outdated
(python-version)= | ||
#### Which Python versions to support? | ||
|
||
But how do I figure out which Python versions I should support? Good question. The Python developer guide provides a [status page](https://devguide.python.org/versions/) (and a handy visualization) that explains the status of each Python release. Python releases go through several different phases that are explained in [PEP 602](https://peps.python.org/pep-0602/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This paragraph feels more like a tip box to me
@@ -307,6 +307,14 @@ The `requires-python` field helps pip identify which Python versions that your p | |||
It is set to a single value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize this PR was opened just to add new guidance, but we should really update this paragraph to specify that, even with lower bounds, requires-python
is not necessary for every package and is only something to be used when the author has confidence there are versions of Python the package versions Must Not be installed for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like there's a bit of an open question about how to frame this. what about something like the following?
We recommend adding the requires-python
field to your pyproject.toml
[project]
table.
This is not mandatory, but the requires-python
field helps pip identify which Python versions that your package supports, and is only required when there are versions of Python the package will not work with.
It is set to a single value.
The packaging specification definesrequires-python
as a string that uses version specifiers. Most projects will specify the oldest Python version supported by the package. In some advanced cases, an upper bound is set to indicate which future Python versions, if any, will be supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO "We recommend" is still too strong. @lwasser I might have missed some conversation this week, but I believe we recommend leaving it out, until a version of Python is known to break the package.
It is set to a single value.
This might just be my reading of the guide, but this sounds like the field takes a single version string. It takes a single version specifier which is a version operator plus version string, maybe multiple. But we should specify that the only versions specifier we recommend is > 3.X.Y
or >= 3.X.Y
. I am against even mentioning an upper bound, and would probably be okay saying to not do that, although that can just add confusion. Not sure Leah's thought on the upper.
@all-contributors add @mrgah for code, review |
I've put up a pull request to add @mrgah! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! @ucodery do the changes look OK to you? feel free to merge if so or leave more feedback if things haven't been addressed!!
pre-commit.ci autofix |
Added language for Python releases to tutorials/pyproject-toml.md, following consensus on #17 , with MyST reference target and links to Python developer docs and Scientific Python SPEC 0.