Skip to content

refactor: make dev/release Boost-headers switch explicit#27

Draft
hozblok wants to merge 1 commit into
masterfrom
fix/14-setup-boost-headers-env-switch
Draft

refactor: make dev/release Boost-headers switch explicit#27
hozblok wants to merge 1 commit into
masterfrom
fix/14-setup-boost-headers-env-switch

Conversation

@hozblok
Copy link
Copy Markdown
Owner

@hozblok hozblok commented May 11, 2026

Closes item #14 from ai/improvements_2026-05-09.md.

Problem. setup.py picked between the vendored boost_headers/ tree and the freshly-downloaded boost/ tree using __version__.startswith("dev"). Two issues:

  • PEP 440 pre-release identifiers (4.1.0.dev0, 4.1.0a1) didn't match the startswith check, so the switch was effectively dead code for any version following PEP 440.
  • The only way to flip the switch was to edit __version__ in source — entangling header-tree choice with the unrelated version string.

Fix. setup.py:31-35 — drive the choice off FORMULA_USE_DEV_BOOST env var: any truthy value (e.g. =1) picks boost/ when the directory exists, anything else falls back to boost_headers/. Print the chosen path so it appears in CI logs and pip install output.

Verification. Rebuilt the extension (pip install -e .) and ran the full pytest suite (316/316).

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>
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