Skip to content

Commit 77b110e

Browse files
authored
Merge pull request #458 from davidhewitt/base-env-var
gate `base_executable` usage behind env var
2 parents ee62b2d + acf643e commit 77b110e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- Support Python 3.13. [#446](https://github.com/PyO3/setuptools-rust/pull/446)
66

77
### Changed
8-
- Use the base interpreter path when running inside a virtual environment to avoid recompilation when switching between virtual environments. [#429](https://github.com/PyO3/setuptools-rust/pull/429)
8+
- Add `SETUPTOOLS_RUST_PEP517_USE_BASE_PYTHON` environment variable to use the base interpreter path when running inside a virtual environment to avoid recompilation when switching between virtual environments. [#429](https://github.com/PyO3/setuptools-rust/pull/429)
99
- Delay import of dependencies until use to avoid import errors during a partially complete install when multiple packages are installing at once. [#437](https://github.com/PyO3/setuptools-rust/pull/437)
1010
- Deprecate `--build-temp` argument to `build_rust` command (it does nothing). [#457](https://github.com/PyO3/setuptools-rust/pull/457)
1111

setuptools_rust/build.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,10 @@ def _replace_vendor_with_unknown(target: str) -> Optional[str]:
612612
def _prepare_build_environment() -> Dict[str, str]:
613613
"""Prepares environment variables to use when executing cargo build."""
614614

615-
base_executable = getattr(sys, "_base_executable")
615+
base_executable = None
616+
if os.getenv("SETUPTOOLS_RUST_PEP517_USE_BASE_PYTHON"):
617+
base_executable = getattr(sys, "_base_executable")
618+
616619
if base_executable and os.path.exists(base_executable):
617620
executable = os.path.realpath(base_executable)
618621
else:

0 commit comments

Comments
 (0)