-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Question
It looks like uv having major issues with uv auth
and credentials
providing when installing packages from private registries like Gitlab.
No such problem on other platforms like Linux, but on Windows it's hell - you literally don't understand why uv doesn't supply credentials from anywhere.
- setx (export alternative for windows called)
- Windows Environment Variables
- uv auth
Maybe my actions is incorrect? But the -vv argument doesn't give any information about what credentials
uv
can/can't find or where it's trying to find them.
Here's what I'm trying to do:
pyproject.toml
[tool.uv.sources]
package = { index = "GITLAB" }
[[tool.uv.index]]
name = "GITLAB"
url = "https://gitlab.test.ru/api/v4/groups/58/-/packages/pypi/simple"
explicit = true
authenticate = "always"
I'm describing where the package need to be installed from. It's a private gitlab registry.
I generate the token https://gitlab.test.ru/
and proceed further:
cli (uv auth)
uv auth login https://gitlab.test.ru/
username: InsaneLuv
password: *TOKEN*
According to the documentation, this is what I had to do to authenticate.
But i got:
package not found in the package registry
`-> Because package was not found in the package registry and your project depends on package==0.1.1, we can conclude that your project's requirements are unsatisfiable.
hint: An index URL (https://gitlab.test.ru/api/v4/groups/58/-/packages/pypi/simple) could not be queried due to a lack of valid authentication credentials (401 Unauthorized).
Okay, maybe this method isn't suitable, I'll try another one from the documentation, passing only the token like:
uv auth login example.com --token
Same error.
setx
AND Windows Environment Variables
with UV_INDEX_GITLAB_USERNAME
and UV_INDEX_GITLAB_PASSWORD
don't give any effect either.
Then my most important question is:
TRACE Caching credentials for https://gitlab.test.ru/api/v4/groups/58/-/packages/pypi
TRACE Caching credentials for https://gitlab.test.ru/api/v4/groups/58/-/packages/pypi/simple
TRACE Read credentials for index GITLAB
TRACE Caching credentials for https://gitlab.test.ru/api/v4/groups/58/-/packages/pypi
TRACE Caching credentials for https://gitlab.test.ru/api/v4/groups/58/-/packages/pypi/simple
DEBUG Using request timeout of 30s
DEBUG Ignoring existing lockfile due to `--upgrade`
DEBUG Found static `pyproject.toml` for: app @ file:///C:/Users/luv/PycharmProjects/w-docrobot
DEBUG No workspace root found, using project root
TRACE Caching credentials for https://gitlab.test.ru/api/v4/groups/58/-/packages/pypi/simple
TRACE Caching credentials for https://gitlab.test.ru/api/v4/groups/58/-/packages/pypi/simple
Where is UV
trying to get credentials from?
What am I doing wrong?
Platform
Windows 11 IoT Enterprise LTSC 24H2 26100.6584
Version
uv 0.9.2 (141369c 2025-10-10)