Skip to content

Declare supported Python versions in setup.py

The classifiers are mostly for humans. The python_requires is for tools like pip install.

The list of supported Python versions is specified in four or five places:

  • README.rst
  • tox.ini
  • setup.cfg (classifiers)
  • setup.cfg (python_requires)
  • .gitlab-ci.yml (if you merge !5 (merged))

I have a tool called check-python-versions that helps me keep on top of this. I thought about adding a GitLab job running it to keep things in sync, but decided it would be premature. My other projects mostly use GitHub and Travis and specify the metadata in setup.py, so the tool currently doesn't know how to parse a setup.cfg or a .gitlab-ci.yml.

Merge request reports