1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Issues with Using `--extra-index-url` in `uv` with Google Cloud Artifact Registry

Discussão em 'Python' iniciado por Stack, Outubro 8, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to create a uv project that uses an --extra-index-url with Google Cloud Artifact Registry. According to the uv documentation, this should be possible. I am using uv 0.4.18. Here's what I've tried so far:

    gcloud auth application-default login --project ${PROJECT_ID}
    uv venv
    source .venv/bin/activate
    uv pip install keyring keyrings.google-artifactregistry-auth
    uv pip install --keyring-provider subprocess ${MY_PACKAGE} --extra-index-url https://${REGION}-python.pkg.dev/${PROJECT_ID}/${REPOSITORY_ID}/simple


    However, it returns an error indicating that my package can't be found. Interestingly, when I use standard Python, I can install my private package without any issues. Here's the code that works:

    gcloud auth application-default login --project ${PROJECT_ID}
    python -m venv .venv
    source .venv/bin/activate
    pip install keyring keyrings.google-artifactregistry-auth
    pip install ${MY_PACKAGE} --extra-index-url https://${REGION}-python.pkg.dev/${PROJECT_ID}/${REPOSITORY_ID}/simple


    It seems like others have faced this issue before, as mentioned in this closed GitHub issue. Has anyone else encountered this problem or found a workaround? Any help would be appreciated!

    Continue reading...

Compartilhe esta Página