DEVX-151: perf: skip dep resolution in setup-image with --no-deps

This commit is contained in:
2026-08-07 21:01:06 +00:00
parent 7dd15f1461
commit ccb7023965
4 changed files with 12 additions and 4 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ setup-release: $(VENV)/bin/activate .env
# an older devx.mak that doesn't yet define devx-setup-image. Consumer repos # an older devx.mak that doesn't yet define devx-setup-image. Consumer repos
# (grm, infra) can safely alias to devx-setup-image since they install devx from PyPI. # (grm, infra) can safely alias to devx-setup-image since they install devx from PyPI.
setup-image: setup-image:
@if [ -d /opt/venv ]; then ln -sf /opt/venv $(VENV); . $(VENV)/bin/activate && pip install --no-cache-dir -e . 2>/dev/null; \ @if [ -d /opt/venv ]; then ln -sf /opt/venv $(VENV); . $(VENV)/bin/activate && pip install --no-cache-dir --no-deps -e . 2>/dev/null; \
else echo "[setup-image] /opt/venv not found — falling back to setup-ci"; $(MAKE) setup-ci; fi else echo "[setup-image] /opt/venv not found — falling back to setup-ci"; $(MAKE) setup-ci; fi
install-hooks: install-hooks:
+7 -2
View File
@@ -64,11 +64,16 @@ molecule = [
"ansible-core==2.21.1", "ansible-core==2.21.1",
] ]
# Deploy tools (for infra staging/production deployments) # Deploy tools (for infra staging/production deployments)
# Versions aligned with infra's pyproject.toml to avoid reinstalls on every CI job.
# bcrypt and PyJWT are infra deps not in devx core — included here so the CI
# image has them and setup-image can use --no-deps (skip dep resolution).
deploy = [ deploy = [
"ansible-core==2.21.1", "ansible-core==2.21.1",
"boto3==1.43.37", "boto3==1.43.44",
"docker==7.1.0", "docker==7.1.0",
"cryptography==49.0.0", "cryptography==50.0.0",
"bcrypt==5.0.0",
"PyJWT==2.13.0",
] ]
# Full dev environment (local development) # Full dev environment (local development)
dev = [ dev = [
+3 -1
View File
@@ -64,9 +64,11 @@ def _install_in_image(
link.symlink_to(opt_venv) link.symlink_to(opt_venv)
# Build pip install command # Build pip install command
# --no-deps: the CI image already has all dependencies pre-installed.
# We only need to install the project itself in editable mode.
spec = f".[{extras}]" if extras else "." spec = f".[{extras}]" if extras else "."
pip_bin = str(Path(venv_link) / "bin" / "pip") pip_bin = str(Path(venv_link) / "bin" / "pip")
cmd = [pip_bin, "install", "--no-cache-dir", "-e", spec] cmd = [pip_bin, "install", "--no-cache-dir", "--no-deps", "-e", spec]
env = os.environ.copy() env = os.environ.copy()
try: try:
+1
View File
@@ -52,6 +52,7 @@ class TestInstallInImage:
mock_run.assert_called_once() mock_run.assert_called_once()
cmd = mock_run.call_args[0][0] cmd = mock_run.call_args[0][0]
assert "--no-cache-dir" in cmd assert "--no-cache-dir" in cmd
assert "--no-deps" in cmd
assert "-e" in cmd assert "-e" in cmd
assert "." in cmd assert "." in cmd
# No extras → spec is "." # No extras → spec is "."