Skip to content

Commit 44e609b

Browse files
don't remove objects / DoesNotExist / etc. from model classes (#2)
django-stubs fails to restore these in too many cases. see upstream issue typeddjango#1744 (not upstreamed)
1 parent fdd654d commit 44e609b

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -49,35 +49,6 @@ jobs:
4949
- name: Run mypy on the test cases
5050
run: uv run mypy --strict tests
5151

52-
test:
53-
timeout-minutes: 15
54-
runs-on: ubuntu-latest
55-
strategy:
56-
matrix:
57-
python-version: ['3.10', '3.11', '3.12', '3.13']
58-
shard: [0, 1, 2, 3]
59-
fail-fast: false
60-
steps:
61-
- uses: actions/checkout@v5
62-
- name: Setup system dependencies
63-
run: |
64-
sudo apt-get update
65-
sudo apt-get install binutils libproj-dev gdal-bin
66-
- name: Install uv
67-
uses: astral-sh/setup-uv@v6
68-
- name: Set up Python ${{ matrix.python-version }}
69-
uses: actions/setup-python@v6
70-
with:
71-
python-version: ${{ matrix.python-version }}
72-
73-
- name: Install dependencies
74-
run: uv sync --no-dev --group tests
75-
76-
# Must match `shard` definition in the test matrix:
77-
- name: Run pytest tests
78-
run: uv run pytest --num-shards=4 --shard-id=${{ matrix.shard }} -n auto tests
79-
80-
8152
stubtest:
8253
timeout-minutes: 10
8354
runs-on: ubuntu-latest

mypy_django_plugin/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
resolve_manager_method,
4646
)
4747
from mypy_django_plugin.transformers.models import (
48-
MetaclassAdjustments,
4948
handle_annotated_type,
5049
process_model_class,
5150
set_auth_user_model_boolean_fields,
@@ -212,7 +211,7 @@ def get_customize_class_mro_hook(self, fullname: str) -> Callable[[ClassDefConte
212211

213212
def get_metaclass_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None:
214213
if fullname == fullnames.MODEL_METACLASS_FULLNAME:
215-
return MetaclassAdjustments.adjust_model_class
214+
return None
216215
return None
217216

218217
def get_base_class_hook(self, fullname: str) -> Callable[[ClassDefContext], None] | None:

0 commit comments

Comments
 (0)