-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use sitecustomize to emulate venv during python install (#512)
During initialization, the `site` module probes for a `sitecustomize` module which performs site-specific initialization of various paths. Python virtual environments modify sys.prefix in order to ensure that any attempted package installation ends up using the virtual environment instead of the system locations. This approach should prevent various Linux distributions' attempts to inject `local` into the installation locations for python packages. They seem to have special cases for detecting virtual environments and omit the custom logic when detected.
- Loading branch information
Showing
5 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2022 Open Source Robotics Foundation, Inc. | ||
# Licensed under the Apache License, Version 2.0 | ||
|
||
from colcon_core.shell.template import expand_template # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import sys | ||
sys.real_prefix = sys.prefix | ||
sys.prefix = sys.exec_prefix = @repr(site_prefix) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,7 @@ setupscript | |
setuptools | ||
shlex | ||
sigint | ||
sitecustomize | ||
sloretz | ||
stacklevel | ||
staticmethod | ||
|