Skip to content
Advertisement

pip ignores python_requires field in setup

I have the following in my setup.cfg file:

[metadata]
name = mathsom
python_requires = '>=3.8'
...

Problem is that I created an enviroment with Python 3.7 and installation had no problems. Installation command:

pip install --extra-index-url https://test.pypi.org/simple/ mathsom

Shouldn’t pip require a Python 3.8 enviroment?

Here is the test.PyPI link: PyPI project, and here the repo: GitHub repo

I know that the setup.cfg file is working because pip install packages in install_requires field and Trove Classifiers show in Test PyPI.

Complete setup.cfg file:

[metadata]
name = mathsom
python_requires = '>=3.8'
author = Oliver Mohr B.
author_email = oliver.mohr.b@gmail.com
version = 0.1.2
description = Personal library for math related problems
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/oliverm91/mathsom
license_files = LICENSE
keywords = solvers, solver, interpolations, interpolation, numerics, derivatives, integrals
classifiers = 
    Development Status :: 3 - Alpha
    License :: OSI Approved :: GNU General Public License v3 (GPLv3)
    Programming Language :: Python
    Programming Language :: Python :: 3.8
    Programming Language :: Python :: 3.9
    Programming Language :: Python :: 3.10
    Programming Language :: Python :: 3.11
    Topic :: Scientific/Engineering :: Mathematics
    Natural Language :: English

[options]
package_dir=
    = src
packages=find:
install_requires =
    numpy
    scipy

[options.packages.find]
where=src

Advertisement

Answer

python_requires belongs to section [options]:

[metadata]
name = mathsom

[options]
python_requires = >= 3.8
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement