Skip to content

Commit 3fd01c2

Browse files
committed
comment: suggestions from rickeylev
1 parent 45baa4c commit 3fd01c2

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

python/extensions/private/requirements.bzl.tmpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def dist_info_requirement(name):
3333
return "%%MACRO_TMPL%%".format(_clean_name(name), "dist_info")
3434

3535
def entry_point(pkg, script = None):
36-
"""entry_point returns the target of the canonical label of the package entry points.
36+
"""Returns a select() expression to locate the version-specific entry point.
3737
"""
3838
selects = _entry_point(
3939
tmpl = "@@%%NAME%%//{pkg}/bin_py{version_label}:{script}",
@@ -45,4 +45,7 @@ def entry_point(pkg, script = None):
4545
if selects == None:
4646
fail("Package '{}' does not exist, select one from: {}".format(pkg, _packages.keys()))
4747

48+
# NOTE: We return a select() expression instead of an alias to such an expression
49+
# to avoid having to eagerly load all versions of the wheel. See
50+
# https://github.com/bazelbuild/rules_python/issues/1262 for discussion.
4851
return select(selects)

python/pip_install/tools/wheel_installer/wheel_installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def _extract_wheel(
391391
contents = textwrap.dedent(
392392
"""\
393393
\"\"\"
394-
This file contains the entrypoint script names as a dict, where the keys
394+
This file contains the entry_point script names as a dict, where the keys
395395
are the script names and the values are the target names.
396396
397397
generated by @rules_python//python/pip_install/tools/wheel_installer/wheel_installer.py

tests/pip_hub_repository/entry_point/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load(":entry_point_test.bzl", "entrypoint_test_suite")
15+
load(":entry_point_test.bzl", "entry_point_test_suite")
1616

17-
entrypoint_test_suite(name = "entrypoint_tests")
17+
entry_point_test_suite(name = "entry_point_tests")

tests/pip_hub_repository/entry_point/entry_point_test.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _label(label_str):
2929

3030
_tests = []
3131

32-
def _test_unknown_entrypoint_returns_none(env):
32+
def _test_unknown_entry_point_returns_none(env):
3333
actual = entry_point(
3434
pkg = "foo",
3535
packages = {},
@@ -45,7 +45,7 @@ def _test_unknown_entrypoint_returns_none(env):
4545
# None to the dict subject.
4646
env.expect.that_int(actual).equals(want)
4747

48-
_tests.append(_test_unknown_entrypoint_returns_none)
48+
_tests.append(_test_unknown_entry_point_returns_none)
4949

5050
def _test_constraint_values_are_set_correctly(env):
5151
actual = entry_point(
@@ -85,7 +85,7 @@ def _test_template_is_interpolated_correctly(env):
8585

8686
_tests.append(_test_template_is_interpolated_correctly)
8787

88-
def entrypoint_test_suite(name):
88+
def entry_point_test_suite(name):
8989
"""Create the test suite.
9090
9191
Args:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy