Skip to content

feat: infer targets from uv required environments - #150

Merged
patrickballard merged 4 commits into
wheelgap:mainfrom
Swarneil1905:feat/71-uv-required-environments
Nov 10, 2026
Merged

patrickballard merged 4 commits into
wheelgap:mainfrom
Swarneil1905:feat/71-uv-required-environments

Conversation

@Swarneil1905

@Swarneil1905 Swarneil1905 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #71

What this changes

Uses [tool.uv] required-environments to infer default targets from NATIVE_PLATFORMS, evaluating markers with the existing marker_holds helper and the selected Python versions.

Target precedence remains -t, then --dockerfile, then [tool.wheelgap] targets, followed by uv’s required environments and the built-in defaults. Inferred targets are explained on stderr. Linux markers include both glibc and musl targets because environment markers cannot distinguish them.

Absent or empty settings retain the built-in defaults. Invalid settings or markers matching no supported native target produce an input error. With multiple Python versions, matching platforms are combined and checked across the selected versions.

Adds 34 offline tests covering marker combinations, Python selection, precedence, validation, and output handling, plus README documentation. environments, mobile, and Pyodide inference remain outside this change.

Validated on Windows with Python 3.13.14: 666 tests passed, 1 skipped. Ruff formatting, lint, mypy, and git diff --check passed.

AI tools used: OpenAI Codex assisted with implementation, tests, documentation, and review. I reviewed the changes and ran the validation commands locally.

Checklist

  • Tests added or updated using fake_pypi, without network access
  • uv run --group dev ruff format . and uv run --group dev ruff check . pass
  • uv run --group dev mypy and uv run --group dev pytest pass
  • CHANGELOG.md entry under ## Unreleased with PR feat: infer targets from uv required environments #150- will add once the PR number is available, as requested in AGENTS.md
  • README updated

Swarneil1905 and others added 3 commits November 9, 2026 21:39
…to defaults (wheelgap#150)

- uv accepts required-environments as a string or a list; a string was an error.
- The inferred-targets note is now hidden with -q, like the other notes.
- Markers that select no native target (a mobile-only project, or a package
  check run in such a folder) fall back to the default targets with a note
  instead of failing the run.
- README and CHANGELOG say plainly that inferred targets replace the defaults.
- No blank line inside the Unreleased list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@patrickballard
patrickballard merged commit ff0a3e7 into wheelgap:main Nov 10, 2026
9 checks passed
@patrickballard

Copy link
Copy Markdown
Collaborator

Merged, thanks @Swarneil1905! You turned the request into a PR within ten minutes of asking, and the tests are thorough: Python selection from every source, precedence, and the glibc/musl note all pinned down. It's also the first issue to go through our new assignment rule, which was your idea.

We made a few changes before merging:

  • uv also accepts required-environments as a single string, so that works now too.
  • The note is hidden with -q, like the other notes.
  • Markers that match no native target (a mobile-only project, say, or wheelgap requests run in such a folder) fall back to the default targets with a note, instead of failing the run.
  • The README and CHANGELOG now say plainly that inferred targets replace the defaults.

For your next one, #84 (version ranges: pick the newest release that supports each target's Python) is a help wanted issue with no PR yet. It's in the same targets-and-Pythons territory you know well now.

(Review assisted by Claude.)

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.

Use uv's environments settings to pick default targets

2 participants