Repository navigation
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_pyvenv",
sha256 = "0c93e68a0e697504233e9f76e4110478207c774e45fe6264d37ee01578d9db95",
strip_prefix = "rules_pyvenv-1.4",
url = "https://github.com/cedarai/rules_pyvenv/archive/refs/tags/v1.4.tar.gz",
)
What's Changed
-
Link generated main-workspace files into
site-packagesagain in #19Since 1.1,
py_venvhas silently omitted generated files from the main workspace — protobuf/gRPC codegen, generated__init__.py, genrule outputs. #19 restores them.56057e9 (in 1.1) added
always_linkand in the same refactor swapped the file gate inget_files()fromis_external(input_path) or type_ == "G"toenv_path != path. That covers external files and files remapped through animportsprefix, but not generated main-workspace files, whose env path is identical to their short path.It's a quiet failure: skipping main-workspace source files is deliberate — the venv is activated from the workspace root, so
cwdalready puts them onsys.path— but generated files exist only underbazel-out, so nothing else puts them anywhere. The venv still builds, still activates, still imports every pip package, and only fails at the firstimport <generated_module>.If you build a venv containing
py_proto_libraryor genrule outputs, you want this release. -
py_libraryloads on the two vendoredBUILD.bazelfiles, also in #19. Bazel 9 removed the native symbol, so Bazel 9 consumers previously had to prepend these at fetch time viapatch_cmds.
Nothing else changed: external-file handling, imports remapping, and the always_link escape hatch all behave exactly as in v1.3.
Note on v1.3
v1.3 was tagged (it's the first tag whose venv.bzl loads PyInfo explicitly, which Bazel 9 requires) but never got a release entry, so this one follows 1.2 in the list. Upgrading straight from 1.0 to v1.3 is what surfaced the bug above.
Full Changelog: v1.3...v1.4