Skip to content

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

Open
henryiii wants to merge 1 commit into
pybind:masterfrom
henryiii:chore/setup-helpers-cleanup
Open

chore(setup_helpers): remove dead cpp_flag_cache and fix parameter typo#6085
henryiii wants to merge 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
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.

1 participant