Skip to content
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

refactor: add builders to make creating PyInfo/depset/runfiles easier #2251

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

rickeylev
Copy link
Contributor

@rickeylev rickeylev commented Sep 25, 2024

This add some builders "classes" to make constructing PyInfo, depsets, and runfiles
a bit cleaner. Previously, building such objects required creating multiple local
variables for each arg/attribute of the object (e.g. list_of_files and list_of_depsets
for building a depset). Keeping track of all the variables was verbose and tedious.

To make it easier, encapsulate that bookkeeping in some objects. Accumulating parts is
now much easier: builders have an add() method that looks at the input and stores it
in the appropriate place.

This builders will be exposed to users in an upcoming PR to make building and merging
PyInfo objects easier.

Work towards #1647

@rickeylev rickeylev force-pushed the refactor.builders branch 4 times, most recently from 4238eaf to a65d238 Compare September 26, 2024 23:45
@rickeylev rickeylev marked this pull request as ready for review September 27, 2024 02:27
python/private/py_info.bzl Outdated Show resolved Hide resolved
@rickeylev rickeylev added this pull request to the merge queue Sep 27, 2024
Merged via the queue into bazelbuild:main with commit 18380a2 Sep 27, 2024
4 checks passed
@rickeylev rickeylev deleted the refactor.builders branch September 27, 2024 17:11
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