Skip to content

refactor: change site_packages_symlinks to venv_symlinks #2939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 29, 2025

Conversation

rickeylev
Copy link
Collaborator

This generalizes the ability to populate the venv directory by adding and additional field,
kind, which tells which directory of the venv to populate. A symbolic constant is used
to indicate which directory so that users don't have to re-derive the platform and version
specific paths that make up the venv directory names.

This follows the design described by #2156 (comment)

This also changes it to a depset of structs to make it more forward compatible. A provider
is used because they're slightly more memory efficient than regular structs.

Work towards #2156

@rickeylev rickeylev requested a review from aignas as a code owner May 29, 2025 03:15
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

LGTM other than the nit.


Args:
ctx: current rule ctx
site_packages: runfiles-root-relative path to the site-packages directory
venv_dir_map: todo
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: only this TODO needs to be replaced.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@rickeylev rickeylev enabled auto-merge May 29, 2025 06:31
@rickeylev rickeylev added this pull request to the merge queue May 29, 2025
Merged via the queue into bazel-contrib:main with commit fd29d27 May 29, 2025
3 checks passed
@rickeylev rickeylev deleted the venv.symlinks branch May 29, 2025 07:04
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