Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom django settings generate mypy errors #1410

Closed
kwint opened this issue Mar 22, 2023 · 1 comment · Fixed by #1557
Closed

Custom django settings generate mypy errors #1410

kwint opened this issue Mar 22, 2023 · 1 comment · Fixed by #1557
Labels
bug Something isn't working

Comments

@kwint
Copy link

kwint commented Mar 22, 2023

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

@kwint kwint added the bug Something isn't working label Mar 22, 2023
@chiganov
Copy link

I got the same bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants