Skip to content

Commit 4ca4721

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 5c7182c commit 4ca4721

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,35 +43,6 @@ jobs:
4343
- name: Run mypy on stubs
4444
run: mypy --cache-dir=/dev/null --no-incremental django-stubs
4545

46-
test:
47-
timeout-minutes: 15
48-
runs-on: ubuntu-latest
49-
strategy:
50-
matrix:
51-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
52-
shard: [0, 1, 2, 3]
53-
fail-fast: false
54-
steps:
55-
- uses: actions/checkout@v4
56-
- name: Setup system dependencies
57-
run: |
58-
sudo apt-get update
59-
sudo apt-get install binutils libproj-dev gdal-bin
60-
- name: Set up Python ${{ matrix.python-version }}
61-
uses: actions/setup-python@v5
62-
with:
63-
python-version: ${{ matrix.python-version }}
64-
- name: Install dependencies
65-
run: |
66-
pip install -U pip setuptools wheel
67-
SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt
68-
69-
# Must match `shard` definition in the test matrix:
70-
- name: Run pytest tests
71-
run: PYTHONPATH='.' pytest --num-shards=4 --shard-id=${{ matrix.shard }} tests
72-
- name: Run mypy on the test cases
73-
run: mypy tests/assert_type
74-
7546
stubtest:
7647
timeout-minutes: 10
7748
runs-on: ubuntu-latest

mypy_django_plugin/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def get_method_hook(self, fullname: str) -> Optional[Callable[[MethodContext], M
224224

225225
def get_customize_class_mro_hook(self, fullname: str) -> Optional[Callable[[ClassDefContext], None]]:
226226
if fullname == fullnames.MODEL_CLASS_FULLNAME:
227-
return MetaclassAdjustments.adjust_model_class
227+
return None
228228

229229
sym = self.lookup_fully_qualified(fullname)
230230
if (

0 commit comments

Comments
 (0)