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

PEP 517 config settings support #3080

Closed
nschloe opened this issue Aug 4, 2023 · 6 comments
Closed

PEP 517 config settings support #3080

nschloe opened this issue Aug 4, 2023 · 6 comments
Labels
enhancement help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@nschloe
Copy link
Contributor

nschloe commented Aug 4, 2023

In #573, support for PEP 517 was added. From what I can tell, config settings support is still missing. Config settings are a dict that is passed to the build backend, e.g., setuptools. Pip implements this as --config-settings/-C, pypa-build as --config-setting/-C.

It'd be great if tox had some way of specifying config settings that a passed to the build backend, e.g.,

[testenv:.pkg]
config-settings = 
  foo = bar
  alpha = omega
  run = 256
@nschloe nschloe changed the title PEP 517 config settings PEP 517 config settings support Aug 4, 2023
@gaborbernat gaborbernat added the help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. label Aug 4, 2023
@gaborbernat
Copy link
Member

PR welcome 👍

@nschloe
Copy link
Contributor Author

nschloe commented Aug 5, 2023

In tox's output, I see that 'config_settings' exist as an entity:

[...]
.pkg: 685 W build_sdist> python /home/nschloe/venv/lib/python3.11/site-packages/pyproject_api/_backend.py True foobar.build_meta [tox/tox_env/api.py:427]
Backend: run command build_sdist with args {'sdist_directory': '/path/to/.tox/.pkg/dist', 'config_settings': None}

I suppose this comes from pyproject-api. I can't quite see right now how this is called.

Edit: This build_sdist call misses a config_settings arg dict.

@nschloe
Copy link
Contributor Author

nschloe commented Aug 5, 2023

I've found where config_settings need to be added, but I have difficulties understanding how tox settings are defined and passed around. Any help?

@gaborbernat
Copy link
Member

https://tox.wiki/en/4.6.4/plugins.html#tox.plugin.spec.tox_add_env_config, you should have plenty examples in the code base, check for example https://tox.wiki/en/4.6.4/config.html#package_root-env

@nschloe
Copy link
Contributor Author

nschloe commented Aug 14, 2023

I'm trying to mimick what's in #1891, but don't really know what I'm doing. I'll best open a PR so we can discuss further over there.

@gaborbernat
Copy link
Member

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
Development

No branches or pull requests

2 participants