Visitar URL original
CI: place scipy-openblas in a dependency-group by andyfaff · Pull Request #32946 · numpy/numpy · GitHub
Skip to content

CI: place scipy-openblas in a dependency-group - #32946

Merged
mattip merged 10 commits into
numpy:mainfrom
andyfaff:obla
Oct 9, 2026
Merged

mattip merged 10 commits into
numpy:mainfrom
andyfaff:obla

Conversation

@andyfaff

@andyfaff andyfaff commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

PR summary

Places scipy-openblas pins into a dependency-group

First time contributor introduction

N/A

AI Disclosure

EDIT: used AI to create the parse code for the requirements.txt files in linux.yml.

- name: Install dependencies
run: |
pip install -r requirements/build_requirements.txt
pip install -r requirements/ci_requirements.txt

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at a log file from one of these runs and openblas isn't actually used.

- name: Install dependencies
run: |
pip install -r requirements/build_requirements.txt
pip install -r requirements/ci_requirements.txt

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at a log file from one of these runs and openblas isn't actually used.

@mattip

mattip commented Oct 8, 2026

Copy link
Copy Markdown
Member

This means we can change this line in numpy-release and not manage the requirement file in two places? If so that would be great!

@andyfaff

andyfaff commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

This means we can change this line in numpy-release and not manage the requirement file in two places? If so that would be great!

In the short term changes are required in two locations; the openblas32+openblas64 dependency groups in the numpy/numpy pyproject.toml as well as numpy-release/requirements/openblas_requirements.txt. There's no syncing to numpy-release.

In the longer term I'd like to do what scipy does. scipy-release now uses dependency pinning (via uv), which is good for security. There you only need to update the openblas dependency group in the scipy/scipy pyproject.toml, there are no other changes to that repo. Subsequently the dependency groups and lock file in scipy/scipy-release need to be synchronised and updated. This is done with the update_lock.sh script. If the sync isn't done then the wheel build falls over.

Transitioning to the longer term plan will need to be done across a few PRs.

@andyfaff

andyfaff commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

With dependency groups in pyproject.toml everything is in one place, and it's much easier to manage than multiple requirements files. scipy doesn't use requirements.txt files any more.

@andyfaff

andyfaff commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

With dependency groups in pyproject.toml everything is in one place

That is, the canonical (and sole) place for specifying all dependencies is pyproject.toml.

Comment thread .github/workflows/linux.yml Outdated
- name: Check scipy-openblas version in release pipelines
run: |
python tools/check_openblas_version.py --req-files numpy-release/requirements/openblas_requirements.txt
NRV=$(grep -E '^scipy-openblas64' numpy-release/requirements/openblas_requirements.txt | sed -E 's/^scipy-openblas64[^0-9]*//')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step will disappear completely with dependency pinning.

@andyfaff

andyfaff commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

@mattip, I've just realised what you're asking. In the short term (i.e. before dependency pinning), yes we can remove the numpy-release openblas_requirements.txt file and use this dependency group instead.

@mattip mattip left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, otherwise LGTM

Comment thread .github/workflows/linux.yml Outdated
run: |
python tools/check_openblas_version.py --req-files numpy-release/requirements/openblas_requirements.txt
NRV=$(grep -E '^scipy-openblas64' numpy-release/requirements/openblas_requirements.txt | sed -E 's/^scipy-openblas64[^0-9]*//')
OBLA=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['dependency-groups']['openblas64'][0].split('==')[1])")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are three copies of the parsing code: here (2) and in compiler_sanatizers.yml. Can we reuse tools/check_openblas_version.py to do this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, not ideal. My thought was that when numpy-release gets a lock file then the script becomes redundant.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

  • merge this PR.
  • I follow up with a PR to numpy-release removing the openblas requirements file, and installing openblas from the specification in pyproject.toml
  • I submit another PR removing the check_openblas_version script, and this step. In the other location where it's used I just check that the parsed version is greater than a certain value.

@andyfaff

andyfaff commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Last commits remove tools/check_openblas_version.py. This was used to ensure that the numpy and numpy-release repo are synced wrt the openblas version. numpy/numpy-release#68 will use the openblas32/64 dependency group introduced in this PR (merge this PR, then that one).
There was another usage of the script, to check that the installed scipy-openblas32 was greater than a certain value. This check has been simplified and no longer needs the script.

@mattip
mattip merged commit 94b05db into numpy:main Oct 9, 2026
89 checks passed
@mattip

mattip commented Oct 9, 2026

Copy link
Copy Markdown
Member

Thanks @andyfaff

@andyfaff
andyfaff deleted the obla branch October 9, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants