Skip to content

MAINT: locking with uv, remove requirements.txt - #69

Merged
mattip merged 6 commits into
numpy:mainfrom
andyfaff:locky
Oct 14, 2026
Merged

mattip merged 6 commits into
numpy:mainfrom
andyfaff:locky

Conversation

@andyfaff

Copy link
Copy Markdown
Member

This PR introduces locking of dependencies during the build, which is a component of supply chain security. This project's pyproject.toml and uv.lock file are generated from the numpy/numpy pyproject.toml file using a couple of scripts. The build fails if the two repositories go out of sync.

This process means that we can retire all the requirements files, and a need to hand sync them with the numpy/numpy repository. Since an unsynchronised state is a hard fail it's obvious when the update script needs to be run. This is done by running the update script locally and submitting a PR.

The release process is unchanged.

@andyfaff

Copy link
Copy Markdown
Member Author

Before CI runs on this PR two actions need to be whitelisted:

  • astral-sh/setup-uv@*,
  • scientific-python/upload-nightly-action@*,

Comment thread .github/workflows/wheels.yml

- name: Install micromamba
uses: mamba-org/setup-micromamba@ce51e99f4bb8a82ab7158c4dc59ef4634c59c4f9 # v3.1.0
- name: Upload nightly wheel

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.

Easier to use a bespoke action that's designed specifically to upload to nightly wheels.

fi

# cibuildwheel doesn't install delvewheel by default
if [[ $RUNNER_OS == "Windows" ]]; then

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.

delvewheel is taken care of by cibuildwheel now.

@@ -0,0 +1,69 @@
"""Generate this repository's pyproject.toml from numpy's dependency groups.

@andyfaff andyfaff Oct 13, 2026 •

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.

copied directly from the scipy-release repo and amended for numpy's dependency groups.

@@ -0,0 +1,18 @@
set -xe

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.

copied from the scipy-release repo.

@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.

Some minor nits, but overall looks great and is a massive improvement.

Comment thread tools/wheels/cibw_before_build.sh Outdated
Comment thread tools/wheels/cibw_before_build.sh Outdated
Comment thread tools/sync_dependency_groups.py Outdated
@andyfaff

Copy link
Copy Markdown
Member Author

I thought I searched for every occurrence

@rgommers

Copy link
Copy Markdown
Member

Before CI runs on this PR two actions need to be whitelisted:

Added now. We can remove the micromamba action once this PR is merged.

@rgommers

Copy link
Copy Markdown
Member

Looks great from a quick browse. And great to see that dependency-groups in the main repo is fully populated 🚀

@andyfaff andyfaff closed this Oct 13, 2026
@andyfaff andyfaff reopened this Oct 13, 2026
@mattip
mattip merged commit 8bd59d9 into numpy:main Oct 14, 2026
66 checks passed
@mattip

mattip commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thanks @andyfaff

@andyfaff

Copy link
Copy Markdown
Member Author

Actually probably can't remove whitelisted actions until there are no more releases on the 2.5 branch., since this PR won't be backported

@rgommers

Copy link
Copy Markdown
Member

Good point. I didn't change anything yet.

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.

3 participants