Skip to content
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

Add workflow to run uv lock #5422

Merged
merged 6 commits into from
Oct 7, 2024
Merged

Add workflow to run uv lock #5422

merged 6 commits into from
Oct 7, 2024

Conversation

browniebroke
Copy link
Member

@browniebroke browniebroke commented Oct 3, 2024

Description

Build on top of #5356 to add a uv lock workflow

Checklist:

  • I've made sure that tests are updated accordingly (especially if adding or updating a template option)
  • I've updated the documentation or confirm that my change doesn't require any updates

Rationale

At time of writing, Dependabot doesn't yet support uv.lock file: dependabot/dependabot-core#10478 but it does support package deps in pyproject.toml, which means that we will get PRs to updates our template deps, but they will leave the lockfile out of sync.

This workflow is a workaround for that, and will attempt to regenerate the lockfile each time the pyproject.toml file is changed by a pull request.

@browniebroke browniebroke marked this pull request as draft October 3, 2024 00:55
@foarsitter
Copy link
Collaborator

Adding a dependency through uv add also updates uv.lock. So the lock file is kept in sync.

If we commit 'uv.lock', is a workflow like this then required?

@browniebroke
Copy link
Member Author

This workflow is mainly for dependabot PRs, which AFAIK doesn't support uv.lock yet. Since it does support deps in pyproject.toml, as it's an earlier standard, PRs would leave the lock file out of date.

@foarsitter
Copy link
Collaborator

Clever!

Comment on lines +21 to +22
with:
token: ${{ env.GH_PAT }}
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +24 to +26
- name: Checkout without token
uses: actions/checkout@v4
if: ${{ env.GH_PAT == '' }}
Copy link
Member Author

Choose a reason for hiding this comment

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

Added this fallback in case the secret isn't accessible, which unfortunately the case sometimes...

@browniebroke browniebroke marked this pull request as ready for review October 7, 2024 08:44
@browniebroke
Copy link
Member Author

Ok, let's try this

@browniebroke browniebroke merged commit 3252aa7 into master Oct 7, 2024
16 checks passed
@browniebroke browniebroke deleted the uv-lock-workflow branch October 7, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants