-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Unable to install packages from Azure DevOps private repo, 401 unauthorized #3344
Comments
I am having the same issue |
using pip with the |
It looks related to #3216 to me, but all the workarounds mentioned in the thread do not work for me |
It worked by configuring poetry with Looks like poetry is not using |
Opened up a PR. Another work-around is calling poetry config with the creds from the keyring. Make sure you have artifacts-keyring installed and run: #!/usr/bin/env python3
import toml
from keyring import get_credential
import subprocess
with open("pyproject.toml", "r") as pyproject_file:
project = toml.load(pyproject_file)
for source in project["tool"]["poetry"]["source"]:
name, url = source.get("name"), source.get("url")
if name and url:
creds = get_credential(url, None)
if creds:
print(f"Setting poetry auth config '{name}'")
subprocess.run(
[
"poetry",
"config",
"http-basic." + name,
creds.username,
creds.password,
]
)
else:
print(f"Could not find creds for '{name}'") |
I created a new PR that could solve this issue, it doesn't any new caching since the Authenticator does that already. Plus I want to mention a different potential workaround: creating a keyring poetry bridge keyring implementation. A new keyring backend that detects poetry lookups and then retrieves the repo url and do a recursive pip style keyring lookup based on the full url and netloc. I have not created that, so I can't say with complete confidence it will work because I don't know recursive keyring lookups are supported or not. I should probably mention the |
Is there a proper workaround or fix for this? This is closed but I still have this issue, how did people fix this? I have configured using |
I have colleages run the script on https://pypi.org/project/keyring-subprocess/, which is my library. Which installs Pipx and then then installs keyring-subprocess in a way that it is available for all Pipx venvs. As if you ran Installing PS. you might want to read the new section of the Pip documentation on authentication, curtosy of your's truely. (It applies to Pip 23.1 and above.) The username portion of the URL should be |
I tried this artifacts-keyring script above, but it ask for interactive session i.e. open a browser, does anyone know how to configure it in automation/azure devops pipelines? |
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am trying to install from an Azure DevOps Artifacts Python feed. I can publish to the feed if I use the following:
Which I set up by doing:
So then my
poetry.toml
has:My
pyproject.toml
has this section added to it.Now, when ever I attempt to do anything with a package, I get 401 unauthorized errors. I had issues before with publishing to the feed when configuring the
http-basic.azure
before.What do I need to do to make the
add
orinstall
portion work now?My
pyproject.toml
Poetry Version
The text was updated successfully, but these errors were encountered: