Skip to content

compile_pip_requirements does not use credential helper #2663

Closed as not planned
@jml-derek

Description

@jml-derek

🐞 Bug Report

Affected Rule

The issue is caused by the pip.parse rule with experimental_index_url and experimental_index_url_overrides configurations.

Is this a regression?

I have not tried previous versions. This is my first attempt following the documentation at https://github.com/bazelbuild/rules_python/blob/389431bba6f9a4b46b6cf15dd9cd24a1f52f6e16/docs/pypi-dependencies.md?plain=1#L417.

Description

When using pip.parse with experimental_index_url and experimental_index_url_overrides configured with a credential helper script that directly attaches a token generated from the gcloud CLI, authentication fails. The command still prompts for username and password instead of using the token provided by the helper script.

🔬 Minimal Reproduction

I've created a test repository that demonstrates the issue: https://github.com/derek-jml/test_repo

Steps to reproduce:

  1. Clone the repository
  2. Run bazel run //:requirements.update
  3. Observe that it prompts for username and password instead of using the token

🔥 Exception or Error

When running `bazel run //:requirements.update`, it prompts for username and password authentication instead of using the token provided by the credential helper script.

🌍 Your Environment

Operating System:

[Your OS information]

Output of bazel version:

8.1.1

Rules_python version:

1.2.0

Anything else relevant?
I'm following the documentation for using private PyPI repositories with authentication as described in the pypi-dependencies.md file. The specific section I'm referencing is about using credential helper scripts with experimental_index_url and experimental_index_url_overrides.

The credential helper script generates a token from the gcloud CLI that should be used automatically, but the authentication mechanism appears to ignore this and still prompts for username/password credentials.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions