Skip to content

compile_pip_requirements no longer uses predictable paths #908

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

Closed
vonschultz opened this issue Nov 30, 2022 · 4 comments · Fixed by #909 or #2584
Closed

compile_pip_requirements no longer uses predictable paths #908

vonschultz opened this issue Nov 30, 2022 · 4 comments · Fixed by #909 or #2584
Assignees

Comments

@vonschultz
Copy link
Contributor

🐞 bug report

Affected Rule

The issue is caused by the rule: compile_pip_requirements

Is this a regression?

Yes, the previous version in which this bug was not present was: 0.13.0. It is present in 0.15.0. I didn't explicitly check 0.14.0, but I'll actually go one step further: a git bisect says the first bad commit is b15e15f. (Ping @philsc and @f0rmiga.)

Description

As it says in python/pip_install/pip_compile.py:

We don't want fully resolved, absolute paths in the generated requirements file.
The paths could differ for every invocation. Replace them with a predictable path.

I haven't double checked that that's the right file for this bug report, but the comment describes a desirable outcome that I'm no longer seeing.

🔬 Minimal Reproduction

See https://gist.github.com/vonschultz/9e242d1612ec70b1848057cce681e037. I'm using it with bazelisk run :pip_dependencies.update.

🔥 Exception or Error

You see the problem in requirements_common_lock-txt:

    # via -r /tmp/rules_python-tests/9e242d1612ec70b1848057cce681e037/requirements_extra.in

Before b15e15f that line reads

    # via -r ./requirements_extra.in

which is the desired behavior.

🌍 Your Environment

Operating System:

Ubuntu 20.04

Output of bazel version:

  
Bazelisk version: v1.9.0
Build label: 5.3.2
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Oct 19 18:22:12 2022 (1666203732)
Build timestamp: 1666203732
Build timestamp as int: 1666203732
  

Rules_python version:

0.15.0
@f0rmiga
Copy link
Member

f0rmiga commented Nov 30, 2022

I was able to reproduce this and it only seems to happen with the added -r requirements_extra.in.

@philsc
Copy link
Contributor

philsc commented Dec 1, 2022

Whoops. Sorry about that. Thanks for fixing it @f0rmiga!

@vonschultz
Copy link
Contributor Author

I can confirm that the problem is fixed in the new version, 0.15.1. Many thanks, @f0rmiga.

@vonschultz
Copy link
Contributor Author

The bug is back. Regression caused by fbf8bc1 according to my git bisect. Reproducing with Ubuntu 24.04 and Bazel 8.0.1.

aignas added a commit to aignas/rules_python that referenced this issue Jan 26, 2025
…g packages (bazel-contrib#2514)

This reverts commit fbf8bc1.

Also, update the CHANGELOG about the reverting.

Fixes bazel-contrib#908.
github-merge-queue bot pushed a commit that referenced this issue Jan 28, 2025
…g packages (#2514) (#2584)

This reverts commit fbf8bc1 (#2514)

Also, update the CHANGELOG about the reverting.

Fixes #908, which is about the `pip-compile` not using the right files
for performing the locking. It seems that the `pip` upgrade regressed
this error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants