Coverage for src/ezcompiler/shared/_release_preflight.py: 100.00%
10 statements
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-16 16:37 +0000
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-16 16:37 +0000
1# ///////////////////////////////////////////////////////////////
2# _RELEASE_PREFLIGHT - Pre-publication recap of a release
3# Project: ezcompiler
4# ///////////////////////////////////////////////////////////////
6"""Value object describing a release before it is published.
8``PublishService.preflight_release()`` runs every cheap check (CLI present
9and authenticated, tag free, artifacts staged) and returns this recap. The
10interfaces layer only displays it and asks for confirmation: it never holds
11a ``PublisherPort`` nor decides the publisher/uploader routing.
12"""
14from __future__ import annotations
16# ///////////////////////////////////////////////////////////////
17# IMPORTS
18# ///////////////////////////////////////////////////////////////
19# Standard library imports
20from dataclasses import dataclass, field
21from pathlib import Path
23# ///////////////////////////////////////////////////////////////
24# CLASSES
25# ///////////////////////////////////////////////////////////////
28@dataclass(frozen=True)
29class ReleasePreflight:
30 """What a release publication would do, once every check has passed.
32 Attributes:
33 destination: Resolved release destination (``github``, ``disk``, …).
34 is_platform: True when the destination is a release platform, so the
35 publication is irreversible and must be confirmed.
36 publisher_name: Human-readable publisher name, platform path only.
37 repo: Target ``owner/repo``, or ``None`` when inferred by the CLI.
38 assets: Artifacts that would be attached, platform path only.
39 """
41 destination: str
42 is_platform: bool
43 publisher_name: str | None = None
44 repo: str | None = None
45 assets: tuple[Path, ...] = field(default_factory=tuple)