🐞 bug report
Affected Rule
The bug is loacted here:
https://github.com/bazelbuild/rules_python/blob/master/python/pip_install/extract_wheels/lib/bazel.py#L42
Is this a regression?
No
Description
Given one uses --incompatible_disallow_empty_glob, lazily fetching Python dependencies via pip_parse(...) and install_deps(...) fails for dependecies which are not available as .whl but are stored on pypi as .tar.gz. An example for such a package is yattag: https://pypi.org/project/yattag/#files
🔬 Minimal Reproduction
Example project
WORKSPACE
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "778197e26c5fbeb07ac2a2c5ae405b30f6cb7ad1f5510ea6fdac03bded96cc6f",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.2.0/rules_python-0.2.0.tar.gz",
)
load("@rules_python//python:pip.bzl", "pip_parse")
pip_parse(
name = "my_deps",
requirements_lock = "//:requirements.txt",
)
load("@my_deps//:requirements.bzl", "install_deps")
install_deps()
BUILD
load("@rules_python//python:defs.bzl", "py_binary")
load("@my_deps//:requirements.bzl", "requirement")
py_binary(
name = "foo",
srcs = ["foo.py"],
deps = [requirement("yattag")],
)
requirements.txt
empty foo.py
Command
bazel run --incompatible_disallow_empty_glob //:foo
🔥 Exception or Error
ERROR: Traceback (most recent call last):
File "/home/user/.cache/bazel/_bazel_user/a991fbd6be2c759aa7941b1f92e83708/external/my_deps_pypi__yattag/BUILD.bazel", line 7, column 14, in
srcs=glob(["*.whl"]),
Error in glob: glob pattern '*.whl' didn't match anything, but allow_empty is set to False (the default value of allow_empty can be set with --incompatible_disallow_empty_glob)
🌍 Your Environment
Operating System:
Output of bazel version:
Rules_python version:
Anything else relevant?
🐞 bug report
Affected Rule
The bug is loacted here:
https://github.com/bazelbuild/rules_python/blob/master/python/pip_install/extract_wheels/lib/bazel.py#L42
Is this a regression?
NoDescription
Given one uses
--incompatible_disallow_empty_glob, lazily fetching Python dependencies viapip_parse(...)andinstall_deps(...)fails for dependecies which are not available as.whlbut are stored on pypi as.tar.gz. An example for such a package is yattag: https://pypi.org/project/yattag/#files🔬 Minimal Reproduction
Example project
WORKSPACE
BUILD
requirements.txt
empty
foo.pyCommand
bazel run --incompatible_disallow_empty_glob //:foo🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version:Rules_python version:
Anything else relevant?