refactor: remove bootstrap wrappers and split into config/service/installers

- Replace bootstrap wrapper with config-driven service orchestration
- Introduce Config dataclass for centralized env/CLI validation
- Add MatomoApi service for session login + app token creation
- Move Playwright installer into installers/web and drop old install package
- Refactor HttpClient to unify HTTP handling and debug to stderr
- Make E2E tests use sys.executable instead of hardcoded python3
This commit is contained in:
Kevin Veen-Birkenbach
2025-12-23 12:33:42 +01:00
parent 92a2ee1d96
commit 5dbb1857c9
16 changed files with 498 additions and 523 deletions

View File

@@ -1,16 +1,25 @@
from .cli import parse_args
from .bootstrap import run_bootstrap
from .errors import BootstrapError
from __future__ import annotations
import sys
from .cli import parse_args
from .config import config_from_env_and_args
from .errors import BootstrapError
from .service import run
def main() -> int:
args = parse_args()
try:
token = run_bootstrap(args)
config = config_from_env_and_args(args)
token = run(config)
print(token)
return 0
except ValueError as exc:
# config validation errors
print(f"[ERROR] {exc}", file=sys.stderr)
return 2
except BootstrapError as exc:
print(f"[ERROR] {exc}", file=sys.stderr)
return 2