Skip to content

Conversation

@aignas
Copy link
Collaborator

@aignas aignas commented Feb 14, 2024

This does not change any logic/features in the bzlmod or legacy code, but
just changes the interfaces and how the parameters are passed. The final
result should be the same.

Summary:

  • introduce a whl_alias struct to make code more object oriented.
  • make the interface of the function as small as possible.
  • unify the bzlmod and legacy code paths and simplify tests.
  • allow to specify arbitrary repos and config settings
    when generating aliases, which is useful in multi-platform hub
    generation.

Summary:
- introduce a whl_alias struct to make code more object oriented.
- make the interface of the function as small as possible.
- unify the bzlmod and legacy code paths.
- allow to specify arbitrary repo prefixes and config settings
  when generating aliases (split out from bazel-contrib#1744).
@aignas aignas marked this pull request as ready for review February 14, 2024 05:32
@aignas aignas requested a review from rickeylev as a code owner February 14, 2024 05:32
repo_name = rctx.attr.repo_name,
rules_python = rctx.attr._template.workspace_name,
aliases = {
key: [whl_alias(**v) for v in json.decode(values)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of scope for this PR, but I wonder if passing a file might work better than passing it as strings in regular attributes. The pip hub basically needs to be given all the possible backing repos and targets, right? Which could be rather large. Putting that in a file seems like it'd scale better than the string attributes.

Oh hm...and that sort of sounds like the sort of intermediate file Phil's thing has been circling around...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interesting, I like the file idea, we could have a label-keyed dict here. Once I merge this, I can experiment with this idea.

@aignas aignas enabled auto-merge February 15, 2024 04:51
@aignas aignas added this pull request to the merge queue Feb 15, 2024
Merged via the queue into bazel-contrib:main with commit c0c6901 Feb 15, 2024
@aignas aignas deleted the refactor/render-pkg-aliases branch February 15, 2024 11:06
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