Skip to content

PythonPackage: add --config-settings support#31823

Merged
becker33 merged 3 commits intospack:developfrom
adamjstewart:build_systems/python
Aug 9, 2022
Merged

PythonPackage: add --config-settings support#31823
becker33 merged 3 commits intospack:developfrom
adamjstewart:build_systems/python

Conversation

@adamjstewart
Copy link
Copy Markdown
Member

@adamjstewart adamjstewart commented Jul 31, 2022

@rgommers taught me about a new pip install flag we'll want to use with py-scipy. Here is my understanding of the history of this flag (@pradyunsg please correct me if I'm wrong, I'm probably oversimplifying things):

  1. Once upon a time, pip install was simply a wrapper around python setup.py install. If you wanted to pass extra options to the build, you could use pip install --global-option=<global> --install-option=<install>, which would in turn run python setup.py <global> install <install>.
  2. PEP 517 added a way to specify a "build backend". Instead of running python setup.py install, if a build-backend is specified in pyproject.toml, it is invoked directly. However, there was no way to pass options to a build backend.
  3. Add a UI to set config settings for PEP 517 backends pypa/pip#11059 added a --config-settings flag to pip (first available in 22.1 release) which allows you to pass extra options to the build backend.

There is one important thing to note about this flag. It was first added in pip 22.1, which only supports Python 3.7+. This means that any package we add config_settings to will only support Python 3.7+. For py-scipy, we will only add this flag to scipy 1.9+, which already only supports Python 3.7+, so there's no issue there. But for other packages which specify a build-backend in pyproject.toml, this raises the question of which Python versions we are willing to support. Opened #31824 to discuss this without getting side-tracked with this PR.

@spackbot-app spackbot-app bot added build-systems core PR affects Spack core functionality dependencies documentation Improvements or additions to documentation labels Jul 31, 2022
@adamjstewart adamjstewart force-pushed the build_systems/python branch from 9b311d8 to 6e3dfce Compare July 31, 2022 23:16
@adamjstewart adamjstewart force-pushed the build_systems/python branch from 6e3dfce to 46b8d41 Compare August 1, 2022 17:06
@becker33 becker33 merged commit d29d546 into spack:develop Aug 9, 2022
@adamjstewart adamjstewart deleted the build_systems/python branch August 9, 2022 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-systems core PR affects Spack core functionality dependencies documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants