Before hand we would pass around whl_alias struct instances and it
would go through rounds of starlark functions which would end up
rendered as BUILD.bazel files in the hub repository. This means that
every time the output of the said functions would change, the
MODULE.bazel.lock would also possibly change.
Since we now have much better unit testing framework, we start relying
on these functions being evaluated at loading phase instead of repo rule
phase, which means that we can make the BUILD.bazel files not change a
lot when the underlying code changes, this should make the code more
maintainable in the long run and unblocks the code to accept extra
things, like env marker values or similar.
Summary:
Remove the repo field from whl_alias.
Rename whl_alias to whl_config_setting
Move the tests around
Simplify the pkg_aliases tests to use contains instead of exact
equality to make things less brittle.
Simplify the pkg_aliases tests to use different mocks to make
expectations easier to understand.
Make whl_config_setting hashable by using tuples instead of lists.
Adjust how we store the whl_config_setting in the PyPI extension
and optimize the passing to the hub_repository.
This is needed for #2319 and #2423.
To be in future PRs:
Remove the need to pass osx_versions, etc to the pkg_aliases macro.
Before hand we would pass around
whl_alias
struct instances and it would go through rounds of starlark functions which would end up rendered as BUILD.bazel files in the hub repository. This means that every time the output of the said functions would change, theMODULE.bazel.lock
would also possibly change.Since we now have much better unit testing framework, we start relying on these functions being evaluated at loading phase instead of repo rule phase, which means that we can make the
BUILD.bazel
files not change a lot when the underlying code changes, this should make the code more maintainable in the long run and unblocks the code to accept extra things, like env marker values or similar.Summary:
repo
field fromwhl_alias
.whl_alias
towhl_config_setting
pkg_aliases
tests to usecontains
instead of exact equality to make things less brittle.pkg_aliases
tests to use different mocks to make expectations easier to understand.whl_config_setting
hashable by using tuples instead of lists.whl_config_setting
in the PyPI extension and optimize the passing to thehub_repository
.This is needed for #2319 and #2423.
To be in future PRs:
osx_versions
, etc to thepkg_aliases
macro.