How do you specify a requirements file in setuptools (setup.cfg)

Viewed 45

I'm trying to migrate an old package that was using setup.py and requirements.txt in python2 to use setup.cfg in python3.

Setuptools' documentation states you can specify requirements as a list (which I've resorted to doing) or as a file (see the docs here, they say either file or list-semi).

How do I go about specifying a file for the package to use instead?

Current configuration example:

[metadata]
name = example
version = 2.0.0

[options]
include_package_data = True
install_requires =
    PyYAML==6.0
    requests==2.27.1
scripts =
    scripts/example_script.py

[options.packages.find]
where = example

What I'd like it to look like:

[metadata]
name = example
version = 2.0.0

[options]
include_package_data = True
install_requires = file:requirements.txt  # or something like this
scripts =
    scripts/example_script.py

[options.packages.find]
where = example

and requirements.txt being a regular requirement file:

PyYAML==6.0
requests==2.27.1
0 Answers
Related