Skip to content

fix(code-style): use uv sync if lock file is present#1088

Open
jorgepiloto wants to merge 6 commits intomainfrom
fix/code-style-with-uv
Open

fix(code-style): use uv sync if lock file is present#1088
jorgepiloto wants to merge 6 commits intomainfrom
fix/code-style-with-uv

Conversation

@jorgepiloto
Copy link
Member

@jorgepiloto jorgepiloto commented Dec 3, 2025

Fix #926 by using uv pip install or uv sync depending on whether a uv.lock file is present.

@jorgepiloto jorgepiloto requested a review from a team as a code owner December 3, 2025 15:10
@github-actions github-actions bot added the fix Pull requests related to resolving problems or errors label Dec 3, 2025
Comment on lines +253 to +257
if [ -f "uv.lock" ]; then
uv sync
else
uv pip install .
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

@jorgepiloto I was wondering if we could extend this to _doc-build-linux, _doc-build-windows, build-wheelhouse, check-vulnerabilities, and tests-pytest. Those are the actions I have noted where something similar to this might be needed (I am not sure if I am missing some others).

Or we could address those in a separate PR if that is what you prefer.

Copy link
Contributor

@MaxJPRey MaxJPRey left a comment

Choose a reason for hiding this comment

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

LGTM.

elif [[ "${BUILD_BACKEND}" == 'uv' ]]; then
uv pip install ."${extra_targets}"
if [ -f "uv.lock" ]; then
uv sync --extra "${extra_targets}"
Copy link

Choose a reason for hiding this comment

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

Suggested change
uv sync --extra "${extra_targets}"
uv sync --extra "${extra_targets}" --frozen

If we're using the lock file we need to not regenerate it when we sync

elif [[ "${BUILD_BACKEND}" == 'uv' ]]; then
uv pip install .
if [ -f "uv.lock" ]; then
uv sync
Copy link

Choose a reason for hiding this comment

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

Suggested change
uv sync
uv sync --frozen

run: |
${ACTIVATE_VENV}
if [[ "${USE_UV}" == 'true' ]]; then
uv pip install -U pip
Copy link

Choose a reason for hiding this comment

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

We need to not do this with uv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests related to resolving problems or errors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

code-style has different behavior between uv and poetry backends

5 participants