target 'rules_python_wheel_entry_point_hjson' not declared in package
🐞 bug report
The entry_point for package hjson does not work with v0.6.0.
Is entry_point not fully available for use yet? I don't see any mention of it on the top level README.md.
Affected Rule
entry_point method
Is this a regression?
Not sure. First time I've tried using this feature of rules_python. Perhaps this package is a different case of an invalid entry points config?
Description
The rules_python_wheel_entry_point_hjson not generated for requirement hjson==3.0.2:
🔬 Minimal Reproduction
- sample workspace in
rules_pythonbranch, try running any of the targets likebazel run //:hjson.
🔥 Exception or Error
bazel run //:hjson
INFO: Invocation ID: 1389b1ea-dff0-4c15-8cc2-1d0a248ceb3c
ERROR: /Users/kris/workspace/github.com/kriswuollett/rules_python/examples/entrypoint/BUILD:3:6: no such target '@pip_deps_hjson//:rules_python_wheel_entry_point_hjson': target 'rules_python_wheel_entry_point_hjson' not declared in package '' defined by /private/var/tmp/_bazel_kris/0e05fb82d063bbe0995a0b2b910a0be4/external/pip_deps_hjson/BUILD.bazel and referenced by '//:hjson'
ERROR: Analysis of target '//:hjson' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.114s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
🌍 Your Environment
Operating System:
macOS 12.1
Output of bazel version:
Bazelisk version: development
Build label: 4.2.2
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 2 18:28:52 2021 (1638469732)
Build timestamp: 1638469732
Build timestamp as int: 1638469732
Rules_python version:
http_archive(
name = "rules_python",
sha256 = "a30abdfc7126d497a7698c29c46ea9901c6392d6ed315171a6df5ce433aa4502",
strip_prefix = "rules_python-0.6.0",
url = "https://github.com/bazelbuild/rules_python/archive/0.6.0.tar.gz",
)
This issue is caused by the hjson executable coming from setup.py, and not being a console script (entry point) defined in the wheel.
https://github.com/hjson/hjson-py/blob/master/setup.py#L75
This could potentially be "fixed" (I'd call this more of a feature-request fulfillment) by https://github.com/bazelbuild/rules_python/pull/575
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!
Cc @groodt This would be fixed by having support for setup.py scripts. Perhaps this can be collapsed or covered to a ticket tracking that specific feature?
Agreed. I think I'll create an "umbrella" tracking issue for "legacy scripts support".
fwiw, it seems that perhaps hsjon will switch to entrypoints (or at least are being encouraged by conda to do so) https://github.com/hjson/hjson-py/pull/29
This particular issue with hjson is fixed in hjson==3.1.0.
Tested against the minimal reproduction and it works.
❯ ../../bazel-5.2.0-darwin-x86_64 run //:hjson -- --help
INFO: Analyzed target //:hjson (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target @pip_deps_hjson//:rules_python_wheel_entry_point_hjson up-to-date:
bazel-bin/external/pip_deps_hjson/rules_python_wheel_entry_point_hjson
INFO: Elapsed time: 0.201s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
Hjson, a user interface for JSON
Usage:
hjson [options]
hjson [options] <input>
hjson (-h | --help)
hjson (-V | --version)
Options:
-h --help Show this screen.
-j Output as formatted JSON.
-c Output as JSON.
-V --version Show version.
Hjson, a user interface for JSON
Usage:
hjson [options]
hjson [options] <input>
hjson (-h | --help)
hjson (-V | --version)
Options:
-h --help Show this screen.
-j Output as formatted JSON.
-c Output as JSON.
-V --version Show version.
Closing.