# mgf-example-app — the "second consumer" signal package.
#
# v0.4 Phase G3. This is a real, tested, packaged consumer of
# mgf-common that lives in the same monorepo but is published
# (or could be published) as its own distribution. The CI
# compat matrix (Phase G4) runs its tests against the in-repo
# mgf-common to catch regressions before mgf-common cuts a
# release.
#
# Why a real package instead of just `examples/06_full_app/`:
# the closed-box principle is best validated by a CONSUMER —
# an external user of the public surface — not by self-tests in
# the source repo. Having a packaged consumer means the lift +
# api-design discussions ground in something real.
#
# This package demonstrates the v0.4 ergonomic shape:
# - bootstrap() with auto-derived identity
# - BaseAppSettings composing MgfSettings as a sub-field
# - Custom CLI subcommand registered via mgf.common.cli
# - bootstrap_for_test in the test suite

[project]
name = "mgf-example-app"
version = "0.0.1"
description = "Reference second-consumer of mgf-common — closed-box validation"
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
authors = [
    { name = "mgf-common contributors" },
]
classifiers = [
    "Development Status :: 4 - Beta",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "License :: OSI Approved :: MIT License",
    "Topic :: Software Development :: Libraries",
    "Private :: Do Not Upload",
]

dependencies = [
    # In dev: path source via [tool.uv.sources] below.
    # In CI: pin to the released wheel (the compat matrix uses
    # both forms — path for "test against in-repo HEAD",
    # pin for "test against the published release").
    "mgf-common>=0.44,<1.0",  # AP-16 federation pin-window; old <0.5 excluded every published 0.4x.y (exposed by PAPER-113 steered resolution)
]

[project.scripts]
example-app = "example_app.cli:main"

[project.optional-dependencies]
dev = [
    "mgf-fed[cli]>=0.11,<1.0",  # provides the shared diagnostic subcommands post-CLI-extraction
    "pytest>=8",
    "ruff>=0.4",
    "mypy>=1.10",
]

# uv path source — resolves mgf-common to the in-repo source for
# local dev. CI overrides this via the install command (see
# .woodpecker.yml's compat-matrix step in Phase G4).
[tool.uv.sources]
mgf-common = { path = "..", editable = true }

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

[tool.hatch.build.targets.wheel]
packages = ["src/example_app"]

[tool.ruff]
line-length = 100
target-version = "py311"

[tool.ruff.lint]
select = ["E", "F", "I", "N", "UP", "B", "ANN", "RUF"]

[tool.mypy]
python_version = "3.11"
strict = true
files = ["src"]

[tool.pytest.ini_options]
testpaths = ["tests"]
filterwarnings = [
    "error",
    # MgfDeprecationWarning is exempt — same policy as mgf-common's
    # own pyproject. Fires on any v0.1 surface that creeps back in;
    # we want it visible (default) not blocking.
    "default::mgf.common._warnings.MgfDeprecationWarning",
]
