馃悶 bug report
Affected Rule
compile_pip_requirements
Is this a regression?
Unsure
Description
I'm trying to use compile_pip_requirements to create a requirements_lock.txt file from a requirements.in file. I don't have the requirements_lock.txt file yet, so I'm trying to use this rule to create it for the first time.
First, I had to comment out everything in my workspace / build files referring to the requirements_lock.txt input to avoid getting errors. This seems to be a usability quirk---I was hoping that running bazel run //mypackage:requirements.update would work without triggering the other rules that depend on requirements_lock.txt (i.e., from bazel build).
After cleaning that up, I then get the following error(s):
PS C:\work\workspace_root\mypackage> bazel run requirements.update
INFO: Analyzed target //mypackage:requirements.update (52 packages loaded, 1050 targets configured).
INFO: Found 1 target...
ERROR: C:/work/workspace_root\mypackage/BUILD:36:25: PythonZipper mypackage/requirements.update.zip failed: missing input file '//mypackage:requirements_lock.txt'
ERROR: C:/work/workspace_root\mypackage/BUILD:36:25: PythonZipper mypackage/requirements.update.zip failed: 1 input file(s) do not exist
Target //mypackage:requirements.update failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: C:/work/workspace_root\mypackage/BUILD:36:25 PythonZipper mypackage/requirements.update.zip failed: 1 input file(s) do not exist
馃敩 Minimal Reproduction
WORKSPACE
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "ffc7b877c95413c82bfd5482c017edcf759a6250d8b24e82f41f3c8b8d9e287e",
strip_prefix = "rules_python-0.19.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.19.0/rules_python-0.19.0.tar.gz",
)
mypackage/BUILD
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
compile_pip_requirements(
name = "requirements",
#extra_args = ["--allow-unsafe"],
requirements_in = "//mypackage:requirements.in", # also tried just "requirements.in"
requirements_txt = "//mypackage:requirements_lock.txt", # also tried just "requirements_lock.txt"
visibility = ["//visibility:public"],
)
Command
> cd workspace_root
> bazel run //mypackage:requirements.update
Also tried the following, with the same result:
> cd mypackage
> bazel run requirements.update
I also tried just touching an empty requirements_lock.txt file but get the same result.
馃敟 Exception or Error
PS C:\work\workspace_root\mypackage> bazel run requirements.update
INFO: Analyzed target //mypackage:requirements.update (52 packages loaded, 1050 targets configured).
INFO: Found 1 target...
ERROR: C:/work/workspace_root\mypackage/BUILD:36:25: PythonZipper mypackage/requirements.update.zip failed: missing input file '//mypackage:requirements_lock.txt'
ERROR: C:/work/workspace_root\mypackage/BUILD:36:25: PythonZipper mypackage/requirements.update.zip failed: 1 input file(s) do not exist
Target //mypackage:requirements.update failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: C:/work/workspace_root\mypackage/BUILD:36:25 PythonZipper mypackage/requirements.update.zip failed: 1 input file(s) do not exist
馃實 Your Environment
Operating System:
Windows 10, 64-bit (Version 21H2, Build 19044.2604)
Output of bazel version:
Bazelisk version: v1.16.0
Build label: 6.1.0
Build target: bazel-out/x64_windows-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Mar 6 17:11:12 2023 (1678122672)
Build timestamp: 1678122672
Build timestamp as int: 1678122672
Rules_python version:
Anything else relevant?
馃悶 bug report
Affected Rule
compile_pip_requirementsIs this a regression?
Unsure
Description
I'm trying to use
compile_pip_requirementsto create a requirements_lock.txt file from a requirements.in file. I don't have the requirements_lock.txt file yet, so I'm trying to use this rule to create it for the first time.First, I had to comment out everything in my workspace / build files referring to the requirements_lock.txt input to avoid getting errors. This seems to be a usability quirk---I was hoping that running
bazel run //mypackage:requirements.updatewould work without triggering the other rules that depend on requirements_lock.txt (i.e., frombazel build).After cleaning that up, I then get the following error(s):
馃敩 Minimal Reproduction
WORKSPACEmypackage/BUILDCommand
Also tried the following, with the same result:
I also tried just
touching an emptyrequirements_lock.txtfile but get the same result.馃敟 Exception or Error
馃實 Your Environment
Operating System:
Output of
bazel version:Rules_python version:
Anything else relevant?