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

Python: Component-governance extraction from setup.py does not include setup.cfg/pyproject.toml if executed from different dir. #244

Open
jenshnielsen opened this issue Aug 30, 2022 · 0 comments
Labels
detector:pip The pip detector status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)

Comments

@jenshnielsen
Copy link

The python code used to extract dependencies from setup.py would normally respect dependencies declared in more modern ways using setup.cfg/pyproject.toml but only if executed from the same directory.

E.g. changing the bundled code:

import distutils.core; setup=distutils.core.run_setup('{filePath.Replace('\\', '/')}'); print(setup.install_requires)

to something like (pseudocode)

import os; os.chdir(pathtofolderwithsetuppy); import distutils.core; setup=distutils.core.run_setup('{filePath.Replace('\\', '/')}'); print(setup.install_requires)

would also ensure that dependencies declared in setup.cfg/pyproject.toml (pep 621) would be included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detector:pip The pip detector status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)
Projects
Development

No branches or pull requests

2 participants