[Distutils] How to declare optional dependencies?
Nick Coghlan
ncoghlan at gmail.com
Sat Feb 6 00:12:28 EST 2016
On 6 February 2016 at 04:52, Brett Cannon <brett at python.org> wrote:
> Maybe I'm totally overlooking something or misreading the docs, but I can't
> find a way to say in a requirements.txt file that a dependency is optional
> and its failure to install is okay. E.g., aiohttp supports using cchardet as
> an accelerator of chardet
> (http://aiohttp.readthedocs.org/en/stable/#library-installation). I would
> like to be able to specify in my requirements.txt that I would like cchardet
> to be installed if possible, but it not being available -- which it might be
> as it doesn't have any Python 3.5 wheels ATM -- is fine and not the end of
> the world.
No, we don't have anything comparable to the Recommends/Suggests weak
dependency system offered by distro package managers.
Being able to specify "install this dependency if it is missing and a
pre-built binary is available, otherwise skip it" could be a nice way
for software publishers to be able to tweak the install experience of
their package though - everyone gets a clean install experience, but
the folks with relevant pre-built dependencies available get improved
runtime performance.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Distutils-SIG
mailing list