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

Spack Create Python: Parse pyproject.toml? #6629

Open
ax3l opened this issue Dec 8, 2017 · 9 comments
Open

Spack Create Python: Parse pyproject.toml? #6629

ax3l opened this issue Dec 8, 2017 · 9 comments
Assignees
Labels

Comments

@ax3l
Copy link
Member

ax3l commented Dec 8, 2017

Wouldn't it be cool if we parsed the requirements.txt pyproject.toml of a python project on spack create to auto-populate the depends_on(..., 'build') packages we propose? :-)

@ax3l ax3l added the python label Dec 8, 2017
@alalazo
Copy link
Member

alalazo commented Dec 8, 2017

This is smaller in scope, but I think it's somehow related to #1249

@ax3l ax3l added the discussion label Dec 8, 2017
@adamjstewart
Copy link
Member

This is a bad idea. requirements.txt may contain some of the required dependencies, but it generally also includes several other dependencies that aren't necessary to build the project. These include dependencies required for unit testing and building the documentation.

@ax3l
Copy link
Member Author

ax3l commented Dec 8, 2017

Ok, good to know. I saw several projects adding an extra requirements.txt for docs, testing and tutorials but if people commonly throw it all in there, which will probably also push their pypi deps up, then it might better be avoided.

Anyway, it's just a template proposal we would create from it, of course on can remove non-dependencies again :)

@alalazo alalazo self-assigned this Apr 20, 2018
@ax3l ax3l changed the title Spack Create Python: Parse requirements.txt? Spack Create Python: Parse pyproject.toml? Dec 13, 2019
@ax3l
Copy link
Member Author

ax3l commented Dec 13, 2019

Modernization of the issue: auto-populate the depends_on(..., 'build') lines with entries from pyproject.toml (PEP-517/518).
Example: https://github.com/openPMD/openPMD-api/blob/dev/pyproject.toml

@adamjstewart
Copy link
Member

I don't know how common pyproject.toml is, but setup.cfg is becoming more popular and can also be parsed to locate dependency information in some cases.

@jcftang
Copy link
Member

jcftang commented Dec 13, 2019

some of the more modern python tooling requires the pyproject.toml config file to be used, from experience enabling the use of the pyproject.toml file enforces pep517 which tends to break things in unexpected ways.

@ax3l
Copy link
Member Author

ax3l commented Dec 15, 2019

The usage of both setup.cfg or pyproject.toml is a project choice and not up to us to add/judge ;)
PEP517 mainly breaks things because pip was not fully ready when it was rolled out and has quite some corner-cases that caused regressions in pip tooling.

@takluyver
Copy link
Contributor

At some point Spack will probably need to support a new backend (or adapt PythonPackage - I don't know what's easier). pyproject.toml allows projects to skip having setup.py and be built with a standard interface defined by PEP 517.

@adamjstewart
Copy link
Member

adamjstewart commented May 25, 2022

This is related to the discussion in #30795. Basically, we either try to parse setup.cfg, pyproject.toml, and requirements.txt (which may be nested, duplicated, or contain optional developer deps), or we parse the wheels directly. Just want to say that this is still on my radar and something I'm very interested in supporting.

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

6 participants