Skip to content

Refactored python cicd pipeline to use uv#99

Merged
karleinarb merged 19 commits into
mainfrom
python-uv-refactor
May 21, 2026
Merged

Refactored python cicd pipeline to use uv#99
karleinarb merged 19 commits into
mainfrom
python-uv-refactor

Conversation

@karleinarb
Copy link
Copy Markdown
Contributor

@karleinarb karleinarb commented May 20, 2026

Testet mot dsb-data-api, går grønt.


This pull request updates our Python project build workflow to use uv for environment and dependency management, replacing the previous reliance on pip and actions/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:

  • Switched from actions/setup-python to astral-sh/setup-uv in the workflow, letting uv manage both Python installation and caching.
  • Updated the build script to install dependencies using uv sync --locked (from uv.lock) instead of pip install ., ensuring reproducible installs.
  • All project commands (linting with ruff, type checking with pyright, and testing with pytest) now run via uv run, ensuring they execute within the uv-managed environment. [1] [2] [3]
  • Updated the allowed commands list to include uv and remove python, reflecting the new toolchain.

Dependency Metadata Extraction Improvements:

  • Enhanced the dependency parsing logic to support PEP 621 extras ([project.optional-dependencies]) and PEP 735 dependency groups (e.g., [dependency-groups.dev]), capturing group information for each dependency in the metadata.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 --locked and run tooling via uv run.
  • Replaced actions/setup-python with astral-sh/setup-uv and adjusted the command allowlist to permit uv.
  • Enhanced pyproject.toml dependency 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.

Comment thread ci-cd/build-python-project/action.yml
Comment thread ci-cd/build-python-project/action/2_python-build.ts Outdated
Comment thread ci-cd/create-app-vars-matrix/action/4_get-app-meta.ts Outdated
Comment thread ci-cd/create-app-vars-matrix/action/4_get-app-meta.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

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:

  • dl.deno.land
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
  • jsr.io
    • Triggering command: /usr/bin/deno deno test --unstable-temporal --no-check --allow-all create-app-vars-matrix/action/test_get-app-meta.ts (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits May 20, 2026 13:11
Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

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:

  • dl.deno.land
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
  • dl.google.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)
  • jsr.io
    • Triggering command: /usr/local/lib/node_modules/deno/deno /usr/local/lib/node_modules/deno/deno test --unstable-temporal --no-check --allow-all (dns block)
    • Triggering command: /usr/local/bin/deno deno test --unstable-temporal --no-check --allow-all create-app-vars-matrix/action/test_get-app-meta.ts (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

This reverts commit e61daf4.
@karleinarb karleinarb requested a review from a team May 21, 2026 06:51
@karleinarb karleinarb merged commit 10077db into main May 21, 2026
3 checks passed
@karleinarb karleinarb deleted the python-uv-refactor branch May 21, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants