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
11 changes: 10 additions & 1 deletion py/private/py_venv/py_venv.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def _py_venv_base_impl(ctx):
"--bin-dir=" + ctx.bin_dir.path,
"--collision-strategy=" + ctx.attr.package_collisions,
"--venv-name=" + venv_name,
"--mode=static-copy",
"--mode=" + ctx.attr.mode,
"--version={}.{}".format(
py_toolchain.interpreter_version_info.major,
py_toolchain.interpreter_version_info.minor,
Expand Down Expand Up @@ -276,6 +276,15 @@ A collision can occur when multiple packages providing the same file are install
default = "error",
values = ["error", "warning", "ignore"],
),
"mode": attr.string(
doc = """The venv assembly mode.

* "static-pth": Efficient. Just use a .pth file. Ignore binaries.
* "static-symlink": Efficient. Use .pth entries for firstparty and symlinks for 3rdparty. Copies and patches binaries.
""",
default = "static-symlink",
values = ["static-pth", "static-symlink"],
),
"interpreter_options": attr.string_list(
doc = "Additional options to pass to the Python interpreter.",
default = [],
Expand Down
6 changes: 3 additions & 3 deletions py/tests/py_venv_conflict/test_import_roots.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ def tree(dir_path: Path, prefix: str=''):
print(sys.prefix)

import conflict
print(conflict.__file__)
print("conflict.__file__", conflict.__file__)
assert conflict.__file__.startswith(sys.prefix)

import noconflict
print(noconflict.__file__)
print("noconflict.__file__", noconflict.__file__)
assert noconflict.__file__.startswith(sys.prefix)

import py_venv_conflict.lib as srclib
print(srclib.__file__)
print("srclib.__file__", srclib.__file__)
assert not srclib.__file__.startswith(sys.prefix)
Original file line number Diff line number Diff line change
Expand Up @@ -2442,7 +2442,7 @@ files:
layer: 1
files:
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/
- -rwxr-xr-x 0 0 0 328 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/_aspect.pth
- -rwxr-xr-x 0 0 0 280 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/_aspect.pth
- -rwxr-xr-x 0 0 0 19 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/_virtualenv.pth
- -rwxr-xr-x 0 0 0 4342 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/_virtualenv.py
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/colorama-0.4.6.dist-info/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2423,7 +2423,7 @@ files:
layer: 1
files:
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/
- -rwxr-xr-x 0 0 0 328 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/_aspect.pth
- -rwxr-xr-x 0 0 0 280 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/_aspect.pth
- -rwxr-xr-x 0 0 0 19 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/_virtualenv.pth
- -rwxr-xr-x 0 0 0 4342 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/_virtualenv.py
- drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/aspect_rules_py/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/site-packages/colorama-0.4.6.dist-info/
Expand Down
Loading
Loading