Reputation: 1142
I've put together a library with the following structure:
filters/
__init__.py
core/
__init__.py
base.py
complex.py
number.py
string.py
extra/
__init__.py
django.py
iso.py
filters.core
should always be installed when a developer does a pip install filters
.
However, I'd like filters.extra
to be optional. It would not be installed by default; instead, the developer would need to do something like pip install filters[extra]
in order to install the extra package along with the core.
Is it possible to do this using setuptools?
Upvotes: 5
Views: 2482
Reputation: 6784
No this is not possible with the default means of setuptools. There are two options you can chose from:
filters-extra
. This is what is done by many projects. Look e.g. at flask on pypi.In case the extras are really separated from your core functionality and nor interconnected in the code, I would usually go for option 1 as it is more straight forward to use and document.
Upvotes: 4