fix(lab): support legacy Python 3.9 adapters
This commit is contained in:
@@ -41,9 +41,9 @@ def test_component_image_installer_binds_bases_and_adapter_sources() -> None:
|
||||
for digest in (
|
||||
"58df7489c3f2276f9591d500a012dee03e23d35543ce3c390b4c001e6bf90794",
|
||||
"591cb382c099eeb05e7ec16e2371e0b2da54d2bb5c49ec0f4ac88dbf72b0f0cd",
|
||||
"fb208c6cd337153827147006cd26bf4c1c00963f91eb801280485dbc7213d08b",
|
||||
"91c1878a58acf3ac35ce894f4de9b63cba3b7f29a65548e28df176063a2953c9",
|
||||
"b48ef255403abcfd177a6550688410a52b0fbd29d2a54c8417cb5a0daa330ad5",
|
||||
"d2af887b065b0f63890768d59247114e49b70ad490c027f20eefd98682636c3c",
|
||||
"a398a43fe4069bf1b1fc2ec61b44df53dad6072cccb6d10a2627e76a96a94056",
|
||||
):
|
||||
assert digest in script
|
||||
assert 'entrypoint = \'["python3"]\'' in script
|
||||
|
||||
@@ -26,6 +26,19 @@ import run_portable_lab_v1_ddrnet_component as ddrnet # noqa: E402
|
||||
import run_portable_lab_v1_eomt_component as eomt # noqa: E402
|
||||
|
||||
|
||||
def test_component_entrypoints_keep_the_legacy_python39_syntax_floor() -> None:
|
||||
paths = (
|
||||
ADAPTER_ROOT / "portable_lab_v1_component_adapter.py",
|
||||
ADAPTER_ROOT / "run_portable_lab_v1_eomt_component.py",
|
||||
ADAPTER_ROOT / "run_portable_lab_v1_ddrnet_component.py",
|
||||
)
|
||||
for path in paths:
|
||||
source = path.read_text(encoding="utf-8")
|
||||
assert "\ntype " not in source
|
||||
assert "slots=True" not in paths[0].read_text(encoding="utf-8")
|
||||
assert "slots=True" not in paths[2].read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def _write_canonical(path: Path, value: object) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_bytes(contract.canonical_json(value))
|
||||
|
||||
Reference in New Issue
Block a user