Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/release-artifacts-smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ def commit(message: str) -> str:
(root / "scripts").mkdir()
shutil.copyfile(SCRIPT, root / "scripts/release_artifacts.py")
shutil.copyfile(ROOT / "pyproject.toml", root / "pyproject.toml")
(root / "loopx").mkdir()
(root / "loopx/control_plane/testing").mkdir(parents=True)
shutil.copyfile(ROOT / "loopx/__init__.py", root / "loopx/__init__.py")
shutil.copyfile(ROOT / "loopx/release_metadata.py", root / "loopx/release_metadata.py")
shutil.copyfile(
ROOT / "loopx/control_plane/testing/release_metadata.py",
root / "loopx/control_plane/testing/release_metadata.py",
)
with (root / "loopx/__init__.py").open("a") as initializer:
initializer.write('\nraise RuntimeError("artifact inspection executed the candidate")\n')
artifacts = [*packages.iterdir(), root / "dist/SHA256SUMS"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pathlib import Path
from typing import Any, Callable, Mapping

from ...release_metadata import checkout_release_metadata
from .release_metadata import checkout_release_metadata
from ..content_digest import ENVELOPED_SHA256_PATTERN
from ..runtime.public_safety import public_safe_compact_text
from .actual_default_model_behavior_portfolio import (
Expand Down
4 changes: 3 additions & 1 deletion scripts/release_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def load_identity(project_root: Path) -> ReleaseIdentity:
try:
# The tool can inspect its own checkout: loading its package would run
# the very initializer whose version must remain inert.
reader = runpy.run_path(str(Path(__file__).resolve().parents[1] / "loopx/release_metadata.py"))
reader = runpy.run_path(
str(Path(__file__).resolve().parents[1] / "loopx/control_plane/testing/release_metadata.py")
)
return ReleaseIdentity(**reader["checkout_release_metadata"](project_root))
except (OSError, SyntaxError, ValueError) as exc:
raise ReleaseArtifactError(str(exc)) from exc
Expand Down
4 changes: 2 additions & 2 deletions tests/architecture/top_level_module_budget.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schema": "loopx_top_level_module_budget_v0",
"baseline_commit": "0514512ee7fbdf5548c88d07763a41dbfc5df931",
"max_top_level_modules": 124,
"baseline_commit": "421aa770eaf6da329ee47fe3f3a23a108d3e8fb0",
"max_top_level_modules": 123,
"allowlist": ["__init__.py", "entrypoint.py", "cli.py"]
}
7 changes: 5 additions & 2 deletions tests/test_release_artifact_publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
@pytest.mark.parametrize("metadata", ["valid", "mismatch", "malformed"])
def test_colocated_artifact_cli_never_initializes_the_candidate(tmp_path, isolated, metadata):
root = Path(__file__).resolve().parents[1]
(tmp_path / "loopx").mkdir()
shutil.copyfile(root / "loopx/release_metadata.py", tmp_path / "loopx/release_metadata.py")
(tmp_path / "loopx/control_plane/testing").mkdir(parents=True)
shutil.copyfile(
root / "loopx/control_plane/testing/release_metadata.py",
tmp_path / "loopx/control_plane/testing/release_metadata.py",
)
(tmp_path / "scripts").mkdir()
script = tmp_path / "scripts/release_artifacts.py"
shutil.copyfile(root / "scripts/release_artifacts.py", script)
Expand Down
Loading