Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance limited evaluation of setup.py parsing: skip on fail #174

Open
mknorps opened this issue Feb 21, 2023 · 1 comment
Open

Enhance limited evaluation of setup.py parsing: skip on fail #174

mknorps opened this issue Feb 21, 2023 · 1 comment
Labels

Comments

@mknorps
Copy link
Collaborator

mknorps commented Feb 21, 2023

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.

@Nour-Mws Nour-Mws added the later label Feb 22, 2023
@Nour-Mws Nour-Mws added more data needed P3 minor: not priorized parsing-deps and removed later labels Mar 16, 2023
@jherland
Copy link
Member

(using this issue to collect more instances where more advanced setup.py parsing is needed)

dparse is a project with similar issues to this, and their pyupio/dparse#2 points to this setup.py as an example of one that is hard to parse correctly: https://github.com/httpie/cli/blob/f1d4861faed6486a356175ce9f92d4da96ddba01/setup.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants