infra: fix CI, config, docker-compose, README, and pre-commit
- Fix mindmodel-schedule.yml to use uv and Python 3.13 - Add pytest.yml for push/PR test gate - Remove broken scheduler service from docker-compose.yml - Consolidate config.py into analysis/config.py with backward-compat shim - Rewrite README.md with quickstart and project overview - Update pre-commit-config.yaml to enable black, ruff, isort hooks - Add pyright type-check job (continue-on-error until baseline fixed) - Update AGENTS.md with Gitea infrastructure note
This commit is contained in:
@@ -267,3 +267,65 @@ _PARTY_NORMALIZE: dict[str, str] = {
|
||||
"Lid Keijzer": "BBB",
|
||||
"Groep Markuszower": "PVV",
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Application configuration (migrated from root config.py)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class Config:
|
||||
# Database settings
|
||||
DATABASE_PATH = "data/motions.db"
|
||||
|
||||
# API settings
|
||||
TWEEDE_KAMER_ODATA_API = "https://gegevensmagazijn.tweedekamer.nl/OData/v4/2.0"
|
||||
API_TIMEOUT = 30
|
||||
API_BATCH_SIZE = 250
|
||||
API_MAX_LIMIT = 250
|
||||
|
||||
# AI settings
|
||||
OPENROUTER_API_KEY = os.getenv("OPENROUTER_API_KEY")
|
||||
OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1"
|
||||
QWEN_MODEL = "qwen/qwen-2.5-72b-instruct"
|
||||
|
||||
# App settings
|
||||
DEFAULT_MOTION_COUNT = 10
|
||||
DEFAULT_WINNING_MARGIN_MIN = 0
|
||||
DEFAULT_WINNING_MARGIN_MAX = 100
|
||||
SESSION_TIMEOUT_DAYS = 30
|
||||
|
||||
# Policy areas
|
||||
POLICY_AREAS = [
|
||||
"Alle",
|
||||
"Economie",
|
||||
"Klimaat",
|
||||
"Immigratie",
|
||||
"Zorg",
|
||||
"Onderwijs",
|
||||
"Defensie",
|
||||
"Sociale Zaken",
|
||||
"Algemeen",
|
||||
]
|
||||
|
||||
# Scraper defaults
|
||||
BASE_URL = "https://www.tweedekamer.nl/zoeken/zoekresultaten"
|
||||
SCRAPING_DELAY = int(os.getenv("SCRAPING_DELAY", "5"))
|
||||
|
||||
|
||||
config = Config()
|
||||
|
||||
__all__ = [
|
||||
"PARTY_COLOURS",
|
||||
"SVD_THEMES",
|
||||
"KNOWN_MAJOR_PARTIES",
|
||||
"CURRENT_PARLIAMENT_PARTIES",
|
||||
"_PARTY_NORMALIZE",
|
||||
"CANONICAL_RIGHT",
|
||||
"CANONICAL_LEFT",
|
||||
"Config",
|
||||
"config",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user