Icon generation selected the application venv, where resvg-py was missing. Adding it to the dev extra also selected it for production payloads built with --all-extras. Use a locked icon-build dependency group in an isolated uv environment. Keep its wheel cache separate from the PM cache copied into payloads. Route generation and structural checks through the same runner. Verified clean-source generation without resvg in the runtime venv, runtime dependency export exclusion, targeted Python and JS tests, and the full web workspace build. Signed desktop packaging was not run.
23 lines
858 B
Python
23 lines
858 B
Python
"""Icon tooling must not join the runtime's all-extras dependency set."""
|
|
import re
|
|
import shutil
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
|
|
def test_icon_group_is_separate_from_runtime_extras():
|
|
root = Path(__file__).resolve().parents[1]
|
|
uv = shutil.which("uv")
|
|
assert uv, "uv is required for the dependency-selection contract"
|
|
|
|
def packages(*selection):
|
|
result = subprocess.run(
|
|
[uv, "export", "--frozen", "--offline", "--no-hashes", "--no-annotate",
|
|
"--no-header", "--no-emit-project", *selection],
|
|
cwd=root, capture_output=True, text=True, encoding="utf-8", check=True,
|
|
)
|
|
return set(re.findall(r"^([a-z0-9-]+)==", result.stdout, re.MULTILINE))
|
|
|
|
assert "resvg-py" not in packages("--all-extras")
|
|
assert packages("--only-group", "icon-build") == {"pillow", "resvg-py"}
|