-
Notifications
You must be signed in to change notification settings - Fork 1
chore: migrate dependency management from Poetry to uv #150
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
Open
williaby
wants to merge
5
commits into
main
Choose a base branch
from
chore/migrate-poetry-to-uv
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cacd2e3
chore: migrate dependency management from Poetry to uv
claude 15b3df7
ci: drop Python 3.10 from the compatibility matrix
claude cdf48dc
chore: fix pre-existing lint/format debt and add FIPS check script
claude a543224
ci: add basedpyright config scoped to the package source
claude 49beb36
ci: add basedpyright as a dev dependency and configure it
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| # Front-Matter for GitHub Workflow | ||
| title: "Prepare uv Environment" | ||
| name: "prepare-uv.yml" | ||
| description: "Sets up a uv environment with Google Artifact Registry authentication" | ||
| category: workflow | ||
| usage: "Called by other workflows that need a uv environment" | ||
| behavior: "Installs uv, configures Assured OSS via keyring, and installs dependencies" | ||
| inputs: "GCP_SA_JSON secret for Google Artifact Registry authentication" | ||
| outputs: "python-version output variable and dev-requirements.txt file" | ||
| dependencies: "astral-sh/setup-uv, google-github-actions/auth" | ||
| author: "LedgerBase Team" | ||
| last_modified: "2026-05-29" | ||
| changelog: "Migrated dependency management to uv" | ||
| tags: [uv, workflow, python] | ||
| --- | ||
|
|
||
| name: Prepare uv Environment | ||
|
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| GCP_SA_JSON: | ||
| description: "Service account JSON for Google Artifact Registry" | ||
| required: true | ||
|
|
||
| jobs: | ||
| setup: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| python-version: ${{ steps.setup-python.outputs.python-version }} | ||
|
|
||
| # Route uv installs through Assured OSS, with PyPI as a fallback index | ||
| env: | ||
| UV_INDEX_URL: https://_json_key_base64:${{ secrets.GCP_SA_JSON }}@us-python.pkg.dev/cloud-aoss/cloud-aoss-python/simple | ||
| UV_EXTRA_INDEX_URL: https://pypi.org/simple | ||
|
|
||
| steps: | ||
| - name: Harden the runner (Audit all outbound calls) | ||
| uses: step-security/harden-runner@v2.12 | ||
| with: | ||
| egress-policy: audit | ||
|
Comment on lines
+33
to
+42
|
||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true | ||
| cache-dependency-glob: "uv.lock" | ||
|
|
||
| - name: Set up Python | ||
| id: setup-python | ||
| run: | | ||
| uv python install 3.11 | ||
| echo "python-version=3.11" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Authenticate to Google Artifact Registry | ||
| uses: google-github-actions/auth@v1 | ||
| with: | ||
| credentials_json: ${{ secrets.GCP_SA_JSON }} | ||
|
|
||
| - name: Install Artifact Registry keyring backend | ||
| run: uv tool install keyring --with keyrings.google-artifactregistry-auth | ||
|
|
||
| - name: Install Dependencies | ||
| run: uv sync --frozen --keyring-provider subprocess | ||
|
|
||
| - name: Export Dev Requirements | ||
| run: | | ||
| uv export --only-group dev --no-hashes --format requirements-txt \ | ||
| --output-file dev-requirements.txt | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
|
Comment on lines
+29
to
+73
|
||
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add explicit token permissions for least privilege.
Line 27 introduces a reusable workflow job without a
permissionsblock, so token scope defaults may be broader than needed. Add a minimal explicit scope (for this workflow, typicallycontents: read).Suggested patch
📝 Committable suggestion
🤖 Prompt for AI Agents