Description
PEP 517 provides a method, config settings, for supplying arbitrary configuration to a build backend. There are no defined semantics for this argument, although there is an example in the PEP showing how pip "might" map command line arguments onto config_settings
.
The setuptools backend appears to implement a part of this suggested interface (it processes a --global-option
key in essentially the way the PEP implies). The flit backend completely ignores config_settings
.
Pip needs a user interface (command line options) to allow users to supply config settings to a backend - but without any agreed semantics, there's probably not much we can do beyond allowing users to specify key/value pairs. It's possible that PEP 518 (or some similar standard) should be extended to allow projects to specify config_settings
in the project build metadata?
Finally, there's pip's --python-tag
option. This currently maps directly to a specific setuptools command line option. Due to the lack of common semantics, there's currently no way to support this under PEP 517 in a backend-neutral way. It may be worth (for the fallback use of the setuptools backend only? as a "better than nothing" approach for all backends?) mapping it to
config_settings = {'--global-option': ['--python-tag', python_tag]}
So, actions to consider:
- Standardising any semantics for
config_settings
(my view: out of scope for pip) - Letting projects specify config settings in pyproject.toml (my view: needs a standard, out of scope for pip)
- Command line interface for
config_settings
(my view: a minimal--build-settings key:value
for now) - Config settings in
requirements.txt
(my view: allow--build-settings
in there) --python-tag
(my view: translate to--global-option
for now, review later)
Also, apart from the short-term approach for --python-tag
, I propose not implementing any of this until after base PEP 517 support is released. Without more comprehensive buy in from backends, it's hard to see what form config_settings
usage will ultimately take, and it's backends that should drive this, not frontends.