I'm writing a setup.cfg
file for a Python package that requires different sets of dependencies depending on whether it's used for purpose A or purpose B (with some overlap). For development purposes, I want to add an argument to the setup.cfg
file that installs both sets of dependencies simultaneously.
The relevant section of the setup.cfg
file at the moment:
[options.extras_require]purpose1 = pkg1 pkg2 pkg3 pkg4 pkg5purpose2 = pkg1 pkg2 pkg6 pkg7 pkg8all = pkg1 pkg2 pkg3 pkg4 pkg5 pkg6 pkg7 pkg8
The accompanying setup.py
file is minimally dressed, and all our metadata is currently still kept in the setup.cfg
file.
What the setup.py
file looks like at the moment:
from __future__ import annotationsimport setuptoolsif __name__ == "__main__": # Do not add any parameters here. Edit setup.cfg instead. setuptools.setup()
So far, I've added the dependencies manually to the all
argument, but this would require me to manually crawl through and add dependencies to the all
argument every time the package's list of dependencies changes.
Is there a way to write the all
argument such that it will install everything listed under purpose1
and purpose2
without the need for me to manually write them to all
each time the environment changes?