You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve the error messages thrown when a PyPI package is not available to include action-oriented tips. Update the integration test expected assertions accordingly.
hub_clause=' when building under PyPI hub "{hub}". Try adding it to the requirements of this hub (e.g. requirements_lock or requirements_by_platform in pip.parse)'.format(
11
+
hub=ctx.attr.hub_name,
12
+
)
13
+
else:
14
+
hub_clause=' because no default PyPI hub was configured. Try designating a default hub via pip.default(default_hub = "...") or select a hub using --@rules_python//python/config_settings:venv'
15
+
9
16
# Register an action that fails when Bazel attempts to stage/build this file
10
17
ctx.actions.run_shell(
11
18
outputs= [out],
12
19
command="echo 'ERROR: PyPI package \"{pkg}\" is not available{hub_clause}.' >&2 && exit 1".format(
13
20
pkg=ctx.attr.package_name,
14
-
hub_clause=(' when building under PyPI hub "%s"'%ctx.attr.hub_name) ifctx.attr.hub_nameelse" because no PyPI hub or default hub is requested",
'ERROR: PyPI package "declared_only_pkg:declared-only-alias" is not available when building under PyPI hub "pypi_b".',
95
+
'ERROR: PyPI package "declared_only_pkg:declared-only-alias" is not available when building under PyPI hub "pypi_b"\\. Try adding it to the requirements of this hub',
0 commit comments