Skip to content

[channels] Compatibility fixes for django-stubs 6.0.3#15653

Merged
srittau merged 2 commits intopython:mainfrom
srittau:channels-fix
Apr 20, 2026
Merged

[channels] Compatibility fixes for django-stubs 6.0.3#15653
srittau merged 2 commits intopython:mainfrom
srittau:channels-fix

Conversation

@srittau
Copy link
Copy Markdown
Collaborator

@srittau srittau commented Apr 20, 2026

LazyObject is generic since django-stubs 6.0.3.

This fixes problems in unrelated PRs and preempts upcoming daily CI errors.

`LazyObject` is generic since django-stubs 6.0.3.
@github-actions
Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

mypy (https://github.com/python/mypy)
  error: INTERNAL ERROR -- Please try using mypy master on GitHub:

@AlexWaygood
Copy link
Copy Markdown
Member

Diff from mypy_primer, showing the effect of this PR on open source code:

mypy (https://github.com/python/mypy)
  error: INTERNAL ERROR -- Please try using mypy master on GitHub:

When did we introduce a mypy crash? That seems pretty concerning. Doesn't look like it's related to this PR, but we should probably try to fix that 😬

@srittau
Copy link
Copy Markdown
Collaborator Author

srittau commented Apr 20, 2026

When did we introduce a mypy crash? That seems pretty concerning. Doesn't look like it's related to this PR, but we should probably try to fix that 😬

Unclear, but it's fairly recent.

@srittau srittau merged commit 5ecdd63 into python:main Apr 20, 2026
39 checks passed
@srittau srittau deleted the channels-fix branch April 20, 2026 12:34
@brianschubert
Copy link
Copy Markdown
Collaborator

Looks like the mypy crash is due to mypy now setting num_workers = 4 in mypy_self_check.ini (python/mypy#21221), which is incompatible with disabling the cache directory as is done in mypy_primer.

Traceback for v1.20.0:

$ uv run python3 -m mypy_primer --new 1.20.0 --old 1.20.0 -k 'mypy$'
...
new
> /tmp/mypy_primer/mypy_new/venv/bin/mypy --config-file mypy_self_check.ini -p mypy -p mypyc --python-executable=/tmp/mypy_primer/projects/_mypy_venv/bin/python --warn-unused-ignores --warn-redundant-casts --no-incremental --cache-dir=/dev/null --show-traceback --soft-error-limit=-1 (10.6s)
UNEXPECTED FAILURE
        error: INTERNAL ERROR -- Please try using mypy master on GitHub:
        https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
        Please report a bug at https://github.com/python/mypy/issues
        version: 1.20.0
        note: use --pdb to drop into pdb
        Traceback (most recent call last):
          File "/__main__.py", line 15, in console_entry
            main()
            ~~~~^^
          File "mypy/main.py", line 141, in main
            return
          File "mypy/main.py", line 225, in run_build
            show_messages(new_messages, f, formatter, options)
          File "mypy/build.py", line 384, in build
            # Create metastore before workers to avoid race conditions.
          File "mypy/build.py", line 298, in connect
            try:
        TypeError: mypy.ipc.BadStatus object expected; got AssertionError

Mypy master seems to fix the crash and shows a more explicit error:

$ uv run python3 -m mypy_primer --new master --old master -k 'mypy$'
...
new
> /tmp/mypy_primer/mypy_new/venv/bin/mypy --config-file mypy_self_check.ini -p mypy -p mypyc --python-executable=/tmp/mypy_primer/projects/_mypy_venv/bin/python --warn-unused-ignores --warn-redundant-casts --no-incremental --cache-dir=/dev/null --show-traceback --soft-error-limit=-1 (0.5s)
UNEXPECTED FAILURE
        error: cache must be enabled in parallel mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants