Skip to content

Custom django settings generate mypy errors #1410

@kwint

Description

@kwint

What's wrong

We have a project that is based on the wemake template. We created the project years ago some stuff might have changed with respect to the latest template

We have added some custom settings to server/settings/components/common.py. :

# common.py
MIN_GH_VERSION = "1.0.0"

Since we updated to latest version of django-stubs, we get mypy errors when we reference these errors in other parts of the code:

server/runner/logic/versioning.py:29: error: 'Settings' object has no attribute 'MIN_GH_VERSION'

We come from django-stubs 1.12.0 and are now on 1.16.0. We are on mypy version 1.1.1

django-stubs in setup.cfg:

[mypy.plugins.django-stubs]
django_settings_module = server.settings
  • OS:
  • python version: 3.10
  • django version: 3.2.18
  • mypy version: 1.1.1
  • django-stubs version: 1.16.0
  • django-stubs-ext version: 0.8.0

edit: traced it back to this pull request I think: #1175

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions