Python setuptools: requirements

From wikinotes
Revision as of 23:27, 3 August 2020 by Will (talk | contribs) (→‎Version Ranges)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation

version specifier syntax https://www.python.org/dev/peps/pep-0440/#version-specifiers

Requirements

from setuptools import setup

setup(
    # ...

    install_requires=['six', 'pyyaml'],   # installed before `python setup.py install`
    tests_require=['pytest', 'mock'],     # installed before `python setup.py test`
)

Version Ranges

'numpy'               # latest version
'numpy>=1.14'         # above 1.14
'numpy>=1.14,!=1.15'  # above 1.14 AND not 1.15