[Distutils] Optional requirements with "extra"

Mathieu Leduc-Hamel marrakis at gmail.com
Wed Aug 11 14:57:17 CEST 2010


Hi all,

I was reading the documentation of distutils, setuptools and distribution
cause I was searching for a way to add some optional dependancies to a
project. In fact i would like to add an optional dependency and it will
change some components of the a module.

I'll explain a little bit more:

I have a module called "storelocator", when you have use it without any
optional dependency.

In the setup script I have the following option:

extras_require = {
          "satchmo" : ["Satchmo"],
          }

If you install the package with the satchmo support like that:

storelocator[satchmo]

Then I would like be able with pkg_resources or something like to check in
the code if the satchmo support has been enabled or not, if yes, i'll change
some part of my package or not.

Mathieu Leduc-Hamel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20100811/9b8caa9e/attachment.html>


More information about the Distutils-SIG mailing list