[Python] How to configure uv to use azure package registry

Discussão em 'Python' iniciado por Stack, Abril 21, 2025.

  1. Stack

    Stack Membro Participativo

    My current .netrc

    machine pkgs.dev.azure.com
    login repo1
    password <PAT1>
    machine pkgs.dev.azure.com
    login repo2
    password <PAT2>


    Part of pyproject.toml

    ...

    [[tool.uv.index]]
    name = "repository1"
    url = "https://pkgs.dev.azure.com/repo1/Project1/_packaging/some-other-repo/pypi/simple/"
    explicit = true

    [[tool.uv.index]]
    name = "repository2"
    url = "https://pkgs.dev.azure.com/repo2/Project2/_packaging/some-repo/pypi/simple/"
    explicit = true
    ...


    repo2 works, but repo1 shows an authorization error. Suppose I remove the repo2 credential from .netrc, the repo1 starts to work. I assume the current .netrc just overrides the previous record. How to make it work together?

    Also, I tried a config like this but no result

    ...
    [[tool.uv.index]]
    name = "repository2"
    url = "https://repo2@pkgs.dev.azure.com/repo2/Project2/_packaging/some-repo/pypi/simple/"
    explicit = true
    ...

    Continue reading...

Compartilhe esta Página