Skip to content

Commit acf643e

Browse files
committed
gate base_executable usage behind env var
1 parent de6583c commit acf643e

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

1111
## 1.9.0 (2024-02-24)

setuptools_rust/build.py

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

613-
base_executable = getattr(sys, "_base_executable")
613+
base_executable = None
614+
if os.getenv("SETUPTOOLS_RUST_PEP517_USE_BASE_PYTHON"):
615+
base_executable = getattr(sys, "_base_executable")
616+
614617
if base_executable and os.path.exists(base_executable):
615618
executable = os.path.realpath(base_executable)
616619
else:

0 commit comments

Comments
 (0)