Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: Remove entrypoint #1987

Merged
merged 6 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -515,18 +515,6 @@ tasks:
- "bazel run //:os_specific_requirements.update"
- "git diff --exit-code"

integration_test_pip_repository_entry_points_macos_workspace:
<<: *reusable_build_test_all
<<: *common_workspace_flags
name: "pip_repository_entry_points: macOS, workspace"
working_directory: tests/integration/pip_repository_entry_points
platform: macos
integration_test_pip_repository_entry_points_windows_workspace:
<<: *reusable_build_test_all
<<: *common_workspace_flags
name: "pip_repository_entry_points: Windows, workspace"
working_directory: tests/integration/pip_repository_entry_points
platform: windows

integration_test_ignore_root_user_error_macos_workspace:
<<: *reusable_build_test_all
Expand Down
1 change: 0 additions & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ examples/py_proto_library/bazel-py_proto_library
tests/integration/compile_pip_requirements/bazel-compile_pip_requirements
tests/integration/ignore_root_user_error/bazel-ignore_root_user_error
tests/integration/local_toolchains/bazel-local_toolchains
tests/integration/pip_repository_entry_points/bazel-pip_repository_entry_points
4 changes: 2 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
# To update these lines, execute
# `bazel run @rules_bazel_integration_test//tools:update_deleted_packages`
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
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
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
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

test --test_output=errors

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ A brief description of the categories of changes:
* (bzlmod): Targets in `all_requirements` now use the same form as targets returned by the `requirement` macro.

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

## [0.33.1] - 2024-06-13

Expand Down
5 changes: 0 additions & 5 deletions examples/pip_parse_vendored/requirements.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ def data_requirement(name):
def dist_info_requirement(name):
return "@my_project_pip_deps_vendored_{}//:{}".format(pip_utils.normalize_name(name), "dist_info")

def entry_point(pkg, script = None):
if not script:
script = pkg
return "@my_project_pip_deps_vendored_" + pip_utils.normalize_name(pkg) + "//:rules_python_wheel_entry_point_" + script

def _get_annotation(requirement):
# This expects to parse `setuptools==58.2.0 --hash=sha256:2551203ae6955b9876741a26ab3e767bb3242dafe86a32a749ea0d78b6792f11`
# down to `setuptools`.
Expand Down
3 changes: 0 additions & 3 deletions python/pip.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ def data_requirement(name):
def dist_info_requirement(name):
return "{macro_tmpl}".format(pip_utils.normalize_name(name), "dist_info")

def entry_point(pkg, script = None):
fail("Not implemented yet")

def install_deps(**whl_library_kwargs):
{install_deps_calls}
for wheel_name in _wheel_names:
Expand Down
5 changes: 0 additions & 5 deletions python/pip_install/pip_repository_requirements.bzl.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ def data_requirement(name):
def dist_info_requirement(name):
return "%%MACRO_TMPL%%".format(pip_utils.normalize_name(name), "dist_info")

def entry_point(pkg, script = None):
if not script:
script = pkg
return "@%%NAME%%_" + pip_utils.normalize_name(pkg) + "//:rules_python_wheel_entry_point_" + script

def _get_annotation(requirement):
# This expects to parse `setuptools==58.2.0 --hash=sha256:2551203ae6955b9876741a26ab3e767bb3242dafe86a32a749ea0d78b6792f11`
# down to `setuptools`.
Expand Down
20 changes: 0 additions & 20 deletions python/private/bzlmod/requirements.bzl.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,3 @@ def data_requirement(name):

def dist_info_requirement(name):
return "%%MACRO_TMPL%%".format(pip_utils.normalize_name(name), "dist_info")

def entry_point(pkg, script = None):
"""entry_point returns the target of the canonical label of the package entrypoints.
"""
actual_script = script or pkg

fail("""Please replace this instance of entry_point with the following:

```
load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary")

py_console_script_binary(
name = "{pkg}",
pkg = "@%%NAME%%//{pkg}",{script}
)
```
""".format(
pkg = pip_utils.normalize_name(pkg),
script = "" if not script else "\n script = \"%s\"," % actual_script,
))
9 changes: 0 additions & 9 deletions tests/integration/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ default_test_runner(

# TODO: add compile_pip_requirements_test_from_external_repo

rules_python_integration_test(
name = "pip_repository_entry_points_workspace_test",
timeout = "long",
bzlmod = False,
# The dependencies needed for this test are not cross-platform: https://github.com/bazelbuild/rules_python/issues/260
tags = ["fix-windows"],
workspace_path = "pip_repository_entry_points",
)

rules_python_integration_test(
name = "compile_pip_requirements_test",
)
Expand Down
10 changes: 0 additions & 10 deletions tests/integration/pip_repository_entry_points/.bazelrc

This file was deleted.

4 changes: 0 additions & 4 deletions tests/integration/pip_repository_entry_points/.gitignore

This file was deleted.

32 changes: 0 additions & 32 deletions tests/integration/pip_repository_entry_points/BUILD.bazel

This file was deleted.

32 changes: 0 additions & 32 deletions tests/integration/pip_repository_entry_points/WORKSPACE

This file was deleted.

This file was deleted.

This file was deleted.

Loading