refactor: make dev/release Boost-headers switch explicit#27
Draft
hozblok wants to merge 1 commit into
Draft
Conversation
The old switch checked `__version__.startswith("dev")` to pick between
the freshly-downloaded `boost/` tree and the vendored `boost_headers/`
tree. Two problems:
- PEP 440 pre-releases ("4.1.0.dev0", "4.1.0a1") didn't match.
- The only way to flip the switch was to edit __version__ in source,
which is unrelated to the actual concern (which header tree to use).
Drive the choice off an env var: FORMULA_USE_DEV_BOOST=1 picks `boost/`
if it exists, anything else picks `boost_headers/`. Print the chosen
path during build so it shows up in CI logs and `pip install` output.
Verified by rebuilding the extension and running the full test suite.
See ai/improvements_2026-05-09.md item #14.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes item #14 from
ai/improvements_2026-05-09.md.Problem.
setup.pypicked between the vendoredboost_headers/tree and the freshly-downloadedboost/tree using__version__.startswith("dev"). Two issues:4.1.0.dev0,4.1.0a1) didn't match thestartswithcheck, so the switch was effectively dead code for any version following PEP 440.__version__in source — entangling header-tree choice with the unrelated version string.Fix.
setup.py:31-35— drive the choice offFORMULA_USE_DEV_BOOSTenv var: any truthy value (e.g.=1) picksboost/when the directory exists, anything else falls back toboost_headers/. Print the chosen path so it appears in CI logs andpip installoutput.Verification. Rebuilt the extension (
pip install -e .) and ran the full pytest suite (316/316).