Skip to content

Preserve legacy API options in parallel checks - #2042

Closed
lin-hongkuan wants to merge 1 commit into
PyCQA:mainfrom
lin-hongkuan:codex/legacy-api-styleguide-options
Closed

Preserve legacy API options in parallel checks#2042
lin-hongkuan wants to merge 1 commit into
PyCQA:mainfrom
lin-hongkuan:codex/legacy-api-styleguide-options

Conversation

@lin-hongkuan

Copy link
Copy Markdown

Summary

  • keep the legacy API's already-initialized plugins/options when it builds the file checker manager
  • pass those initialized values into multiprocessing workers so non-fork start methods do not re-parse default CLI options
  • fall back to serial checking when the initialized legacy state cannot be pickled for worker startup

Fixes #2011

Tests

  • PYTHONPATH=src python -m pytest tests\integration\test_api_legacy.py tests\integration\test_checker.py -q
  • PYTHONPATH=src python -m pytest tests\unit\test_checker_manager.py tests\integration\test_checker.py tests\integration\test_api_legacy.py -q
  • PYTHONPATH=src python -m flake8 src\flake8\api\legacy.py src\flake8\checker.py src\flake8\main\application.py tests\integration\test_api_legacy.py tests\integration\test_checker.py
  • git diff --check

Note: python -m pre_commit run --files ... currently reports an existing mypy error in src\flake8\formatting\_windows_color.py, which is outside this diff. The targeted flake8 lint and regression tests pass against the working tree via PYTHONPATH=src.

@asottile asottile closed this Jun 25, 2026
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.

Max Line Length in style guide ignored with python 3.14 when checking multiple files

2 participants