You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Version detection doesn't strip the PEP 508 environment marker from a pyproject.toml dependency specifier (captures trailing ;) #920
Hi! When a uv pin in pyproject.toml carries a PEP 508 environment marker, setup-uv's version-detection scrapes the version string but does not strip the marker. It captures everything up to the marker's semicolon (the semicolon included) and then fails to match it against the version manifest.
Given an entry of this form under a [dependency-groups] table in my pyproject.toml:
test = [
"uv==0.11.20; sys_platform != 'emscripten'",
]
setup-uv in CI logs the following:
Found version for uv in .../pyproject.toml: 0.11.20;
Getting available versions from https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson ...
##[error]No version found for 0.11.20;
The expected behaviour should be to strip the marker, i.e., everything from the first ; onward before parsing the version. Ideally, perhaps ideally recognising the environment marker too, by evaluating it against the runner's environment? At a minimum, it should not be treated as part of the version string.
For now, I have a workaround, as I can set the version: input for the action and pin it there, so as to skip the version detection from the repository's files.
A less intrusive workaround is to add a space after the version and before the semicolon, i.e., "uv==0.11.20 ; sys_platform != 'emscripten'". However, both ways are common patterns, as observed via code search results:
Activity
agriyakhetarpal commentedon Jun 18, 2026
A less intrusive workaround is to add a space after the version and before the semicolon, i.e.,
"uv==0.11.20 ; sys_platform != 'emscripten'". However, both ways are common patterns, as observed via code search results:Strip environment markers from detected uv dependency pins (astral-sh…