-
Notifications
You must be signed in to change notification settings - Fork 542
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
compile_pip_requirements fails if the output file requirements.txt
does not already exist
#1765
Comments
This example says it was generated by running |
If I understand correctly, I don't think so, because the error I'm reporting happens when building |
I am not sure if this is a doc issue where we just ask the users to create an empty file. At the end of the day this is something that gets passed to a target definition and the error happens within bazel itself, not within the code that is owned by rules python. |
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. |
Just a note that the rule would need to use a rules_python/python/uv/private/lock.bzl Line 65 in 27276b6
|
🐞 bug report
Affected Rule
The issue is caused by the rule:
compile_pip_requirements
Is this a regression?
Not as far as I can tell. I'm not aware of any version of
rules_python
in which this works (although I haven't exhaustively checked).Description
I'm trying to use
compile_pip_requirements
to createrequirements_lock.txt
for the first time fromrequirements.in
. This is exactly the same issue as #1129 (now closed), except that I encountered it on Linux whereas the other report was on Windows. (I would guess the issue is platform-independent.) I wasn't sure of the right protocol for "reactivating" an issue that was closed for inactivity, but if I was wrong to post this, feel free to reopen the original issue instead.🔬 Minimal Reproduction
WORKSPACE
BUILD
requirements.in
I pushed a repository with these files as well: https://github.com/diazona/bazel-python-error
🔥 Exception or Error
🌍 Your Environment
Operating System:
Gentoo Linux
Output of
bazel version
:I also tried versions 6.5.0, 6.3.1, and 5.4.1 (all through Bazelisk, by setting
USE_BAZEL_VERSION
), with the same results.Rules_python version:
Commit
76f1c76f60ccb536d3b3e2c9f023d8063f40bcd5
, which is the current head ofmain
as I'm writing thisAnything else relevant?
If I create
requirements.txt
manually, regardless of what I put in it, the update command seems to work as expected: it replaces the content ofrequirements.txt
with a list of requirements.And I might very well be misunderstanding what
compile_pip_requirements
is supposed to do. If the existing behavior (fail if the output file doesn't exist) is expected, then consider this a request to improve the clarity of the documentation. (I'd be happy to offer a PR in that case.)The text was updated successfully, but these errors were encountered: