mach: Use uv to manage the virtual environment (#41861)

Instead of attempting to manage the virtual environment ourselves, use
`uv` to manage the installation of dependencies.
Since we still have dependencies coming from upstream wpt, we use
`[tool.setuptool]` in our pyproject.toml to ensure that `uv` dynamically
installs our dependencies according to the requirements.txt files.

Additionally, this PR also reverts `--no-project` usage. `--no-project`
was added as a temporary workaround in
https://github.com/servo/servo/pull/37741.
It's not 100% clear to me what exactly the issue was, but
[apparently](https://github.com/servo/servo/pull/37741#pullrequestreview-2985666234)
the issue caused the build to break.
Removing the arg seems to work fine, except that we get a warning about
a missing `requiress-python` value in `pyproject.toml`.
Apparently it is good practice to specify the requirement as `>=` in th
pyroject, and lock the exact version via `uv pin` (which writes to
`.python_version`, where we already pin 3.11.


Testing: Should be covered by existing tests, which compile code on all
platforms.

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender
2026-01-22 06:51:44 +01:00
committed by GitHub
parent 8c85c9d1bd
commit 82df609833
8 changed files with 1891 additions and 81 deletions

View File

@@ -23,4 +23,4 @@ if ($arguments.Count -gt 0) {
}
}
uv run --no-project python (Join-Path $workdir "mach") @arguments
uv run python (Join-Path $workdir "mach") @arguments