setup.py "nice to have" dependency modules
<p>I'm looking at a setup.py file that looks a bit like this one:</p>

<pre><code>#!/usr/bin/env python
from setuptools import setup, find_packages
import sys

if sys.argv[1] == 'test':
    import multiprocessing, logging
    from billiard import util

with open('requirements.txt') as f:
    required = f.read().splitlines()

if sys.version_info &lt; (2, 7, 0):
    required.append('importlib')

setup(
    version='0.1',
    name='...',
    description='...',
    author='...',
    author_email='...',
    packages=find_packages(),
    package_data={},
    install_requires=required,
    include_package_data=True,
    tests_require=[
        'billiard',
        'nose==1.3'
    ],
    test_suite='nose.collector'
)
</code></pre>

<p>I am trying to install the module on windows. It would appear that the module has been developed on another OS as it fails to compile one of the modules (<code>leveldb</code>) in <code>requirements.txt</code>.</p>

<p>Looking at the code, it looks like it might work without <code>leveldb</code> (though perhaps with poorer performance). <strong>Is there any easy way to change the status of the <code>leveldb</code> library so its failure to install doesn't stop the main module from installing?</strong></p>

<p>Clearly I could remove the dependency from requirements.txt, but I'm considering how the libary might be edited to accomodate windows.</p>

<p>You can declare optional dependencies as <a href="https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies" rel="nofollow">extras in your setup.py</a></p>

python python-2.7 setuptools distutils leveldb