-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Provide a way to read requires_python
from a project's settings
#384
Comments
I don't have an immediate solution, but I do have some thoughts on this. The easy way (classifiers) The way I address this for my own projects is with a very basic function that scrapes the PyPI trove classifiers, like: def supported_pythons(classifiers_file=Path("setup.cfg")):
"""
Parse all supported Python classifiers from setup.cfg
"""
pattern = re.compile(r"Programming Language :: Python :: ([0-9]+\.[0-9.]+)")
return pattern.findall(classifiers_file.read_text()) That covers only minor versions, of course, but it feeds nicely into It would probably be more correct way here to use setuptools/distutils to pull the classifiers? One could in the same manner pull The trickier way (requires_python) However, For nox, though, It seems to me that to properly handle |
cibuildwheel does a similar thing which might be interesting here:
|
Mostly supported in #877. Could add checking each version for validity. |
How would this feature be useful?
Instead of having to specify what versions of Python are supported both in project metadata and in my
noxfile.py
, read it from the project metadata to infer what versions are supported.This may require PEP 621 to gain traction before it's feasible.
Describe the solution you'd like
Some way to say, "use
requires_python
to know what versions of Python are considered supported".Describe alternatives you've considered
noxfile.py
based on myrequires_python
metadata.The text was updated successfully, but these errors were encountered: