diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7540520..f1bf5c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,36 +1,36 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 + rev: v4.4.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - id: requirements-txt-fixer - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v0.812" + rev: "v1.4.1" hooks: - id: mypy additional_dependencies: - pydantic - repo: https://github.com/asottile/pyupgrade - rev: v2.10.0 + rev: v3.9.0 hooks: - id: pyupgrade - repo: https://github.com/PyCQA/bandit - rev: '1.7.0' + rev: '1.7.5' hooks: - id: bandit - repo: https://github.com/PyCQA/isort - rev: 5.7.0 + rev: 5.12.0 hooks: - id: isort args: ["--profile", "black", "--filter-files"] - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.7.0 hooks: - id: black - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.2.0 + rev: v1.5.1 hooks: - id: remove-crlf - id: remove-tabs diff --git a/joint_teapot/config.py b/joint_teapot/config.py index 19e66ed..3c8eab9 100644 --- a/joint_teapot/config.py +++ b/joint_teapot/config.py @@ -1,6 +1,7 @@ from functools import lru_cache +from typing import List -from pydantic import BaseSettings +from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): @@ -29,7 +30,7 @@ class Settings(BaseSettings): mattermost_suffix: str = "/mm" mattermost_access_token: str = "" mattermost_team: str = "" - mattermost_teaching_team = [ + mattermost_teaching_team: List[str] = [ "manuel", ] @@ -39,10 +40,7 @@ class Settings(BaseSettings): # log file log_file_path: str = "joint-teapot.log" stderr_log_level: str = "INFO" - - class Config: - env_file = ".env" - env_file_encoding = "utf-8" + model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8") @lru_cache() diff --git a/requirements.txt b/requirements.txt index 41a6897..beac0fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,6 @@ joj-submitter>=0.0.8 loguru>=0.5.3 mattermostdriver>=7.3.2 patool>=1.12 -pydantic[dotenv]>=1.8.1 +pydantic>=2.0.2 +pydantic-settings>=2.0.1 typer[all]>=0.3.2