-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
installation: Switch to UV for dependency management (#3294)
## Summary Adopt `uv` for dependency management, replacing the existing `pip` approach. ## Motivation `uv` is developed by [Astral](https://astral.sh/), who also wrote `ruff` which is already in use in xDSL CI pipelines. It offers the benefits of much faster dependency resolution and installation, along with leveraging the more modern `pyproject.toml` configuration format defined in PEPs [518](https://peps.python.org/pep-0518/) and [618](https://peps.python.org/pep-0621/). Requested by @superlopuh ## Changes This replacement requires the following changes: - [x] Modification to the `venv` target of the Makefile to create the virtual environment - [x] Update CI flows to install with `uv` as opposed to `pip`, including testing - [x] `ci-core.yaml` - [x] `ci-mlir.yaml` - [x] `ci-notebooks.yaml` - [x] `ci-pyright-fails.yaml` - [x] `code-formatting.yaml` - [ ] `jupyterlite.yaml` (cannot easily be spawned due to workflow triggers) - [ ] `pythonpublish.yaml` (cannot easily be spawned due to required secrets) - [x] `release-notes.yaml` (requires no changes) - [x] Update documentation to reflect these changes - [x] Test across operating systems - [x] Windows - [x] MacOS - [x] NixOS - [x] Resolve changes required to Dependabot ## Post-merge checklist Once merged, we should check the following things: - [ ] The release flow worked correctly (including versioneer) - [ ] Users are able to switch to `uv` and instructions are clear - [ ] The `update-bot` workflow creates helpful and correct PRs in a timely manner --------- Co-authored-by: Sasha Lopoukhine <[email protected]> Co-authored-by: Alex Rice <[email protected]>
- Loading branch information
1 parent
1baf7d8
commit 056f76e
Showing
15 changed files
with
2,765 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,18 +21,14 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' # caching pip dependencies | ||
cache-dependency-path: | | ||
setup.py | ||
requirements.txt | ||
- name: Upgrade pip | ||
run: | | ||
pip install --upgrade pip | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
run: uv python install ${{ matrix.python-version }} | ||
|
||
- name: Run code formatting checks with pre-commit | ||
uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Update Bot | ||
|
||
on: | ||
workflow_dispatch: | ||
# Set the schedule, every week at 8:00am on Monday | ||
schedule: | ||
- cron: 0 8 * * 1 | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
lock: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: astral-sh/setup-uv@v3 | ||
|
||
- run: | | ||
echo "\`\`\`" > uv_output.md | ||
uv lock &>> uv_output.md | ||
echo "\`\`\`" >> uv_output.md | ||
- name: Create pull request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: Update uv lockfile | ||
title: Update uv lockfile | ||
body-path: uv_output.md | ||
branch: update-uv | ||
base: main | ||
labels: install | ||
delete-branch: true | ||
add-paths: uv.lock | ||
assignees: math-fehr, georgebisbas, superlopuh |
Oops, something went wrong.