Skip to content

refactor: split py_venv binary vs lib rules#980

Draft
jbedard wants to merge 1 commit into
mainfrom
py_venv-non-exec
Draft

refactor: split py_venv binary vs lib rules#980
jbedard wants to merge 1 commit into
mainfrom
py_venv-non-exec

Conversation

@jbedard
Copy link
Copy Markdown
Member

@jbedard jbedard commented May 7, 2026

This way if the py_venv is not being exposed via py_binary(expose_venv) it will be a simpler rule only exporting the VirtualenvInfo and runfiles, no RunEnvironmentInfo or DefaultInfo(files)

Changes are visible to end-users: no

Test plan

  • Covered by existing test cases

@jbedard jbedard force-pushed the py_venv-non-exec branch from 7bfe2db to 2e2bec7 Compare May 7, 2026 03:23
@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented May 7, 2026

Bazel 8 (Test)

33 test targets passed

Targets
//examples/multi_version:py_version_default_test [k8-fastbuild]                               789ms
//examples/multi_version:py_version_test [k8-fastbuild]                                       841ms
//examples/py_venv:test_simple_binary [k8-fastbuild]                                          169ms
//examples/pytest/subdir:test_with_pytest_main [k8-fastbuild]                                 789ms
//examples/pytest/subdir:test_without_pytest_main [k8-fastbuild]                              229ms
//examples/pytest:absolute_main_test [k8-fastbuild]                                           267ms
//examples/pytest:chdir_test [k8-fastbuild]                                                   622ms
//examples/pytest:coverage_lcov_shape_test [k8-fastbuild]                                     1s
//examples/pytest:main_with_colon_test [k8-fastbuild]                                         442ms
//examples/pytest:pytest_test [k8-fastbuild]                                                  797ms
//examples/pytest:sharded/test [k8-fastbuild]                                                 2s
//examples/pytest:test_naming_723 [k8-fastbuild]                                              968ms
//examples/virtual_deps:pytest_test [k8-fastbuild]                                            1s
//py/private/py_venv:test_link [k8-fastbuild]                                                 492ms
//py/tests/console-scripts:test_console_scripts [k8-fastbuild]                                492ms
//py/tests/external-deps:test_can_import_runfiles_helper [k8-fastbuild]                       556ms
//py/tests/internal-deps:assert [k8-fastbuild]                                                348ms
//py/tests/interpreter-options:test_options_on_test [k8-fastbuild]                            362ms
//py/tests/main-from-genrule:main_from_genrule_test [k8-fastbuild]                            258ms
//py/tests/py-internal-venv:test [k8-fastbuild]                                               107ms
//py/tests/py-internal-venv:test_non_isolated [k8-fastbuild]                                  165ms
//py/tests/py-test:test_env_vars [k8-fastbuild]                                               331ms
//py/tests/py-venv-disable-systemsite:test [k8-fastbuild]                                     140ms
//py/tests/py-venv-disable-systemsite:test_non_isolated [k8-fastbuild]                        148ms
//py/tests/py-venv-disable-usersite:test [k8-fastbuild]                                       136ms
//py/tests/py-venv-disable-usersite:test_non_isolated [k8-fastbuild]                          130ms
//py/tests/py-venv-enable-site:test [k8-fastbuild]                                            130ms
//py/tests/py_venv_conflict:validate_import_roots [k8-fastbuild]                              658ms
//py/tests/py_venv_conflict:validate_import_roots_non_isolated [k8-fastbuild]                 474ms
//py/tests/repo_relative_imports/test:test [k8-fastbuild]                                     288ms
//uv/private/gazelle_manifest:test [k8-fastbuild]                                             800ms
//uv/private/markers:marker_arch_alias_test [k8-fastbuild]                                    374ms
//uv/private/sdist_configure:detect_native_test [k8-fastbuild]                                699ms

Total test execution time was 17s. 150 tests (82.0%) were fully cached saving 48s.


Bazel 9 (Test)

33 test targets passed

