Skip to content

feat(py_info): expose VenvSymlinkEntry and VenvSymlinkKind as public APIs#3835

Merged
rickeylev merged 2 commits into
bazel-contrib:mainfrom
rickeylev:expose-venv-symlink-api
Jun 20, 2026
Merged

feat(py_info): expose VenvSymlinkEntry and VenvSymlinkKind as public APIs#3835
rickeylev merged 2 commits into
bazel-contrib:mainfrom
rickeylev:expose-venv-symlink-api

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Currently, VenvSymlinkEntry and VenvSymlinkKind are defined in the
private python/private/py_info.bzl file, making them inaccessible to
users who want to programmatically define virtual environment symlinks
when using PyInfo (or at the least, having to load private file
paths).

To fix this, we load and re-export both symbols in the public
python/py_info.bzl file.

Along the way

  • Adds VenvSymlinkEntryBuilder to allow fluent construction of symlink
    entries via PyInfoBuilder.
  • Adds features.loadable_symbols to allow programmatic detection of
    these public symbols.

@rickeylev rickeylev requested a review from aignas as a code owner June 19, 2026 22:05

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request exposes VenvSymlinkEntry and VenvSymlinkKind as public symbols in //python:py_info.bzl and introduces features.loadable_symbols to detect public symbols exported by bzl files. It also implements VenvSymlinkEntryBuilder to construct symlink entries and integrates it into PyInfoBuilder. The feedback suggests adding validation for the kind argument, ensuring both kind and venv_path are set before building, and clearing the _venv_symlink_builders list after building to prevent duplicate entries on multiple builder calls.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread python/private/py_info.bzl
Comment thread python/private/py_info.bzl
Comment thread python/private/py_info.bzl Outdated
…APIs

Currently, `VenvSymlinkEntry` and `VenvSymlinkKind` are defined in the
private `python/private/py_info.bzl` file, making them inaccessible to
users who want to programmatically define virtual environment symlinks
when using `PyInfo`.

To fix this, we load and re-export both symbols in the public
`python/py_info.bzl` file.

Additionally, this change:
* Adds `VenvSymlinkEntryBuilder` to allow fluent construction of symlink entries.
* Adds `features.loadable_symbols` to allow programmatic detection of these public symbols.
* Updates stardoc generation to document the new public APIs (with proper versionadded markup).
* Updates and adds comprehensive unit tests.
@rickeylev rickeylev force-pushed the expose-venv-symlink-api branch from 4cceb5f to 2069521 Compare June 19, 2026 22:16
@rickeylev rickeylev enabled auto-merge June 20, 2026 00:40
@rickeylev rickeylev added this pull request to the merge queue Jun 20, 2026
Merged via the queue into bazel-contrib:main with commit de0405a Jun 20, 2026
5 checks passed
@rickeylev rickeylev deleted the expose-venv-symlink-api branch June 20, 2026 01:01
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.

2 participants