[Django] #33843: Django attempts connect to database during mypy checks

30 views
Skip to first unread message

Django

unread,
Jul 14, 2022, 6:24:48 AM7/14/22
to django-...@googlegroups.com
#33843: Django attempts connect to database during mypy checks
--------------------------------------+------------------------
Reporter: Bizilizi | Owner: nobody
Type: Bug | Status: new
Component: CSRF | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+------------------------
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
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33843>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 14, 2022, 7:25:33 AM7/14/22
to django-...@googlegroups.com
#33843: Django attempts connect to database during mypy checks
-------------------------------+--------------------------------------
Reporter: Daniil Zverev | Owner: nobody
Type: Bug | Status: closed
Component: Core (Other) | Version: 4.0
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => needsinfo
* component: CSRF => Core (Other)


Comment:

Thanks for this ticket, however Django doesn't currently use (or support)
type annotations (see #29299 and [https://groups.google.com/g/django-
developers/c/C_Phs05kL1Q/m/SX1oIqYKCQAJ django-developers discussion]).
There is also [https://github.com/typeddjango/django-stubs 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33843#comment:1>

Reply all
Reply to author
Forward
0 new messages