Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
schedule:
- cron: '0 7 * * 1'
jobs:
lint:
lint-ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
Expand All @@ -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
2 changes: 2 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions prek.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pydantic_partial/partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down