Commit ae23101
committed
fix: reset the cached compiler when build_ext is reinitialized
`httptools_build_ext.initialize_options()` returns early once
`_initialized` is set, deliberately preserving the Cython and extension
mutations applied on the first pass. Setuptools reinitializes the
`build_ext` command between phases, so a chained invocation such as
`setup.py build bdist_wheel` reaches the wheel phase holding the
compiler instance the earlier phase already configured, and the build
fails instead of selecting a compiler for the current phase.
Clear only the transient `compiler` attribute in that early-return
path. Delegating to the base initializer instead would discard exactly
the cached command options and extension state the early return exists
to protect, so the reset is kept as narrow as the problem.
`tests/test_build.py` loads the real `setup.py`, finalizes the command,
attaches a compiler, reinitializes, and asserts the run proceeds — it
fails without this change.
Verified:
- Focused regression — 1 passed
- `python setup.py build bdist_wheel` — succeeds
- `make test` — 42 passed
- `make typecheck` — 0 errors, 0 warnings
- `git diff --check` — clean
Fixes #1261 parent cf10ce6 commit ae23101
2 files changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments