-
Notifications
You must be signed in to change notification settings - Fork 110
Feature uv #2113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature uv #2113
Changes from 5 commits
144462e
6cbe7f3
1b678bd
7f0a6e7
253587a
9c75fa8
876f919
e8a9e92
047ea3a
d8c792a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
# This GitHub action is meant to update the pipfile.locks | ||
name: uv.locks Renewal Action | ||
|
||
on: # yamllint disable-line rule:truthy | ||
# Triggers the workflow every Wednesday at 1am UTC | ||
schedule: | ||
- cron: "0 1 * * 3" | ||
workflow_dispatch: # for manual trigger workflow from GH Web UI | ||
inputs: | ||
branch: | ||
description: 'Specify branch' | ||
required: false | ||
default: 'main' | ||
python_version: | ||
description: 'Select Python version to update uv.lock' | ||
required: false | ||
default: '3.11' | ||
type: choice | ||
options: | ||
- '3.12' | ||
- '3.11' | ||
update_optional_dirs: | ||
description: 'Include optional directories in update' | ||
required: false | ||
default: 'false' | ||
type: choice | ||
options: | ||
- 'true' | ||
- 'false' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
env: | ||
BRANCH: ${{ github.event.inputs.branch || 'main' }} | ||
PYTHON_VERSION: ${{ github.event.inputs.python_version || '3.11' }} | ||
INCLUDE_OPT_DIRS: ${{ github.event.inputs.update_optional_dirs || 'false' }} | ||
steps: | ||
# Checkout the specified branch from the specified organization | ||
- name: Checkout code from the specified branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.BRANCH }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Configure Git | ||
- name: Configure Git | ||
run: | | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "GitHub Actions" | ||
|
||
# Setup Python environment with the specified version (or default to '3.11') | ||
- name: Setup Python environment | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
# Install uv | ||
- name: Install uv | ||
run: pip install uv | ||
|
||
# Run makefile recipe to refresh uv.lock and push changes back to the branch | ||
- name: Run make refresh-pipfilelock-files and push the changes back to the branch | ||
run: | | ||
uv lock --python ${{ env.PYTHON_VERSION }} | ||
git add uv.lock | ||
git commit -m "Update uv.lock files by uvlock-renewal.yaml action" | ||
git push origin ${{ env.BRANCH }} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -477,6 +477,7 @@ refresh-pipfilelock-files: | |
echo "Regenerating requirements.txt files" | ||
pushd $(ROOT_DIR) | ||
bash $(ROOT_DIR)/scripts/sync-requirements-txt.sh | ||
bash $(ROOT_DIR)/scripts/sync-pylock-toml.sh | ||
popd | ||
Comment on lines
477
to
481
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainGood integration point; verify toolchain reproducibility Hooking sync-pylock-toml.sh after requirements regeneration is sensible. Given the script auto-installs uv from PyPI, please confirm your CI runners permit networked tool bootstrapping and that the uv version is pinned to avoid churn in generated pylock.toml. To verify determinism across lanes: 🏁 Script executed: #!/bin/bash
# Expect identical pylock.toml across two uv versions on the same inputs (or document differences).
rg -n --glob 'jupyter/**/pylock.toml' || true Length of output: 443 🏁 Script executed: #!/bin/bash
# Locate and inspect the sync-pylock-toml.sh script for uv version pinning
rg -nF "sync-pylock-toml.sh" -l
sed -n '1,200p' scripts/sync-pylock-toml.sh Length of output: 1190 Pin The • Confirm that your CI runners permit networked - uv --version || pip install uv
+ uv --version || pip install uv==<fixed-version> Replace These changes will lock the toolchain and prevent unintended drift in your lockfiles.
🤖 Prompt for AI Agents
|
||
|
||
# This is only for the workflow action | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard commit/push when there are no changes
As written, git commit fails when uv.lock is unchanged, failing the workflow.
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't want to update uv.lock like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiridanek, understood! I'll step back from that suggestion.
Could you clarify your preferred approach for handling uv.lock updates? Should this workflow be removed entirely, or do you have a different mechanism in mind for managing uv.lock files?
🧠 Learnings used