uv: Private package not found from Azure DevOps
I tested the latest fix (https://github.com/astral-sh/uv/issues/3291) and still can’t install a private package using uv due to another error.
requirements.txt
sqlmodel==0.0.14
my-private-package==1.0.0
Execution:
$ uv --version
uv 0.1.42
$ uv pip install --system keyring artifacts-keyring
$ az login
$ uv pip install --system --extra-index-url=https://pkgs.dev.azure.com/mycompany/_packaging/MyFeed/pypi/simple --keyring-provider subprocess --requirement requirements.txt --verbose
DEBUG Starting interpreter discovery for default Python
DEBUG Cached interpreter info for Python 3.12.3, skipping probing: /usr/local/bin/python3
DEBUG Using Python 3.12.3 environment at /usr/local/bin/python3
DEBUG Trying to lock if free: /tmp/uv-39ee7c309557c5e9.lock
DEBUG At least one requirement is not satisfied: my-private-package==1.0.0
DEBUG Using registry request timeout of 30s
DEBUG Solving with target Python version 3.12.3
DEBUG Adding direct dependency: sqlmodel==0.0.14
DEBUG Adding direct dependency: my-private-package==1.0.0
DEBUG No cache entry for: https://pkgs.dev.azure.com/mycompany/_packaging/MyFeed/pypi/simple/my-private-package/
DEBUG No cache entry for: https://pkgs.dev.azure.com/mycompany/_packaging/MyFeed/pypi/simple/sqlmodel/
DEBUG No cache entry for: https://pypi.org/simple/my-private-package/
DEBUG Found stale response for: https://pypi.org/simple/sqlmodel/
DEBUG Sending revalidation request for: https://pypi.org/simple/sqlmodel/
DEBUG Found not-modified response for: https://pypi.org/simple/sqlmodel/
DEBUG Searching for a compatible version of sqlmodel (==0.0.14)
DEBUG Selecting: sqlmodel==0.0.14 (sqlmodel-0.0.14-py3-none-any.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/55/b2/ea0c31d2bb8d22dffd83f43028d8d1b18301702725d6b918ac15f99b6de7/sqlmodel-0.0.14-py3-none-any.whl.metadata
DEBUG Adding transitive dependency for sqlmodel==0.0.14: sqlalchemy>=2.0.0, <2.1.0
DEBUG Adding transitive dependency for sqlmodel==0.0.14: pydantic>=1.10.13, <3.0.0
DEBUG No cache entry for: https://pkgs.dev.azure.com/mycompany/_packaging/MyFeed/pypi/simple/sqlalchemy/
DEBUG No cache entry for: https://pkgs.dev.azure.com/mycompany/_packaging/MyFeed/pypi/simple/pydantic/
DEBUG Found stale response for: https://pypi.org/simple/pydantic/
DEBUG Sending revalidation request for: https://pypi.org/simple/pydantic/
DEBUG Searching for a compatible version of my-private-package (==1.0.0)
DEBUG No compatible version found for: my-private-package
× No solution found when resolving dependencies:
╰─▶ Because my-private-package was not found in the package registry and you require my-private-package==1.0.0, we
can conclude that the requirements are unsatisfiable.
If I use pip, I can:
$ pip install --root-user-action=ignore --extra-index-url=https://pkgs.dev.azure.com/mycompany/_packaging/MyFeed/pypi/simple --requirement requirements.txt
Looking in indexes: https://pypi.org/simple, https://pkgs.dev.azure.com/mycompany/_packaging/MyFeed/pypi/simple
[Warning] [CredentialProvider]Warning: Cannot persist Microsoft authentication token cache securely!
[Warning] [CredentialProvider]Warning: Using plain-text fallback token cache
[Minimal] [CredentialProvider]DeviceFlow: https://pkgs.dev.azure.com/mycompany/_packaging/MyFeed/pypi/simple/
[Minimal] [CredentialProvider]ATTENTION: User interaction required.
**********************************************************************
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ... to authenticate.
**********************************************************************
[Information] [CredentialProvider]VstsCredentialProvider - Acquired bearer token using 'MSAL Device Code'
[Information] [CredentialProvider]VstsCredentialProvider - Attempting to exchange the bearer token for an Azure DevOps session token.
...
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 37 (19 by maintainers)
Commits related to this issue
- Increase verbosity of credential fetch logs So users do not need to turn on trace logging to see fetch results e.g. https://github.com/astral-sh/uv/issues/3542 — committed to astral-sh/uv by zanieb 3 years ago
- Increase verbosity of credential fetch logs (#3550) So users do not need to turn on trace logging to see fetch results e.g. https://github.com/astral-sh/uv/issues/3542 This is more reasonable now... — committed to astral-sh/uv by zanieb 3 years ago
- Docs: Add guide for authenticating to Azure Artifacts (#4857) ## Summary As discussed in #3542 - there has been some confusion about how to get `uv` to work with ADO Artifacts so I'm adding a qui... — committed to astral-sh/uv by benjamin-hodgson 2 years ago
Being able to install private packages from Azure DevOps is essential in my company to use
uv. Could you please tell us if you’re going to invest resources to solve it in the near time?Thank you 😃
Fixed in v25.2.1. Probably need to get better coverage on that CLI module.
@fralik you should be able to add
to your
pyproject.tomlor to auv.tomlfile (without the[tool.uv]section)It works for me… Are you getting your credentials first before installing packages with uv?
keyring --mode creds get https://pkgs.dev.azure.com/orgname/_packaging/Packages/pypi/simple/Can this issue be closed now that the documentation is merged into main? Has anyone had difficulty connecting to Artifacts using the guide?
Thanks, Zanie. As a note, you can skip
keyringand just installartifacts-keyring.This is our pyproject. We use PyPi and private packages.
With that configuration, in the CI/CD you have to override these environment variables:
Try this for your extra index URL: pip install --extra-index-url=https://VssSessionToken@pkgs.dev.azure.com/mycompany/_packaging/MyFeed/pypi/simple/
Yes. It prints
VssSessionTokenand the token.I’d love for this to be fixed too, but it’s not entirely clear what we need to change.
Perhaps we need to be requesting
https://pkgs.dev.azure.com/mycompany/_packaging/MyFeed/pypi/simplespecifically? I believe this was discussed some at https://github.com/astral-sh/uv/issues/4056Every keyring plugin works differently and it is difficult to give them all what they want. Some clarity on the exact requirements of the Azure plugin would help move this issue forward.
Sorry about the trouble and thanks for the additional debugging info. It looks like the keyring did not respond with credentials:
Perhaps their plugin only works with the username omitted / via the
get_credsAPI that we do not support?Thanks @jaraco
Looks like a typo in keyring @jaraco
AttributeError: 'CommandLineTool' object has no attribute '_get_creds'. Did you mean: '_get_cred'?Thanks!
So this difference here is that
pipis able to usekeyring’s Python API which allows retrieval of both a username and password. We can’t use that, we’re limited to the CLI API which only allows retrieval of a password for a given username. Since your URL does not include a username, we skip the keyring lookup:If you add a username to your index URL, we’ll look up the credentials as you’d expect.