-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP Git credentials in pyproject.toml
are ignored during sync
#7453
Comments
We intentionally do not store any credentials in plaintext files by default. You should be able to re-add them to the |
It's generally dangerous to commit credentials to your project, is there a reason that you need to do that? You might want to look into the Git credential store which we will use automatically if the credentials have been populated. Some similar notes on this exist in the Cargo documentation. |
@charliermarsh Re-adding the credentials to I'm fully aware of the security implications of plaintext secrets. In this case it is fine however, since the project is only used within the company and the credential is a Gitlab deploy token, not a personal account. I won't deny that there are better ways of handling this, but that's the way it is right now. uv's documentation explicitly states support for HTTP authentication, so I'd expect that to work with basic uv workflows without any big surprises:
|
If you're seeing the above trace after re-adding the credentials to |
Sorry for the confusion, let me clear this up: In my original post I just manually added it to After your response I tried adding them to both If you say that having it only in |
We have test coverage for this exact situation — I'm surprised this isn't working for you? Lines 5999 to 6030 in fe8880b
|
Does it work with |
I think that's different @zanieb -- that tests an index, but here the credentials are provided on the URL directly. |
Oh good point! We have test coverage for that too, but the test might be wrong #7463 |
Let's call it a bug for Git credentials then. I'll take a look. |
pyproject.toml
are ignored during sync
…7474) ## Summary When syncing a lockfile, we need to respect credentials defined in the `pyproject.toml`, even if they won't be used for resolution. Unfortunately, this includes credentials in `tool.uv.sources`, `tool.uv.dev-dependencies`, `project.dependencies`, and `project.optional-dependencies`. Closes #7453.
Thank you guys for addressing this so quickly! I'm running 0.4.11 now and everything works as expected. |
I'm currently evaluating uv for our Python teams. So far I'm very impressed with the overall snappiness (compared to Pipenv), thank you very much for the good work so far. Unfortunately I ran into an issue when dealing with private packages from our Gitlab.
I don't have knowledge about uv's internal workings, but my guess is that the authentication credentials aren't stored properly at some point and are then missing for successive operations.
First, I'm adding the dependency to the project:
As you can clearly see in the logs the credentials are present and the operation finishes successfully.
The package appears in
pyproject.toml
anduv.lock
; note that the stated credentials are missing:Now, let's simulate another developer checking the project out and installing the dependencies for the first time:
Looking back at
pyproject.toml
anduv.lock
that's an understandable response - theusername:password
tuple is nowhere to be seen, there simply aren't any credentials that uv could have included in the request.Interestingly, manually adding the credentials back into the URL in
uv.lock
makesuv sync
operate as expected, but after the next uv operation that modifies the lock file (e.g.uv lock --upgrade
) the credentials are lost again, so that's not even a valid workaround.The text was updated successfully, but these errors were encountered: