From 7720002d30035615c703dd1db1afc18479c59323ab00d6b3cadc6935008476d2 Mon Sep 17 00:00:00 2001 From: Hadrian Burkhardt Date: Fri, 1 May 2026 00:08:43 +0000 Subject: [PATCH] chore: clean packaging validation and config model --- .gitignore | 4 +++- .pylintrc | 4 ---- stw_potsdam/config.py | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index b81a9eb..b2a5dae 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,12 @@ .pytest_cache /.coverage /htmlcov +/build +/dist *.egg-info/ *.pyc .venv __pycache__ .devcontainer .vscode -.codex \ No newline at end of file +.codex diff --git a/.pylintrc b/.pylintrc index f26487b..51b45f9 100644 --- a/.pylintrc +++ b/.pylintrc @@ -30,10 +30,6 @@ persistent=yes # Specify a configuration file. #rcfile= -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages -suggestion-mode=yes - # Allow loading of arbitrary C extensions. Extensions are imported into the # active Python interpreter and may run arbitrary code. unsafe-load-any-extension=no diff --git a/stw_potsdam/config.py b/stw_potsdam/config.py index 95e39f6..a4c12c3 100644 --- a/stw_potsdam/config.py +++ b/stw_potsdam/config.py @@ -4,11 +4,20 @@ import configparser import io import os -from collections import namedtuple +from dataclasses import dataclass from functools import partial -Canteen = namedtuple('Canteen', - ('key', 'name', 'street', 'city', 'id', 'chash')) + +@dataclass(frozen=True) +class Canteen: + """Configured OpenMensa canteen mapping.""" + + key: str + name: str + street: str + city: str + id: str + chash: str def _get_config(filename):