Skip to content

Commit 640c025

Browse files
authored
Pydanticv2 (#164)
* Upgrade Pydantic to v2, drop support for Python 3.7 and removedarglint
1 parent 9bf2135 commit 640c025

File tree

7 files changed

+143
-99
lines changed

7 files changed

+143
-99
lines changed

.darglint

-2
This file was deleted.

.github/workflows/tests.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ jobs:
1414
include:
1515
- { python: "3.10", os: "ubuntu-latest", session: "pre-commit" }
1616
- { python: "3.10", os: "ubuntu-latest", session: "safety" }
17+
- { python: "3.11", os: "ubuntu-latest", session: "mypy" }
1718
- { python: "3.10", os: "ubuntu-latest", session: "mypy" }
1819
- { python: "3.9", os: "ubuntu-latest", session: "mypy" }
1920
- { python: "3.8", os: "ubuntu-latest", session: "mypy" }
20-
- { python: "3.7", os: "ubuntu-latest", session: "mypy" }
2121
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
2222
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
2323
- { python: "3.9", os: "ubuntu-latest", session: "tests" }
2424
- { python: "3.8", os: "ubuntu-latest", session: "tests" }
25-
- { python: "3.7", os: "ubuntu-latest", session: "tests" }
2625
- { python: "3.10", os: "ubuntu-latest", session: "xdoctest" }
2726
- { python: "3.10", os: "ubuntu-latest", session: "docs-build" }
2827

.pre-commit-config.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ repos:
2121
entry: check-yaml
2222
language: system
2323
types: [yaml]
24-
- id: darglint
25-
name: darglint
26-
entry: darglint
27-
language: system
28-
types: [python]
29-
stages: [manual]
3024
- id: end-of-file-fixer
3125
name: Fix End of Files
3226
entry: end-of-file-fixer
@@ -39,7 +33,6 @@ repos:
3933
language: system
4034
types: [python]
4135
require_serial: true
42-
args: [--darglint-ignore-regex, .*]
4336
- id: isort
4437
name: isort
4538
entry: isort

noxfile.py

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ def precommit(session: Session) -> None:
121121
]
122122
session.install(
123123
"black",
124-
"darglint",
125124
"flake8",
126125
"flake8-bandit",
127126
"flake8-bugbear",

poetry.lock

+140-79
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@ classifiers = [
1919
Changelog = "https://github.com/foarsitter/checkedid-api-python-client/releases"
2020

2121
[tool.poetry.dependencies]
22-
python = "^3.7"
23-
pydantic = "^1.10.2"
22+
python = ">3.8"
23+
pydantic = "^2.0.1"
2424
httpx = "^0.23.1"
2525

2626
[tool.poetry.dev-dependencies]
2727
Pygments = ">=2.10.0"
2828
black = ">=21.10b0"
2929
coverage = {extras = ["toml"], version = ">=6.2"}
30-
darglint = ">=1.8.1"
3130
flake8 = ">=4.0.1"
3231
flake8-bandit = ">=2.1.2"
3332
flake8-bugbear = ">=21.9.2"

src/checkedid/models/generated.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
# timestamp: 2022-12-21T13:46:22+00:00
44

55
from datetime import datetime
6-
from typing import Any
76
from typing import List
87
from typing import Optional
98

109
from pydantic import BaseModel
1110
from pydantic import Field
1211

1312

14-
class Model(BaseModel):
15-
__root__: Any
16-
17-
1813
class CreateInvitationRequest(BaseModel):
1914
EmployeeCode: int = Field(
2015
..., description="EmployeeCode is integer as registered with CheckedID."

0 commit comments

Comments
 (0)