diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3efae77ef..2f6155671 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,33 +43,6 @@ jobs: - name: Run mypy on stubs run: mypy --cache-dir=/dev/null --no-incremental django-stubs - test: - timeout-minutes: 15 - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - shard: [0, 1, 2, 3] - fail-fast: false - steps: - - uses: actions/checkout@v4 - - name: Setup system dependencies - run: | - sudo apt-get update - sudo apt-get install binutils libproj-dev gdal-bin - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install -U pip setuptools wheel - SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt - - # Must match `shard` definition in the test matrix: - - name: Run tests - run: PYTHONPATH='.' pytest --num-shards=4 --shard-id=${{ matrix.shard }} tests - stubtest: timeout-minutes: 10 runs-on: ubuntu-latest diff --git a/django-stubs/contrib/sessions/base_session.pyi b/django-stubs/contrib/sessions/base_session.pyi index e13fb7eb4..04271929a 100644 --- a/django-stubs/contrib/sessions/base_session.pyi +++ b/django-stubs/contrib/sessions/base_session.pyi @@ -1,5 +1,5 @@ from datetime import datetime -from typing import Any, Literal, TypeVar +from typing import Any, ClassVar, Literal, TypeVar from django.contrib.sessions.backends.base import SessionBase from django.db import models @@ -14,7 +14,7 @@ class AbstractBaseSession(models.Model): expire_date: datetime session_data: str session_key: str - objects: Any + objects: ClassVar[Any] class Meta: abstract: Literal[True] diff --git a/mypy_django_plugin/main.py b/mypy_django_plugin/main.py index 454a6cb13..e4fb55195 100644 --- a/mypy_django_plugin/main.py +++ b/mypy_django_plugin/main.py @@ -224,7 +224,7 @@ def get_method_hook(self, fullname: str) -> Optional[Callable[[MethodContext], M def get_customize_class_mro_hook(self, fullname: str) -> Optional[Callable[[ClassDefContext], None]]: if fullname == fullnames.MODEL_CLASS_FULLNAME: - return MetaclassAdjustments.adjust_model_class + return None sym = self.lookup_fully_qualified(fullname) if (