-
Notifications
You must be signed in to change notification settings - Fork 0
docs: cover Python dependency updates #41
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| --- | ||
| name: update-deps | ||
| description: "Inventory, assess, update, and validate third-party dependencies across Bun, Cargo, Docker, and GitHub Actions without hiding ecosystem or supply-chain risk." | ||
| description: "Inventory, assess, update, and validate third-party dependencies across Bun, Python/uv, Cargo, Docker, and GitHub Actions without hiding ecosystem or supply-chain risk." | ||
| --- | ||
|
|
||
| # Update Dependencies | ||
|
|
@@ -16,6 +16,7 @@ catalogs or resolutions, automated update configuration, and open dependency PRs | |
| when relevant. Common sources include: | ||
|
|
||
| - `package.json`, workspace manifests, `bun.lock`, and `bunfig.toml` | ||
| - every relevant `pyproject.toml`, `uv.lock`, and Python constraints file | ||
| - every relevant `Cargo.toml` and its `Cargo.lock` | ||
| - `Dockerfile*` and Compose YAML | ||
| - `.github/workflows/*` and dependency-update configuration | ||
|
|
@@ -67,6 +68,19 @@ manifest's current version requirements. Supplement it with registry-aware | |
| report the limitation. Do not default to `--root-deps-only` when | ||
| `cargo-outdated` is available: transitive changes can carry the material risk. | ||
|
|
||
| For each uv-managed Python project, inspect direct and transitive packages: | ||
|
|
||
| ```bash | ||
| uv tree --project <path> --outdated | ||
| ``` | ||
|
|
||
| Also compare every direct dependency's declared constraint with authoritative | ||
| PyPI metadata. `uv tree --outdated` can hide a newer release when the current | ||
| constraint excludes it, so it is not a complete major-version inventory by | ||
| itself. Keep accelerator packages and their container runtime in one compatibility | ||
| batch: verify the Python wheel's CUDA/ROCm requirements against the selected base | ||
| image and exercise a native-library import or linkage smoke test. | ||
|
|
||
| Inventory container references across Dockerfiles and Compose files: | ||
|
|
||
| ```bash | ||
|
|
@@ -131,6 +145,17 @@ Edit the manifest only when the declared requirement must change. Do not run bar | |
| `cargo update` for an ordinary batch; a full-graph update must be an explicit, | ||
| reviewed choice. | ||
|
|
||
| For uv, update only the planned packages and review the resulting lockfile: | ||
|
|
||
| ```bash | ||
| uv lock --project <path> --upgrade-package <package> | ||
| uv sync --project <path> --frozen | ||
| ``` | ||
|
Comment on lines
+148
to
+153
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- relevant file sections ---'
sed -n '1,35p;60,95p;135,170p;175,200p' skills/update-deps/SKILL.md
printf '%s\n' '--- uv references and version pins ---'
rg -n -i --glob '!**/.git/**' '(^|[^[:alnum:]_])uv([^[:alnum:]_]|$)|uv-version|UV_VERSION|astral-sh/setup-uv|setup-uv' .
printf '%s\n' '--- tracked project/configuration files ---'
git ls-files | rg '(^|/)(pyproject\.toml|uv\.lock|\.python-version|.*uv.*|.*depend.*|.*workflow.*|.*ya?ml)$' || trueRepository: stella/ai-shared Length of output: 7013 🌐 Web query:
💡 Result: When you run uv sync --frozen, uv uses the existing lockfile as the single source of truth for the project's dependencies and will not attempt to update it, even if there are changes to your pyproject.toml [1][2]. Key behaviors of the --frozen flag include: 1. No Lockfile Updates: uv will not perform any dependency resolution or modify the uv.lock file [1][2]. If you have added, removed, or changed version constraints in your pyproject.toml, those changes will not be reflected in the lockfile or the environment [1][3]. 2. Environment Syncing: While the environment will still be synchronized to match the current lockfile, it will ignore any discrepancies between the pyproject.toml and the lockfile [1][3]. 3. Error Handling: If the lockfile is missing, uv will exit with an error because it cannot proceed without a source of truth [1]. 4. Consistency: This flag is primarily used for reproducible builds in environments like CI/CD pipelines, ensuring that the environment is created exactly as defined in the lockfile without external interference [3][4]. If you need to ensure the lockfile is up-to-date with your pyproject.toml instead of using a frozen state, you should omit the --frozen flag, which allows uv to automatically detect discrepancies and update the lockfile [3][4]. Citations:
🌐 Web query:
💡 Result: To upgrade a specific package in your project using uv, use the --upgrade-package flag with the uv lock command [1][2]. This will update the specified package to the latest version allowed by your project's dependency constraints while leaving other locked dependencies unchanged [1][2]. Basic usage: $ uv lock --upgrade-package You can also upgrade a package to a specific version: $ uv lock --upgrade-package == The --upgrade-package flag is also compatible with other project commands like uv sync and uv run, which will update both the lockfile and your environment [1][3]. Note that all upgrades remain constrained by the requirements defined in your pyproject.toml (e.g., version bounds) [1][3]. Citations:
Move the direct-constraint edit before 🤖 Prompt for AI AgentsSource: MCP tools |
||
|
|
||
| Edit `pyproject.toml` when intentionally widening or changing a direct dependency | ||
| constraint. Do not run an unscoped full Python upgrade unless the batch explicitly | ||
| covers the full Python graph. | ||
|
|
||
| Pin GitHub Actions to commit SHAs and container images to immutable digests when | ||
| that is repository policy. Review every manifest and lockfile delta for unexpected | ||
| transitive additions, replacements, features, scripts, or platform changes. | ||
|
|
@@ -150,6 +175,18 @@ cargo check --manifest-path <path/to/Cargo.toml> | |
| cargo test --manifest-path <path/to/Cargo.toml> | ||
| ``` | ||
|
|
||
| Use each Python command against its actual project and locked environment, for | ||
| example: | ||
|
|
||
| ```bash | ||
| uv lock --project <path> --check | ||
| uv run --project <path> <lint-or-test-command> | ||
| ``` | ||
|
|
||
| For native or GPU packages, also build the production image and run the | ||
| repository's import/linkage smoke test so a resolver-green but ABI-incompatible | ||
| update cannot land. | ||
|
|
||
| Run the repository's dependency or security audit command when it defines one, | ||
| for example `bun run security:audit`, and report its result. Do not substitute a | ||
| generic command for repository policy when no such audit is configured. | ||
|
|
||
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.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: stella/ai-shared
Length of output: 22613
🌐 Web query:
site:docs.astral.sh/uv concepts projects dependencies tool.uv.sources indexes package metadata uv tree outdated💡 Result:
In uv, projects are managed using pyproject.toml, which defines dependencies and project configuration [1][2][3]. Dependencies are specified in tables like project.dependencies (published packages) and dependency-groups (development dependencies) [1]. Key concepts and tools include: tool.uv.sources: This table extends standard dependency tables to provide alternative sources for packages during development, such as Git repositories, URLs, local paths, or specific package indexes [4][1]. These sources are respected exclusively by uv and are not used by other tools [1]. Indexes: By default, uv uses PyPI [5]. You can configure additional or private package indexes via the [[tool.uv.index]] setting in pyproject.toml [4][5]. Packages can be pinned to a specific index within tool.uv.sources, or an index can be marked as explicit = true to restrict it from being used unless explicitly pinned [1][5]. Package Metadata: During resolution, uv uses static metadata from indexes [6]. For packages where this is missing or incorrect—particularly those requiring builds—the tool.uv.dependency-metadata table allows you to provide static metadata upfront to bypass build-time resolution issues [7][6]. uv tree: This command displays the project's dependency tree, showing how dependencies are resolved [8][9][10]. It automatically ensures the lockfile and environment are up-to-date before running [2]. Outdated Packages: To manage updates, you can use uv lock --upgrade to update the entire lockfile or --upgrade-package to target specific packages for upgrade [3]. While there is no single "uv outdated" command, uv's workflow centers on keeping the environment and lockfile in sync with the pyproject.toml definitions [2][3]. top_results: [4][1][7][5][6][2][3]
Citations:
Resolve each dependency's configured source before checking metadata. Use PyPI metadata only for PyPI-backed packages. Use the configured
tool.uv.sourcesor[[tool.uv.index]]source for private indexes, Git, URL, path, or workspace dependencies.🤖 Prompt for AI Agents
Source: MCP tools