Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.5.1
8.7.0
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2", dev_dependency = Tr

## Rules Score
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "rules_python", version = "1.4.1")
bazel_dep(name = "rules_python", version = "1.8.5")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_shell", version = "0.5.0")
bazel_dep(name = "rules_rust", version = "0.68.1-score")
Expand Down
10 changes: 10 additions & 0 deletions python_basics/integration_tests/simple-tests/test_venv_ok.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# *******************************************************************************
import os
import subprocess
import sys
from pathlib import Path


Expand All @@ -27,6 +28,14 @@ def test_venv_ok():

python_venv_folder = [x for x in packages if "python_3_12_" in x][0]

# Since rules_python 1.7.0, PYTHONPATH is no longer populated for
# --bootstrap_impl=system_python, so the raw toolchain interpreter
# invoked below no longer inherits the import paths this process
# was started with. Rebuild PYTHONPATH from our own sys.path (which
# is known-good, since `import pytest` above already succeeded) and
# pass it explicitly so the subprocess can find pytest too.
env = os.environ | {"PYTHONPATH": os.pathsep.join(filter(None, sys.path))}

# Trying to actually use pytest module and collect current test & file.
# Scope collection to "_main" (this workspace's own sources, canonical
# repo name for the root module under bazel) instead of the whole
Expand All @@ -44,6 +53,7 @@ def test_venv_ok():
cwd=runfiles,
check=True,
capture_output=True,
env=env,
)
assert "test_venv_ok.py" in str(proc.stdout), (
"test_venv_ok.py, file not found in pytest collect"
Expand Down
Loading