Skip to content

Choose a tag to compare

@aarone aarone released this 04 Aug 00:04
a3696e6
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-packages again in #19

    Since 1.1, py_venv has 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_link and in the same refactor swapped the file gate in get_files() from is_external(input_path) or type_ == "G" to env_path != path. That covers external files and files remapped through an imports prefix, 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 cwd already puts them on sys.path — but generated files exist only under bazel-out, so nothing else puts them anywhere. The venv still builds, still activates, still imports every pip package, and only fails at the first import <generated_module>.

    If you build a venv containing py_proto_library or genrule outputs, you want this release.

  • py_library loads on the two vendored BUILD.bazel files, also in #19. Bazel 9 removed the native symbol, so Bazel 9 consumers previously had to prepend these at fetch time via patch_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