Skip to content

fix: stop build variables leaking into the test environment - #3008

Open
VedantBhayani wants to merge 1 commit into
pypa:mainfrom
VedantBhayani:fix/strip-build-env-vars-in-test-env
Open

VedantBhayani wants to merge 1 commit into
pypa:mainfrom
VedantBhayani:fix/strip-build-env-vars-in-test-env

Conversation

@VedantBhayani

Copy link
Copy Markdown

Summary

The test phase reused the build environment, so build-specific variables leaked into tests: _PYTHON_HOST_PLATFORM, ARCHFLAGS and SDKROOT on macOS, PYTHON_VERSION and PYTHON_ARCH on Windows. The test base environment is now rebuilt from the host environment plus the user environment option, per the approach in #1863.

Changes

  • macos.py, windows.py: build test_base_env from os.environ plus build_options.environment instead of reusing the build env.
  • CIBUILDWHEEL_BUILD_IDENTIFIER is preserved explicitly (all backends set it by design; the old test env carried it through the leak).
  • linux.py deliberately untouched: nothing build-specific lives in its env, and host variables must never enter the container base env.

Testing

  • No new unit test: the path needs real platform builders (a trivial helper test proves nothing). Existing integration tests exercise the test phase on CI runners.
  • 466 env/platform unit tests pass locally. ruff check plus format (pinned rev), mypy strict on 3.11 plus 3.14, pylint 10/10, codespell clean.

Closes #1863

This branch has not been deployed

No deployments
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.

Remove build specific environment variables from the test environment

1 participant