From 9b0eeb13f45409b68474b9326f8928e09211e33a Mon Sep 17 00:00:00 2001 From: David Danier Date: Sat, 8 Aug 2026 18:57:22 +0200 Subject: [PATCH 1/3] =?UTF-8?q?fix(pydantic=5Fpartial):=20=F0=9F=90=9B=20E?= =?UTF-8?q?nsure=20mypy=20check=20works?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pydantic_partial/partial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydantic_partial/partial.py b/pydantic_partial/partial.py index 15f5535..a8bbad0 100644 --- a/pydantic_partial/partial.py +++ b/pydantic_partial/partial.py @@ -33,7 +33,7 @@ class Something(PartialModelMixin, pydantic.BaseModel): try: from types import UnionType except ImportError: - UnionType = Union + UnionType = Union # type: ignore[misc,assignment] import pydantic From f54ce817c293b02be3b46188d72c3b450b83e765 Mon Sep 17 00:00:00 2001 From: David Danier Date: Sat, 8 Aug 2026 19:01:05 +0200 Subject: [PATCH 2/3] =?UTF-8?q?ci(.github):=20=E2=9A=99=EF=B8=8F=20Add=20m?= =?UTF-8?q?ypy=20check=20to=20pipeline=20and=20justfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yml | 33 +++++++++++++++++++++++++++++++-- justfile | 2 ++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c5ca0a0..d4c27f3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,7 +5,7 @@ on: schedule: - cron: '0 7 * * 1' jobs: - lint: + lint-ruff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 @@ -17,7 +17,36 @@ jobs: uses: astral-sh/setup-uv@v7 - name: Install the dependencies run: uv sync --all-extras --dev - - name: Lint with ruff & pyright + - name: Lint with ruff run: | uv run ruff check pydantic_partial tests + lint-pyright: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version-file: ".python-version" + - name: Install uv + uses: astral-sh/setup-uv@v7 + - name: Install the dependencies + run: uv sync --all-extras --dev + - name: Lint with pyright + run: | uv run pyright pydantic_partial + lint-mypy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version-file: ".python-version" + - name: Install uv + uses: astral-sh/setup-uv@v7 + - name: Install the dependencies + run: uv sync --all-extras --dev + - name: Lint with mypy + run: | + uv run mypy pydantic_partial diff --git a/justfile b/justfile index 4fae3f5..eb5be10 100644 --- a/justfile +++ b/justfile @@ -34,6 +34,8 @@ ruff *args: (uv "run" "ruff" "check" "pydantic_partial" "tests" args) pyright *args: (uv "run" "pyright" "pydantic_partial" args) +mypy *args: (uv "run" "mypy" "pydantic_partial" args) + lint: ruff pyright release version: (uv "version" version) From e7ed28fa393fcaf396b36143d193d9f72076252f Mon Sep 17 00:00:00 2001 From: David Danier Date: Sat, 8 Aug 2026 19:09:41 +0200 Subject: [PATCH 3/3] =?UTF-8?q?build:=20=F0=9F=9B=A0=20Add=20mypy=20prek?= =?UTF-8?q?=20hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prek.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/prek.toml b/prek.toml index ff03f68..afff89c 100644 --- a/prek.toml +++ b/prek.toml @@ -46,6 +46,19 @@ hooks = [ } ] +[[repos]] +repo = "https://github.com/pre-commit/mirrors-mypy" +rev = "v2.3.0" +hooks = [ + { + id = "mypy", + files = "^pydantic_partial/", + additional_dependencies = [ + "pydantic>=2.0.0,<3.0.0", + ], + } +] + [[repos]] repo = "https://github.com/alessandrojcm/commitlint-pre-commit-hook" rev = "v9.26.0"