Refactored python cicd pipeline to use uv#99
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the Python build CI/CD action to use uv for environment/dependency management (replacing actions/setup-python + pip) and extends Python pyproject.toml metadata parsing to capture dependencies from optional-dependencies and dependency groups.
Changes:
- Updated the Python build composite action to install dependencies with
uv sync --lockedand run tooling viauv run. - Replaced
actions/setup-pythonwithastral-sh/setup-uvand adjusted the command allowlist to permituv. - Enhanced
pyproject.tomldependency parsing to include PEP 621 optional-dependencies and PEP 735 dependency-groups (with group attribution).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| ci-cd/create-app-vars-matrix/action/4_get-app-meta.ts | Adds parsing for optional-dependencies and dependency-groups when extracting Python dependency metadata. |
| ci-cd/common/utils/helpers.ts | Updates the allowed command list to allow uv (and no longer allow python). |
| ci-cd/build-python-project/action/2_python-build.ts | Switches install/tool execution from python -m ... to uv sync and uv run .... |
| ci-cd/build-python-project/action.yml | Swaps Python setup to setup-uv and prints uv/Python version info. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dsb-norge/github-actions/sessions/5bd56cab-9d7c-4b26-b16a-0752a698190e Co-authored-by: karleinarb <45044399+karleinarb@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/dsb-norge/github-actions/sessions/5eaaf7b8-1b9a-4d09-808b-7a7c2839a466 Co-authored-by: karleinarb <45044399+karleinarb@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dsb-norge/github-actions/sessions/5eaaf7b8-1b9a-4d09-808b-7a7c2839a466 Co-authored-by: karleinarb <45044399+karleinarb@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Testet mot dsb-data-api, går grønt.
This pull request updates our Python project build workflow to use
uvfor environment and dependency management, replacing the previous reliance onpipandactions/setup-python. The changes streamline the setup, installation, and execution of Python tools, and improve dependency parsing for richer metadata extraction.Build and Dependency Management Updates:
actions/setup-pythontoastral-sh/setup-uvin the workflow, lettinguvmanage both Python installation and caching.uv sync --locked(fromuv.lock) instead ofpip install ., ensuring reproducible installs.ruff, type checking withpyright, and testing withpytest) now run viauv run, ensuring they execute within theuv-managed environment. [1] [2] [3]uvand removepython, reflecting the new toolchain.Dependency Metadata Extraction Improvements:
[project.optional-dependencies]) and PEP 735 dependency groups (e.g.,[dependency-groups.dev]), capturing group information for each dependency in the metadata.