chore: bump pydantic to 2

This commit is contained in:
张泊明518370910136 2023-07-11 23:33:22 +08:00
parent d56328ce4a
commit 2303cf71a2
GPG Key ID: CA088E6D9284F870
3 changed files with 13 additions and 14 deletions

View File

@ -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

View File

@ -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()

View File

@ -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