[project]
name = "mgf-brand-web"
version = "0.2.0"
description = "The Magogi Foundation brand-web kit as an installable package — tokenized CSS + components + self-hosted fonts + logo/pattern assets, shipped as package data so every MGF web surface shares one source of truth. Sibling of mgf-common under the mgf.* namespace."
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
authors = [
    { name = "Bassam Alsanie" },
    { name = "mgf-brand-web contributors" },
]
keywords = ["magogi", "brand", "design-system", "css", "web", "fonts"]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Software Development :: User Interfaces",
    "Typing :: Typed",
]

# Pure asset package: no runtime dependencies. It ships CSS/fonts/SVG as package
# data + a tiny `static_dir()` accessor; consumers (FastAPI/Starlette/etc.) mount
# the directory. It MUST stay framework-free (enforced by the import-linter
# contract) so any web stack can depend on it.
dependencies = []

[project.optional-dependencies]
standards = [
    "mgf-common[standards]>=0.47,<0.50",
]
dev = [
    "pytest>=8.0",
    "pytest-cov>=5.0",
    "pytest-timeout>=2.3,<3",
    "ruff>=0.4,<0.16",
    "mypy>=1.10",
    "import-linter>=2.0",
    "mgf-test-supervisor>=0.1.3,<0.2",
    "mgf-standard>=0.1.6,<0.2",
]

[project.urls]
Homepage = "https://codeberg.org/magogi-admin/mgf-brand-web"
Issues = "https://codeberg.org/magogi-admin/mgf-brand-web/issues"
Changelog = "https://codeberg.org/magogi-admin/mgf-brand-web/src/branch/main/CHANGELOG.md"

[build-system]
requires = ["hatchling>=1.21"]
build-backend = "hatchling.build"

# PEP 420 implicit namespace package (mgf.brand_web is a sibling of mgf.common).
[tool.hatch.build.targets.wheel]
packages = ["src/mgf"]
artifacts = ["src/mgf/brand_web/static/**"]

[tool.ruff]
line-length = 100
target-version = "py311"
src = ["src", "tests"]
extend-exclude = [".venv", "build", "dist"]

[tool.ruff.lint]
select = ["E", "W", "F", "I", "N", "UP", "B", "A", "C4", "PIE", "SIM", "RET", "RUF", "PTH", "TCH", "DTZ", "ASYNC", "S", "FA"]
ignore = ["E501", "SIM108", "S101"]

[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101", "S105", "S106", "S108", "N802", "PLR2004", "TC001", "TC002", "TC003"]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "lf"

[tool.mypy]
python_version = "3.11"
mypy_path = "src"
packages = ["mgf.brand_web"]
explicit_package_bases = true
namespace_packages = true
strict = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = false
disallow_untyped_defs = true
disallow_incomplete_defs = true
no_implicit_optional = true
show_error_codes = true
pretty = true

# ----------------------------------------------------------------------
# import-linter — the kit MUST stay framework-free so any web stack can use it.
# ----------------------------------------------------------------------
[tool.importlinter]
root_package = "mgf.brand_web"
include_external_packages = true

[[tool.importlinter.contracts]]
name = "the brand-web kit imports no web framework (stays consumable by any)"
type = "forbidden"
source_modules = ["mgf.brand_web"]
forbidden_modules = ["fastapi", "starlette", "jinja2", "flask", "django"]

[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
pythonpath = ["."]
python_files = ["test_*.py"]
addopts = ["-ra", "--strict-markers", "--strict-config", "--showlocals", "-m", "not perf and not slow and not stress and not e2e and not conformance and not use_case"]
timeout = 30
timeout_method = "thread"
faulthandler_timeout = 60
markers = [
    "smoke: minimal post-install sanity (fast; no fixtures); tier-0",
    "integration: cross-module integration test; tier-1",
    "contract: wire-format + SDK-surface pins; tier-1",
    "regression: pin for a specific past bug; tier-1",
    "conformance: design-promise tests; release-gated; tier-2",
    "use_case: reproduces a consumer scenario; tier-2",
    "perf: performance pin; tier-3",
    "stress: sustained high-load test; tier-3",
    "slow: legacy >1s marker (TS-18). Deprecated.",
    "e2e: end-to-end test; tier-3",
    "property: invariant test (Hypothesis); tier-1",
    "fuzz: hostile-input test; tier-1",
    "concurrency: real-threads contention test; tier-2",
]
filterwarnings = ["error"]

[tool.coverage.run]
source = ["src/mgf/brand_web"]
branch = true

[tool.coverage.report]
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:"]
show_missing = true
fail_under = 80

[tool.mgf-fed]
coverage_floor = 80

[tool.uv]
index-url = "https://195.15.203.250.sslip.io/magogi/prod/+simple/"
