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

feat: add helper to get the Python listing #877

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

henryiii
Copy link
Collaborator

Close #855.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
nox/project.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@theacodes theacodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, just some nitpicks about naming

docs/config.rst Outdated Show resolved Hide resolved
nox/project.py Outdated Show resolved Hide resolved
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@cjolowicz
Copy link
Collaborator

I was surprised that max_version determines from where we read the Python versions.

@henryiii
Copy link
Collaborator Author

The idea is that you would have to guess the upper bound ( https://discuss.python.org/t/requires-python-upper-limits/12663), so one method (classifiers) doesn't have an upper bound, and the other requires it. Though it could be split if you have good ideas for names.

@cjolowicz
Copy link
Collaborator

Makes sense. Another approach would be to always look at Trove classifiers first, and fall back to requires_python if no classifiers are found. The max_version parameter would then just do what it says on the tin: apply an upper bound. (If it's not specified and we can't determine the upper bound from pyproject.toml, we could either bail out or apply our notion of what Python's current version is.) I don't feel strongly about this, though. Happy for this to go in 👍

@henryiii
Copy link
Collaborator Author

That's exactly what I originally tried, actually, but then I would have had to implement filtering, and why would you ever want to filter the classifiers using this parameter? What would be more likely to happen is someone would forget to update this bound when adding the classifier. Also, having it be "auto" means you'd have to pick what to do if classifiers and requires-python didn't match.

@henryiii henryiii merged commit 040a93c into wntrblm:main Oct 29, 2024
24 checks passed
@henryiii henryiii deleted the henryiii/feat/python_list branch October 29, 2024 20:40
@ews-ffarella
Copy link

Hi!
Would that work with Programming Language :: Python :: 3.13t.
Or is this a bad classifiers?

@henryiii
Copy link
Collaborator Author

That's not a valid classifier. All valid classifiers are here: https://pypi.org/classifiers/

And the plan would be to add something like pypa/trove-classifiers#195, not a 3.13t classifier.

@henryiii
Copy link
Collaborator Author

You can add to this list or process it, though. Including adding PyPy, etc.

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

Successfully merging this pull request may close these issues.

Reading Python classifiers from pyproject.toml
4 participants