Setuptools allows you to specify the minimum python version as such:
from setuptools import setup
[...]
setup(name="my_package_name",
python_requires='>3.5.2',
[...]
However, how can you do this with the pyproject.toml? The following two things did NOT work:
[project]
...
# ERROR: invalid key
python_requires = ">=3"
# ERROR: no matching distribution found
dependencies = ["python>=3"]
According to PEP 621, the equivalent field in the [project] table is requires-python.
More information about the list of valid configuration fields can be found in: https://packaging.python.org/en/latest/specifications/declaring-project-metadata/.
The equivalent pyproject.toml of your example would be:
[project]
name = "my_package_name"
requires-python = ">3.5.2"
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With