Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: export UV_EXTRA_INDEX_URL before doing 'uv lock'
This commit solves the challenge when a repo uses 'uv' to manage Python packages, and the repo also includes any dependencies in private repositories. Current configuration options lets the repo provide secrets that allow Renovate to look for new versions of these dependencies, but it would fail on the step that updates the uv.lock lockfile, since the 'uv lock' subcommand has no knowledge of the Renovate configuration. The 'uv lock' command supports setting UV_EXTRA_INDEX_URL (a space-separated value of URLs to check before the default pypi index). This commit then solves the challenge by using a combination of having Renovate configuration like so: ``` "packageRules": [ { "matchDatasources": ["pypi"], "registryUrls": ["https://europe-python.pkg.dev/project-123/python/simple/"], } ], hostRules: [ { matchHost: "https://europe-python.pkg.dev", username: "_json_key_64", password: "{{ secrets.ARTIFACT_REGISTRY_JSON_KEY }}", }, ] ``` The 'uv' processor will now, when it can match a `hostRule` with a `registryUrl` inject whatever `username` and `password` from the `hostRule` into the `registryUrl`. The URLs will be exported as `UV_EXTRA_INDEX_URL` before calling 'uv lock'.
- Loading branch information