Skip to content

chore(setup_helpers): remove dead cpp_flag_cache and fix parameter typo#6085

Merged
henryiii merged 1 commit into
pybind:masterfrom
henryiii:chore/setup-helpers-cleanup
Jun 17, 2026
Merged

chore(setup_helpers): remove dead cpp_flag_cache and fix parameter typo#6085
henryiii merged 1 commit into
pybind:masterfrom
henryiii:chore/setup-helpers-cleanup

Conversation

@henryiii

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Part of #6084

Summary

  • Remove the dead module-level variable cpp_flag_cache = None and its stale comment # Every call will cache the result. The actual caching is already handled by the @lru_cache decorator on auto_cpp_level just below it; the variable was never read anywhere in the codebase.
  • Rename the typo'd parameter obg to obj in no_recompile(obg: str, src: str). Nothing passes this argument by keyword (it is only used as a needs_recompile callback passed positionally), so there is no API break.

Test plan

  • grep -rn cpp_flag_cache — only the one definition, now removed
  • grep -rn "no_recompile\|obg" — no callers use keyword argument obg
  • prek -a --quiet passes cleanly
  • uv run --with setuptools python -c "import pybind11.setup_helpers" succeeds

Remove the module-level `cpp_flag_cache = None` variable and its stale
comment "Every call will cache the result". The actual caching is handled
by the `@lru_cache` decorator on `auto_cpp_level` directly below.

Also rename the typo'd parameter `obg` to `obj` in `no_recompile`.
Nothing passes this argument by keyword, so there is no API break.

Part of pybind#6084

Assisted-by: ClaudeCode:claude-sonnet-4-6
@henryiii henryiii marked this pull request as ready for review June 11, 2026 22:52
@henryiii henryiii merged commit da3bdca into pybind:master Jun 17, 2026
106 checks passed
@henryiii henryiii deleted the chore/setup-helpers-cleanup branch June 17, 2026 12:16
@github-actions github-actions Bot added the needs changelog Possibly needs a changelog entry label Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs changelog Possibly needs a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants