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

Add support for setup.py #2

Open
jayfk opened this issue Jul 11, 2017 · 5 comments
Open

Add support for setup.py #2

jayfk opened this issue Jul 11, 2017 · 5 comments
Labels
enhancement Enhancement of the code, not introducing new features.

Comments

@jayfk
Copy link
Contributor

jayfk commented Jul 11, 2017

No description provided.

@jhermann
Copy link

jhermann commented Jul 12, 2017

After calling ./setup.py egg_info -e «tmpdir», requires.txt can be fed into a pip requirements parser (though there might be subtle differences).

@pombredanne
Copy link
Contributor

@jhermann the main issue there is that you are executing a setup.py to get there which is fraught with so many perils (not the proper system reqs, python version, etc, etc). See aboutcode-org/scancode-toolkit#253 (comment) for some pointers and approaches the main serious ones being either: AST parsing or mock execution

@pombredanne
Copy link
Contributor

@jayfk do you plan to include in this ticket pbr setup.cfg which is popular on openstack and setup.cfg in general too?

@pombredanne
Copy link
Contributor

pombredanne commented Jul 14, 2017

FWIW, this is an example of setup.py that is hard to make sense: https://github.com/jakubroztocil/httpie/blob/f1d4861faed6486a356175ce9f92d4da96ddba01/setup.py

  1. an AST approach will have a harder time to get the test and install requirements, defined as variables
  2. a mock or AST will have a hard time to get some deps that are Python version- and OS-specific
  3. even a full live execution would be subject to the problem in 2.

I am not sure the complexity is worth handling in such a case, at least for a start.

@jayfk
Copy link
Contributor Author

jayfk commented Jul 14, 2017

@jayfk do you plan to include in this ticket pbr setup.cfg which is popular on openstack and setup.cfg in general too?

This basically looks like a tox.ini: https://github.com/openstack-dev/pbr/blob/master/setup.cfg. Shouldn't be a problem to include it.

an AST approach will have a harder time to get the test and install requirements, defined as variables
a mock or AST will have a hard time to get some deps that are Python version- and OS-specific
even a full live execution would be subject to the problem in 2.

On setup.py files that come with a wheel we might be able to extract metadata from it. I know that some people are working on this but for the time being using an AST approach is probably the sanest thing we could to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
None yet
Development

No branches or pull requests

4 participants