ansible / ansible/actions

matrix: uv config fails with multiple python versions

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6
Forks
6
Avg merge
7d 3h
Merged PRs (30d)
3

Description

Bug originates in https://github.com/ansible/actions/blob/main/.github/workflows/tox.yml#L60 as we wrongly assumed that we can pass multiple versions with newlines separator to astral-sh/setup-python the same way we did with actions/setup-python.

Our dynamic matrix actions returns a JSON file that can be used by github to generate the job matrix.

One example of output:

```
"matrix": {
"include": [
{
"command": "tox -e py38-unit",
"command2": "tox -e py310-integration",
"name": "all-linux-arm64",
"os": "ubuntu-24.04-arm64-2core",
"python_version": "3.8\n3.14-dev",
"uv_python_version": "3.8\n3.14",
"runner": "ubuntu-24.04-arm64-2core",
},
{
"command": "tox -e foo",
"mise": "true",
"name": "foo",
"os": "custom-arm64",
"python_version": "3.8",
"uv_python_version": "3.8",
"runner": "custom-arm64",
},
}
```

If we look at `python_version` returned value we can see that in some cases it can have multiple values and that worked fine.

Because github does not allow loops for steps we cannot run setup-uv multiple times.

As a temporary workaround till we will be able to use the action multiple python versions we will change the implementation to return a single python version inside `uv_python_version` field. This will make setup-uv action pass and luckily as uv is able to download missing interpreters our jobs will still run. Downside is that this means that caching will work only for the first python version.

Upstream: https://github.com/astral-sh/uv/issues/15659

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with .github/workflows/tox.yml around line 60 and inspect how the dynamic matrix produces python_version and uv_python_version. Compare the newline-separated values with the setup actions' inputs and check the upstream uv issue for current constraints. Done means the matrix workflow handles jobs with multiple Python versions without setup-uv failing, while preserving the existing single-version cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.