setup.py can be used for a lot more places than installing. For example, dependency resolution tools (e.g. Pipenv) uses setup.py egg_info to check the dependencies of a package. The current implementation, however, breaks the process since it unnecessarily refuses to be run.
The pragmatic way to specify a Python version requirement is to use the python_requires parameter instead. This guarentees the correct behaviour for both setuptools and pip released after November 2016, which is generally good enough. If backwards compatibility of tooling is a serious concern, a runtime check to check for versions of setuptools and pip would also avoid the restriction in most cases.
setup.py
can be used for a lot more places than installing. For example, dependency resolution tools (e.g. Pipenv) usessetup.py egg_info
to check the dependencies of a package. The current implementation, however, breaks the process since it unnecessarily refuses to be run.The pragmatic way to specify a Python version requirement is to use the
python_requires
parameter instead. This guarentees the correct behaviour for both setuptools and pip released after November 2016, which is generally good enough. If backwards compatibility of tooling is a serious concern, a runtime check to check for versions of setuptools and pip would also avoid the restriction in most cases.