Skip to content

Commit 41abb9a

Browse files
committed
migrate Pydantic v2
1 parent 5104dbb commit 41abb9a

5 files changed

Lines changed: 5 additions & 4 deletions

File tree

comiclib/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pydantic import BaseSettings
1+
from pydantic_settings import BaseSettings
22
from typing import Union
33
import re
44
import logging

comiclib/scanner/30-importEHdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import Union
33
import sqlite3, re, ast
44
from datetime import date
5-
from pydantic import BaseSettings
5+
from pydantic_settings import BaseSettings
66

77
class Settings(BaseSettings):
88
importEHdb_thumb: bool = True

docs/en/docs/scanner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The basic structure of scanners is as follows
6464
``` python
6565
from pathlib import Path
6666
from typing import Union
67-
from pydantic import BaseSettings
67+
from pydantic_settings import BaseSettings
6868
# some import and pre-process
6969
# this may be executed multiple times, thus should avoid things like opening files
7070

docs/zh/docs/scanner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ ComicLib 的主体仅负责遍历漫画库,漫画文件的判断、解析等
6363
``` python
6464
from pathlib import Path
6565
from typing import Union
66-
from pydantic import BaseSettings
66+
from pydantic_settings import BaseSettings
6767
# some import and pre-process
6868
# this may be executed multiple times, thus should avoid things like opening files
6969

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ classifiers = [
1818
]
1919
dependencies = [
2020
"fastapi",
21+
'pydantic-settings',
2122
'sqlalchemy',
2223
'python-multipart',
2324
'pillow',

0 commit comments

Comments
 (0)