Skip to content

Commit 0b6b471

Browse files
authored
refactor!: Remove entrypoint (#1987)
Removes the entrypoint macro. This has been replaced with `py_console_script_binary`. I was getting familiar again with the code-base today and remembered that we were on a path to deprecate `entrypoint` in favor of `py_console_script_binary`. So I did a very quick clean-up. It has been mentioned for a while that it would be removed, so I *think* removal is valid now from a compatibility standpoint: https://github.com/bazelbuild/rules_python/pull/1987/files#diff-fed3a6d7d568aea2237b65544571ef9519b5f249ddbb23d521e6e55161c10452L33 Either way, we probably don't want to carry this into the 1.0
1 parent a124c84 commit 0b6b471

17 files changed

+3
-669
lines changed

.bazelci/presubmit.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -515,18 +515,6 @@ tasks:
515515
- "bazel run //:os_specific_requirements.update"
516516
- "git diff --exit-code"
517517

518-
integration_test_pip_repository_entry_points_macos_workspace:
519-
<<: *reusable_build_test_all
520-
<<: *common_workspace_flags
521-
name: "pip_repository_entry_points: macOS, workspace"
522-
working_directory: tests/integration/pip_repository_entry_points
523-
platform: macos
524-
integration_test_pip_repository_entry_points_windows_workspace:
525-
<<: *reusable_build_test_all
526-
<<: *common_workspace_flags
527-
name: "pip_repository_entry_points: Windows, workspace"
528-
working_directory: tests/integration/pip_repository_entry_points
529-
platform: windows
530518

531519
integration_test_ignore_root_user_error_macos_workspace:
532520
<<: *reusable_build_test_all

.bazelignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ examples/py_proto_library/bazel-py_proto_library
2626
tests/integration/compile_pip_requirements/bazel-compile_pip_requirements
2727
tests/integration/ignore_root_user_error/bazel-ignore_root_user_error
2828
tests/integration/local_toolchains/bazel-local_toolchains
29-
tests/integration/pip_repository_entry_points/bazel-pip_repository_entry_points

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
55
# To update these lines, execute
66
# `bazel run @rules_bazel_integration_test//tools:update_deleted_packages`
7-
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/dupe_requirements,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/pythonconfig,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/pip_repository_entry_points,tests/integration/py_cc_toolchain_registered
8-
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/dupe_requirements,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/pythonconfig,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/pip_repository_entry_points,tests/integration/py_cc_toolchain_registered
7+
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/python/private,gazelle/pythonconfig,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered
8+
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/python/private,gazelle/pythonconfig,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered
99

1010
test --test_output=errors
1111

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ A brief description of the categories of changes:
3838
`interpreter_version_info` arg.
3939

4040
### Removed
41-
* Nothing yet
41+
* (pip): Removes the `entrypoint` macro that was replaced by `py_console_script_binary` in 0.26.0.
4242

4343
## [0.33.2] - 2024-06-13
4444

examples/pip_parse_vendored/requirements.bzl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ def data_requirement(name):
3030
def dist_info_requirement(name):
3131
return "@my_project_pip_deps_vendored_{}//:{}".format(pip_utils.normalize_name(name), "dist_info")
3232

33-
def entry_point(pkg, script = None):
34-
if not script:
35-
script = pkg
36-
return "@my_project_pip_deps_vendored_" + pip_utils.normalize_name(pkg) + "//:rules_python_wheel_entry_point_" + script
37-
3833
def _get_annotation(requirement):
3934
# This expects to parse `setuptools==58.2.0 --hash=sha256:2551203ae6955b9876741a26ab3e767bb3242dafe86a32a749ea0d78b6792f11`
4035
# down to `setuptools`.

python/pip.bzl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ def data_requirement(name):
106106
def dist_info_requirement(name):
107107
return "{macro_tmpl}".format(pip_utils.normalize_name(name), "dist_info")
108108
109-
def entry_point(pkg, script = None):
110-
fail("Not implemented yet")
111-
112109
def install_deps(**whl_library_kwargs):
113110
{install_deps_calls}
114111
for wheel_name in _wheel_names:

python/pip_install/pip_repository_requirements.bzl.tmpl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ def data_requirement(name):
2929
def dist_info_requirement(name):
3030
return "%%MACRO_TMPL%%".format(pip_utils.normalize_name(name), "dist_info")
3131

32-
def entry_point(pkg, script = None):
33-
if not script:
34-
script = pkg
35-
return "@%%NAME%%_" + pip_utils.normalize_name(pkg) + "//:rules_python_wheel_entry_point_" + script
36-
3732
def _get_annotation(requirement):
3833
# This expects to parse `setuptools==58.2.0 --hash=sha256:2551203ae6955b9876741a26ab3e767bb3242dafe86a32a749ea0d78b6792f11`
3934
# down to `setuptools`.

python/private/bzlmod/requirements.bzl.tmpl

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,3 @@ def data_requirement(name):
2424

2525
def dist_info_requirement(name):
2626
return "%%MACRO_TMPL%%".format(pip_utils.normalize_name(name), "dist_info")
27-
28-
def entry_point(pkg, script = None):
29-
"""entry_point returns the target of the canonical label of the package entrypoints.
30-
"""
31-
actual_script = script or pkg
32-
33-
fail("""Please replace this instance of entry_point with the following:
34-
35-
```
36-
load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary")
37-
38-
py_console_script_binary(
39-
name = "{pkg}",
40-
pkg = "@%%NAME%%//{pkg}",{script}
41-
)
42-
```
43-
""".format(
44-
pkg = pip_utils.normalize_name(pkg),
45-
script = "" if not script else "\n script = \"%s\"," % actual_script,
46-
))

tests/integration/BUILD.bazel

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,6 @@ default_test_runner(
6363

6464
# TODO: add compile_pip_requirements_test_from_external_repo
6565

66-
rules_python_integration_test(
67-
name = "pip_repository_entry_points_workspace_test",
68-
timeout = "long",
69-
bzlmod = False,
70-
# The dependencies needed for this test are not cross-platform: https://github.com/bazelbuild/rules_python/issues/260
71-
tags = ["fix-windows"],
72-
workspace_path = "pip_repository_entry_points",
73-
)
74-
7566
rules_python_integration_test(
7667
name = "compile_pip_requirements_test",
7768
)

tests/integration/pip_repository_entry_points/.bazelrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/integration/pip_repository_entry_points/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/integration/pip_repository_entry_points/BUILD.bazel

Lines changed: 0 additions & 32 deletions
This file was deleted.

tests/integration/pip_repository_entry_points/WORKSPACE

Lines changed: 0 additions & 32 deletions
This file was deleted.

tests/integration/pip_repository_entry_points/pip_repository_entry_points_test.py

Lines changed: 0 additions & 83 deletions
This file was deleted.

tests/integration/pip_repository_entry_points/requirements.in

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)