From 16c7901f20ab5c65ae82c3bd51860c6d0661d526 Mon Sep 17 00:00:00 2001 From: Alex Kanitz Date: Mon, 20 May 2024 04:46:49 +0200 Subject: [PATCH] fix --- .github/workflows/checks.yml | 3 +-- foca/models/config.py | 8 ++++---- setup.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f66093e..6e465c3 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -35,8 +35,7 @@ jobs: python-version: ${{ matrix.py-version-img[0] }} - name: Install requirements run: | - pip install -e . - pip install -r requirements_dev.txt + pip install -e .[dev] - name: Lint with flake8 run: flake8 - name: Run mypy diff --git a/foca/models/config.py b/foca/models/config.py index bc7b8cb..f36bd95 100644 --- a/foca/models/config.py +++ b/foca/models/config.py @@ -19,7 +19,7 @@ ) -def _validate_log_level_choices(level: int) -> int: +def _validate_log_level_choices(cls, level: int) -> int: """Custom validation function for Pydantic to ensure that a valid logging level is configured. @@ -32,9 +32,9 @@ def _validate_log_level_choices(level: int) -> int: Raises: ValueError: Raised if validation fails. """ - choices = [0, 10, 20, 30, 40, 50] - if level not in choices: - raise ValueError("illegal log level specified") + CHOICES = [0, 10, 20, 30, 40, 50] + if level not in CHOICES: + raise ValueError(f"illegal log level specified: {level}") return level diff --git a/setup.py b/setup.py index c4206a1..618c376 100644 --- a/setup.py +++ b/setup.py @@ -79,8 +79,8 @@ ], install_requires=install_requires, extras_require={ - "docs": docs_require, "dev": dev_requires, + "docs": docs_require, }, include_package_data=True, package_data={