clipwright/clipwright/core/paths.py
pedro-bento 719946b3cd
All checks were successful
CI / backend-tests (push) Successful in 29s
CI / frontend-build (push) Successful in 9m48s
refactor/package-layout (#3)
Reviewed-on: #3
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 20:47:12 +01:00

31 lines
867 B
Python

"""Canonical filesystem locations for the Clipwright backend.
The importable package lives at ``<repo>/clipwright`` while the shared runtime
resources (``fonts/``, ``assets/``, ``yolov8n.pt``) stay at the repository root.
Keeping the constants here means every module resolves them the same way,
independently of the current working directory or of how deep a module sits in
the package.
"""
from __future__ import annotations
from pathlib import Path
# .../clipwright
PACKAGE_DIR = Path(__file__).resolve().parent.parent
# Repository root (also the Docker WORKDIR /app).
REPO_ROOT = PACKAGE_DIR.parent
FONTS_DIR = REPO_ROOT / "fonts"
ASSETS_DIR = REPO_ROOT / "assets"
UPLOADS_DIR = REPO_ROOT / "uploads"
OUTPUT_DIR = REPO_ROOT / "output"
__all__ = [
"PACKAGE_DIR",
"REPO_ROOT",
"FONTS_DIR",
"ASSETS_DIR",
"UPLOADS_DIR",
"OUTPUT_DIR",
]