Add a system test for the chainguard Python image (#18460)

Should require https://github.com/astral-sh/uv/pull/18457
This commit is contained in:
Zanie Blue
2026-03-20 13:13:43 -05:00
committed by GitHub
parent 00e4746cc0
commit 8093dfcaa9
2 changed files with 65 additions and 0 deletions
+11
View File
@@ -120,6 +120,17 @@ if __name__ == "__main__":
f"Script was ran with {our_python_path} but `python` resolves to {system_python_path}"
)
# Ensure that pip is available (e.g., the Chainguard distroless image ships
# Python but not pip).
try:
import pip # noqa: F401
except ModuleNotFoundError:
logging.info("pip not found, running ensurepip...")
subprocess.run(
[sys.executable, "-m", "ensurepip"],
check=True,
)
# Create a temporary directory.
with tempfile.TemporaryDirectory() as temp_dir:
# Ensure that the package (`pylint`) isn't installed.