Opened 2 years ago

Closed 2 years ago

#33843 closed Bug (needsinfo)

Django attempts connect to database during mypy checks

Reported by: Daniil Zverev Owned by: nobody
Component: Core (Other) Version: 4.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Both stand alone call of mypy and pre-commit cals causes following errors:

django.db.utils.OperationalError: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?

We can not use mypy in our Django project due to this error. Any ideas what causes it?
We have django-stubs as dependencies and in addition ignores errors from migrations, like that:

[mypy]
exclude = ".+.migrations.|.+.tests.|.+.testing."
.
[mypy-*.migrations.*]
ignore_errors = True

Change History (1)

comment:1 by Mariusz Felisiak, 2 years ago

Component: CSRFCore (Other)
Resolution: needsinfo
Status: newclosed

Thanks for this ticket, however Django doesn't currently use (or support) type annotations (see #29299 and django-developers discussion). There is also django-stubs package.

Please reopen the ticket if you can debug your issue and provide details about why and where Django is at fault and what could be improved.

Note: See TracTickets for help on using tickets.
Back to Top