Skip to content

Commit

Permalink
Merge pull request #458 from davidhewitt/base-env-var
Browse files Browse the repository at this point in the history
gate `base_executable` usage behind env var
  • Loading branch information
davidhewitt committed Aug 2, 2024
2 parents ee62b2d + acf643e commit 77b110e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Support Python 3.13. [#446](https://github.com/PyO3/setuptools-rust/pull/446)

### Changed
- 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)
- 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)
- 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)
- Deprecate `--build-temp` argument to `build_rust` command (it does nothing). [#457](https://github.com/PyO3/setuptools-rust/pull/457)

Expand Down
5 changes: 4 additions & 1 deletion setuptools_rust/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,10 @@ def _replace_vendor_with_unknown(target: str) -> Optional[str]:
def _prepare_build_environment() -> Dict[str, str]:
"""Prepares environment variables to use when executing cargo build."""

base_executable = getattr(sys, "_base_executable")
base_executable = None
if os.getenv("SETUPTOOLS_RUST_PEP517_USE_BASE_PYTHON"):
base_executable = getattr(sys, "_base_executable")

if base_executable and os.path.exists(base_executable):
executable = os.path.realpath(base_executable)
else:
Expand Down

0 comments on commit 77b110e

Please sign in to comment.