bazelbuild / rules_python

Bazel Python Rules
https://rules-python.readthedocs.io
Apache License 2.0
538 stars 542 forks source link

refactor(pypi): move config setting processing to the macro #2424

Closed aignas closed 14 hours ago

aignas commented 4 days ago

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:

This is needed for #2319 and #2423.

To be in future PRs:

aignas commented 17 hours ago

I need to revisit the error message wording here. Will do later.