Skip to content

feat(python-ci): support uv projects via package-manager input#244

Merged
CybotTM merged 1 commit into
mainfrom
feat/python-ci-uv
Jul 20, 2026
Merged

feat(python-ci): support uv projects via package-manager input#244
CybotTM merged 1 commit into
mainfrom
feat/python-ci-uv

Conversation

@CybotTM

@CybotTM CybotTM commented Jul 20, 2026

Copy link
Copy Markdown
Member

What

Adds a package-manager input (pip | poetry | uv, default pip) to the reusable python-ci.yml.

When uv:

  • astral-sh/setup-uv runs (with enable-cache: true) before Python setup;
  • the actions/setup-python pip cache is disabled — uv projects ship no requirements.txt/pyproject pip lockfile for setup-python to hash, so leaving the pip cache on hard-fails the run (no file matched **/requirements.txt or **/pyproject.toml);
  • callers drive install/lint/test with uv (install-cmd: uv sync --frozen --extra dev, lint-cmd: uv run ruff check ., etc.).

pip/poetry behaviour is unchanged (setup-python cache preserved). Implemented with two conditional setup-python steps (uv vs non-uv) rather than an inline ternary — a true && '' || cache ternary is unsound (empty string is falsy, so uv would wrongly get the pip cache; zizmor flagged it).

Why

Mirrors the package-manager handling already in python-audit.yml, and unblocks routing uv-based repos (e.g. jira-to-openproject) through the shared reusable so their setup-python pin is maintained centrally instead of per-repo by Renovate.

Verification

Local actionlint, yamllint (repo config), zizmor — all clean.

Add a package-manager input (pip/poetry/uv). With 'uv', astral-sh/setup-uv
runs (with its dependency cache) before Python setup, and the
actions/setup-python pip cache is disabled — uv projects ship no
requirements.txt/pyproject pip lockfile for setup-python to hash, which
would otherwise fail the run. Callers then drive install/lint/test with uv
(uv sync, uv run ...). Mirrors the package-manager handling already in
python-audit.yml; pip/poetry behaviour is unchanged.

Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>
Copilot AI review requested due to automatic review settings July 20, 2026 14:59
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CybotTM
CybotTM merged commit 48ae6c9 into main Jul 20, 2026
11 of 12 checks passed
@CybotTM
CybotTM deleted the feat/python-ci-uv branch July 20, 2026 15:00
CybotTM added a commit to netresearch/jira-to-openproject that referenced this pull request Jul 20, 2026
## What

Routes the Python jobs through the org's shared reusables in
`netresearch/.github` (with `package-manager: uv`), so the pinned action
versions (`checkout`, `setup-uv`, `setup-python`) are maintained
centrally instead of inline per-repo:

- **ci.yml**: `lint` / `typecheck` / `architecture` / `test` →
**`python-ci.yml@main`**. The test env (which `tests/conftest.py`
expects; `.env.test` is untracked) is exported to `$GITHUB_ENV` from
`install-cmd`. `container-tests` stays inline (buildx + `make`, no
Python setup).
- **security.yml**: inline `pip-audit` → **`python-audit.yml@main`**
(also adds a bandit scan). `gitleaks` + `dependency-review` already used
shared reusables.

Depends on netresearch/.github#244 (uv support in `python-ci.yml`),
already merged.

## Branch protection

Reusable-backed jobs report as `<job> / <reusable-job>`, so the required
status-check names change. The required checks are updated in lockstep
with this PR:

- `Lint (ruff)` → `lint / Python 3.14 (ubuntu-latest)`
- `Type check (mypy)` → `typecheck / Python 3.14 (ubuntu-latest)`
- `Tests (pytest)` → `test / Python 3.14 (ubuntu-latest)`
- `Python Dependency Audit` → `audit / pip-audit` (+ `audit / bandit`)
- `container-tests` and `gitleaks / Secret Scanning` unchanged.

## Verification

Local `actionlint`, `yamllint`, and a `bash -n` on the test
`install-cmd` — all clean.
CybotTM added a commit that referenced this pull request Jul 21, 2026
)

python-ci.yml / node-test.yml / node-build.yml use bash syntax (`case`
validation, `bash -c` command routing) that ParserErrors or silently
no-ops under PowerShell on windows-latest. Adds `defaults.run.shell:
bash`. Fixes windows os-matrix cells — coding_agent_cli_toolset's main
CI has been red on windows since the uv/package-manager change (#244).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants