Skip to content Skip to sidebar Skip to footer

Declaring Optional Components Of My Package In Setup.py

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/ __ini

Solution 1:

No this is not possible with the default means of setuptools. There are two options you can chose from:

  1. Create a second project with the extra stuff, e.g. filters-extra. This is what is done by many projects. Look e.g. at flask on pypi.
  2. Use the "optional features" mechanism of setuptools. This will always install your code, but dependencies of you additional feature will only be installed if requested explicitly.

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.

Post a Comment for "Declaring Optional Components Of My Package In Setup.py"