Skip to content

Commit 9730855

Browse files
committed
experiment with site packages
1 parent 7507626 commit 9730855

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

python/private/site_init_template.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# Runfiles-relative path to the coverage tool entry point, if any.
2828
_COVERAGE_TOOL = "%coverage_tool%"
2929

30+
print("Hi")
3031

3132
def _is_verbose():
3233
return bool(os.environ.get("RULES_PYTHON_BOOTSTRAP_VERBOSE"))

python/private/stage2_bootstrap_template.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
# Runfiles-relative path to the main Python source file.
2525
MAIN = "%main%"
2626

27+
# Whether this script is used as a sitecustomize script.
28+
USED_AS_SITECUSTOMIZE = "%used_as_sitecustomize%"
29+
2730
# ===== Template substitutions end =====
2831

2932

@@ -375,6 +378,8 @@ def main():
375378
if runfiles_envkey:
376379
os.environ[runfiles_envkey] = runfiles_envvalue
377380

381+
sys.path[0:0] = prepend_path_entries
382+
378383
main_filename = os.path.join(module_space, main_rel_path)
379384
main_filename = get_windows_path_with_unc_prefix(main_filename)
380385
assert os.path.exists(main_filename), (
@@ -386,8 +391,6 @@ def main():
386391

387392
sys.stdout.flush()
388393

389-
sys.path[0:0] = prepend_path_entries
390-
391394
if os.environ.get("COVERAGE_DIR"):
392395
import _bazel_site_init
393396
coverage_enabled = _bazel_site_init.COVERAGE_SETUP

0 commit comments

Comments
 (0)