FawltyDeps
FawltyDeps copied to clipboard
Enhance limited evaluation of setup.py parsing: skip on fail
Testing FawltyDeps on real project: pyfolio, I encountered following setup.py structure:
...
support_ipython_6 = (sys.version_info >= (3, 3))
install_reqs = [
'ipython>=3.2.3' if support_ipython_6 else 'ipython>=3.2.3, <6',
'matplotlib>=1.4.0',
'numpy>=1.11.1',
'pandas>=0.18.1',
'pytz>=2014.10',
'scipy>=0.14.0',
'scikit-learn>=0.16.1',
'seaborn>=0.7.1',
'empyrical>=0.5.0',
]
test_reqs = ['nose>=1.3.7', 'nose-parameterized>=0.5.0', 'runipy>=0.1.3']
...
if __name__ == "__main__":
setup(
...
install_requires=install_reqs,
extras_require=extras_reqs,
tests_require=test_reqs,
test_suite='nose.collector',
)
FD fails on line:
'ipython>=3.2.3' if support_ipython_6 else 'ipython>=3.2.3, <6',
because it cannot evaluate that. If we skip (and report) the line we cannot evaluate in a list like that instead of skipping the whole list, we could extend our accuracy.