Skip to content
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

bazel run //:requirements.update works, but bazel test //:requirements_test fails #2038

Open
hanneskaeufler opened this issue Jul 5, 2024 · 1 comment

Comments

@hanneskaeufler
Copy link
Contributor

🐞 bug report

Affected Rule

The issue is caused by the rule: compile_pip_requirements

Is this a regression?

I did not try earlier versions.

Description

bazel run //:requirements.update successfully resolves dependencies to requirements.txt.
However the test automatically created by compile_pip_requirements fails.
I'm somewhat confident that this has to do with authentication. I am behind a corporate proxy and use a .netrc.
I found #1087 which has had no activity or resolution, but sounds related.

🔬 Minimal Reproduction

# BUILD
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

exports_files([
    "requirements.in",
    "requirements.txt",
])

compile_pip_requirements(
    name = "requirements",
    src = "requirements.in",
    requirements_txt = "requirements.txt",
)

# requirements.in
numpy==1.26.4 # pinning numpy to 1.26.4 as per https://github.com/numpy/numpy/issues/23808 allows us to use python 3.12
asammdf
cogapp
docker
jsondiff
pytest
pytest-cov

🔥 Exception or Error


[...]
INFO: Found 3 targets and 1 test target...
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a n
ew connection: [Errno -2] Name or service not known')': /simple/numpy/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a n
ew connection: [Errno -2] Name or service not known')': /simple/numpy/
[...]
  ERROR: Cannot install numpy==1.26.4 because these package versions have conflicting dependencies.
resolve
    raise error from e
pip._internal.exceptions.DistributionNotFound: No matching distribution found for numpy==1.26.4

//:requirements_test                                     FAILED in 8.6s

🌍 Your Environment

Operating System:

  
Linux xxx 5.15.0-113-generic #123~20.04.1-Ubuntu SMP Wed Jun 12 17:33:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  

Output of bazel version:

  
Bazelisk version: v1.11.0
Build label: 6.3.2
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Aug 8 15:48:33 2023 (1691509713)
Build timestamp: 1691509713
Build timestamp as int: 1691509713
  

Rules_python version:

  
0.33
  

Anything else relevant?

@LittleHuba
Copy link

Hi,
took me ages to find that out myself. Your issue is likely the same as #1817

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants