Update the scenarios to use vendored build dependencies (#1605)

Uses `--find-links` to discover vendored scenario build dependencies and
allows us to use `--index-url` instead of `--extra-index-url` to avoid
hitting the real PyPI in scenario tests.
This commit is contained in:
Zanie Blue
2024-02-19 15:55:03 -06:00
committed by GitHub
parent 1d9daa6de1
commit f3ef55f879
5 changed files with 51 additions and 12 deletions
+10 -1
View File
@@ -26,14 +26,23 @@ fn command(context: &TestContext, python_versions: &[&str]) -> Command {
.arg("pip")
.arg("compile")
.arg("requirements.in")
.arg("--extra-index-url")
.arg("--index-url")
.arg("https://test.pypi.org/simple")
.arg("--find-links")
.arg("{{vendor_links}}")
.arg("--cache-dir")
.arg(context.cache_dir.path())
.env("VIRTUAL_ENV", context.venv.as_os_str())
.env("UV_NO_WRAP", "1")
.env("UV_TEST_PYTHON_PATH", bin)
.current_dir(&context.temp_dir);
if cfg!(all(windows, debug_assertions)) {
// TODO(konstin): Reduce stack usage in debug mode enough that the tests pass with the
// default windows stack of 1MB
command.env("UV_STACK_SIZE", (8 * 1024 * 1024).to_string());
}
command
}
+10 -1
View File
@@ -46,13 +46,22 @@ fn command(context: &TestContext) -> Command {
command
.arg("pip")
.arg("install")
.arg("--extra-index-url")
.arg("--index-url")
.arg("https://test.pypi.org/simple")
.arg("--find-links")
.arg("{{vendor_links}}")
.arg("--cache-dir")
.arg(context.cache_dir.path())
.env("VIRTUAL_ENV", context.venv.as_os_str())
.env("UV_NO_WRAP", "1")
.current_dir(&context.temp_dir);
if cfg!(all(windows, debug_assertions)) {
// TODO(konstin): Reduce stack usage in debug mode enough that the tests pass with the
// default windows stack of 1MB
command.env("UV_STACK_SIZE", (8 * 1024 * 1024).to_string());
}
command
}
+4 -1
View File
@@ -45,7 +45,7 @@ import textwrap
from pathlib import Path
PACKSE_COMMIT = "64b4451b832cece378f6e773d326ea09efe8903d"
PACKSE_COMMIT = "de0bab473eeaa4445db5a8febd732c655fad3d52"
TOOL_ROOT = Path(__file__).parent
TEMPLATES = TOOL_ROOT / "templates"
INSTALL_TEMPLATE = TEMPLATES / "install.mustache"
@@ -205,6 +205,9 @@ for template, tests, scenarios in [
# Add generated metadata
data["generated_from"] = f"https://github.com/zanieb/packse/tree/{commit}/scenarios"
data["generated_with"] = " ".join(sys.argv)
data[
"vendor_links"
] = f"https://raw.githubusercontent.com/zanieb/packse/{commit}/vendor/links.html"
# Render the template
print(f"Rendering template {template.name}", file=sys.stderr)