Feat/auto creation uvlock - #90
Merged
Merged
Conversation
…ution. Changed caching option to 'enable-cache', added 'cache-dependency-glob' for uv.lock, and updated install steps to clarify locked dependencies. Modified lint and test commands to run without syncing.
Owner
Author
rafaelpadilla
marked this pull request as ready for review
September 7, 2026 16:47
Mathtzt
approved these changes
Sep 7, 2026
Collaborator
There was a problem hiding this comment.
Thank you so much for the contribution and all the effort! 👏🏼
This is an excellent addition to our CI/CD pipeline. The automated lockfile synchronization ensures that pyproject.toml and uv.lock remain fully deterministic without requiring local manual intervention, resolving the issue for PETROBRAS users. With this, we can guarantee that the CI check fails early whenever there is a dependency mismatch.
I also appreciate our conversation about the lockfile, which gave me new insights into the best practices for version locking.
…3W into feat/auto_creation_uvlock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR introduces a new GitHub Actions workflow for automatically updating
uv.lockand makes small changes in the 2 existing workflows.The expected flow with these 3 Github Actions is:
Once a PR is merged to the main branch:
1. Workflow
update-uv-lock.ymlThis workflow runs when a pull request targeting
mainis:The workflow checks out the PR source branch and executes
uv lock. Ifuv.lockis created or modified, the workflow:uv.lock.Update uv.lockcommit.tests.ymlusing that exact SHA.If
uv.lockis already synchronized withpyproject.toml, the workflow:tests.ymlusing the current SHA.Therefore,
tests.ymlis called regardless of whetheruv.lockchanges, as long as the job completes successfully.Concurrent runs for the same PR are cancelled, ensuring that only the latest state of the PR is processed.
For PRs originating from forks, the workflow cannot push changes to the fork using
GITHUB_TOKEN. Ifuv.lockneeds to be updated, the workflow fails with a message requesting that the contributor generate and commit the lockfile manually. If the lockfile is already synchronized, the tests proceed normally.2. Workflow
tests.ymlFor PRs, this workflow is called by
update-uv-lock.ymlas a reusable workflow. It receives the exact repository and commit SHA that should be tested.It is also triggered directly on every push to
main, including pushes produced when pull requests are merged.Dependencies are installed with the
uv sync --locked --extra devfile in the branch of the PR. The--lockedoption guarantees that:uv.lockmust exist.uv.lockmust be consistent withpyproject.toml.The workflow performs:
3. Workflow:
publish.ymlThis workflow is triggered only after the
Tests and Coverageworkflow completes formain.The publication job proceeds only when:
Tests and Coveragecompleted successfully.main.This prevents package publication while linting or tests are still running and prevents publication if any CI job fails.
The workflow checks out the exact commit validated by
Tests and Coverageand compares the package version inpyproject.tomlwith the version from its parent commit.If the version is unchanged, package publication is skipped.
If the version changed, the workflow builds the source distribution and wheel and publishes the generated package to PyPI.
Result
These workflows ensure that:
uv.lockremains synchronized withpyproject.toml.uv.lockwith the new dependencies, workflow fails and alerts the user to update theuv.lock.uv.lockis generated inside Github structure, preventing need to be manually generated by the client's own machine. (Useful for PETROBRAS users) 😃main, making sure themainis always being tested even if a force push is performed.By creating this pull request, I confirm that I have read and fully accept and agree with one of the Petrobras' Contributor License Agreements (CLAs):
Our CLAs are based on the Apache Software Foundation's CLAs: