Repository navigation
Closed
Labels
Can Close?Will close in 30 days if there is no new activity
Description
Hi there!
I have the following in my requirements.txt:
apache-beam[gcp]
I have a target that imports this as a requirement. When I got to build the target, I get the following error:
bazel build //:main
INFO: Invocation ID: 37e2bf96-1e58-4e1e-ba62-4f553a6106c6
DEBUG: Rule 'io_bazel_rules_python' modified arguments {"shallow_since": "1556033974 -0400"}
ERROR: /Users/jpvelez/repos/bazel-python-bug/BUILD:4:1: Traceback (most recent call last):
File "/Users/jpvelez/repos/bazel-python-bug/BUILD", line 4
py_binary(name = "main", srcs = ["main.py"], d...]")])
File "/Users/jpvelez/repos/bazel-python-bug/BUILD", line 10, in py_binary
requirement("apache_beam[gcp]")
File "/private/var/tmp/_bazel_jpvelez/38a707cf9d0f20110a0d780b5b663df2/external/pip/requirements.bzl", line 418, in requirement
fail(("Could not find pip-provided de...))
Could not find pip-provided dependency: 'apache_beam[gcp]'
ERROR: Skipping '//:main': no such target '//:main': target 'main' not declared in package '' defined by /Users/jpvelez/repos/bazel-python-bug/BUILD
WARNING: Target pattern parsing failed.
ERROR: no such target '//:main': target 'main' not declared in package '' defined by /Users/jpvelez/repos/bazel-python-bug/BUILD
INFO: Elapsed time: 15.022s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)
This also happens with any library that depends on apache-beam[gcp], like tensorflow-transform.
The [gcp] git is called an extras_require, in pip parlance.
To reproduce the bug, clone the following repo and run bazel build //:main:
https://github.com/jpvelez/bazel-python-bug/tree/20af1e25594ccb77f2b2fb3b240829c0e714c3ad
Metadata
Metadata
Assignees
Labels
Can Close?Will close in 30 days if there is no new activity
Activity
pcn commentedon Apr 30, 2019
Last time I dived into this, the issue bottomed out here: #90
github-actions commentedon Apr 14, 2021
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!
thundergolfer commentedon Apr 28, 2021
With the newer
pip_installI was able to install and run apache_beam (version: 2.29.0) successfully.I did not test the
[gcp]component but if we look at the BUILD file for the dependency inexternal/pypi/pypi__apache_beam/BUILD.bazelwe see:which includes all the extra GCP packages.
(Note, the Bazel rules are pretty slow to load this package, probably on account of how many dependencies it pulls in).
thundergolfer commentedon Apr 28, 2021
Will close this issue as resolved by the newer
pip_install(demo'd above) andpip_parsefunctionality.