Files
servo/pyproject.toml
Jonathan Schwender 82df609833 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>
2026-01-22 05:51:44 +00:00

80 lines
1.7 KiB
TOML

[project]
# `uv` logs warnings if this file doesn't contain a `project` table.
name = "servo"
version = "0.0.1"
requires-python = ">=3.11"
dynamic = ["dependencies"]
[tool.setuptools.dynamic]
dependencies = { file = ["python/requirements.txt", "tests/wpt/tests/tools/requirements_tests.txt", "tests/wpt/tests/tools/wptrunner/requirements.txt"] }
[tool.setuptools.packages.find]
exclude = ["config*"]
[tool.ruff]
line-length = 120
extend-exclude = [
# temporary local files
"target/**",
"__pycache__/**",
"python/_venv*/**",
# upstream
"third_party/**",
"python/mach/**",
"components/net/**",
"components/shared/**",
"tests/**",
]
[tool.ruff.lint]
select = [
"E",
"W",
"F",
# Type Annotation
"ANN",
]
ignore = [
# Trailing whitespace; the standard tidy process will enforce no trailing whitespace
"W291",
# 80 character line length; the standard tidy process will enforce line length
"E501",
# allow Any type
"ANN401",
]
[tool.ruff.lint.per-file-ignores]
"etc/**" = ["ANN"]
"**/test.py" = ["ANN"]
"**/*_tests.py" = ["ANN"]
"**/tests/**/*.py" = ["ANN"]
[tool.pyrefly]
search-path = [
"python",
"tests/wpt/tests",
"tests/wpt/tests/tools",
"tests/wpt/tests/tools/wptrunner",
"tests/wpt/tests/tools/wptserve",
"python/mach",
"python/wpt",
"third_party/WebIDL",
"components/script_bindings/codegen",
]
project-includes = [
"python/**/*.py",
"components/script_bindings",
]
project-excludes = [
"**/venv/**",
"**/.venv/**",
"tests/wpt/tests/**",
"**/test.py",
"**/*_tests.py",
"**/tests/**",
"python/mach/**/*.py",
]
[tool.uv]
native-tls = true