Targets
//examples/multi_version:py_version_default_test [k8-fastbuild]                               921ms
//examples/multi_version:py_version_test [k8-fastbuild]                                       905ms
//examples/py_venv:test_simple_binary [k8-fastbuild]                                          203ms
//examples/pytest/subdir:test_with_pytest_main [k8-fastbuild]                                 852ms
//examples/pytest/subdir:test_without_pytest_main [k8-fastbuild]                              367ms
//examples/pytest:absolute_main_test [k8-fastbuild]                                           313ms
//examples/pytest:chdir_test [k8-fastbuild]                                                   915ms
//examples/pytest:coverage_lcov_shape_test [k8-fastbuild]                                     621ms
//examples/pytest:main_with_colon_test [k8-fastbuild]                                         308ms
//examples/pytest:pytest_test [k8-fastbuild]                                                  444ms
//examples/pytest:sharded/test [k8-fastbuild]                                                 2s
//examples/pytest:test_naming_723 [k8-fastbuild]                                              576ms
//examples/virtual_deps:pytest_test [k8-fastbuild]                                            765ms
//py/private/py_venv:test_link [k8-fastbuild]                                                 524ms
//py/tests/console-scripts:test_console_scripts [k8-fastbuild]                                407ms
//py/tests/external-deps:test_can_import_runfiles_helper [k8-fastbuild]                       587ms
//py/tests/internal-deps:assert [k8-fastbuild]                                                496ms
//py/tests/interpreter-options:test_options_on_test [k8-fastbuild]                            399ms
//py/tests/main-from-genrule:main_from_genrule_test [k8-fastbuild]                            384ms
//py/tests/py-internal-venv:test [k8-fastbuild]                                               139ms
//py/tests/py-internal-venv:test_non_isolated [k8-fastbuild]                                  172ms
//py/tests/py-test:test_env_vars [k8-fastbuild]                                               330ms
//py/tests/py-venv-disable-systemsite:test [k8-fastbuild]                                     164ms
//py/tests/py-venv-disable-systemsite:test_non_isolated [k8-fastbuild]                        152ms
//py/tests/py-venv-disable-usersite:test [k8-fastbuild]                                       194ms
//py/tests/py-venv-disable-usersite:test_non_isolated [k8-fastbuild]                          129ms
//py/tests/py-venv-enable-site:test [k8-fastbuild]                                            137ms
//py/tests/py_venv_conflict:validate_import_roots [k8-fastbuild]                              604ms
//py/tests/py_venv_conflict:validate_import_roots_non_isolated [k8-fastbuild]                 637ms
//py/tests/repo_relative_imports/test:test [k8-fastbuild]                                     296ms
//uv/private/gazelle_manifest:test [k8-fastbuild]                                             661ms
//uv/private/markers:marker_arch_alias_test [k8-fastbuild]                                    294ms
//uv/private/sdist_configure:detect_native_test [k8-fastbuild]                                887ms

Total test execution time was 17s. 149 tests (81.9%) were fully cached saving 52s.


Bazel 8 (Test)

e2e

⚠️ Buildkite build #3912 failed.

Failed tests (5)
//cases/oci/py_image_layer:my_app_layers_test_test [k8-fastbuild]🔗
//cases/uv-deps-650/crossbuild:app_amd64_layers_test [k8-fastbuild]🔗
//cases/uv-deps-650/crossbuild:app_arm64_layers_test [k8-fastbuild]🔗
//cases/venv-bin-scripts-423:test [k8-fastbuild]🔗
//cases/venv-bin-scripts-423:test_non_isolated [k8-fastbuild]🔗

💡 To reproduce the test failures, run

bazel test //cases/venv-bin-scripts-423:test //cases/uv-deps-650/crossbuild:app_arm64_layers_test //cases/uv-deps-650/crossbuild:app_amd64_layers_test //cases/venv-bin-scripts-423:test_non_isolated //cases/oci/py_image_layer:my_app_layers_test_test

Bazel 9 (Test)

e2e

⚠️ Buildkite build #3912 failed.

Failed tests (3)
//cases/oci/py_image_layer:my_app_layers_test_test [k8-fastbuild]🔗
//cases/venv-bin-scripts-423:test [k8-fastbuild]🔗
//cases/venv-bin-scripts-423:test_non_isolated [k8-fastbuild]🔗

💡 To reproduce the test failures, run

bazel test //cases/venv-bin-scripts-423:test_non_isolated //cases/venv-bin-scripts-423:test //cases/oci/py_image_layer:my_app_layers_test_test

Bazel 8 (Test)

examples/uv_pip_compile

All tests were cache hits

1 test (100.0%) was fully cached saving 444ms.


Buildifier      Gazelle

@jbedard jbedard force-pushed the py_venv-non-exec branch 6 times, most recently from 9c55626 to 1b0356f Compare May 13, 2026 20:52
@jbedard jbedard force-pushed the py_venv-non-exec branch from 1b0356f to 7e9c886 Compare May 21, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant