cookiecutter / cookiecutter-django

Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.
https://cookiecutter-django.readthedocs.io
BSD 3-Clause "New" or "Revised" License
12.18k stars 2.91k forks source link

Add workflow to run uv lock #5422

Closed browniebroke closed 1 month ago

browniebroke commented 1 month ago

Description

Build on top of https://github.com/cookiecutter/cookiecutter-django/pull/5356 to add a uv lock workflow

Checklist:

Rationale

At time of writing, Dependabot doesn't yet support uv.lock file: https://github.com/dependabot/dependabot-core/issues/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.

foarsitter commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

Clever!

browniebroke commented 1 month ago

Ok, let's try this