Skip to content
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

PDM repeatedly queries the keyring for each configured repo when username/password not defined #3368

Closed
1 task
ad1217 opened this issue Jan 2, 2025 · 1 comment · Fixed by #3374
Closed
1 task
Labels
🐛 bug Something isn't working

Comments

@ad1217
Copy link

ad1217 commented Jan 2, 2025

Describe the bug

I am running a keyring backend that prints to stderr when a password is not found (keyring_pass, specifically). When I do an operation that involves package repositories like update or install, I get a lot of messages about the keyring entries not existing. In a project I'm working on, I get ~24 such messages on pdm install, and ~244 on pdm update --outdated.

It seems to me that PDM should request these once, then cache the results for the rest of the operation. These extra queries have a presumably minor performance cost, and in my (admittedly probably uncommon) case disrupt the legibility of pdm's output.

I believe this is caused by 7304f8c, but have not verified that.

To reproduce

  1. Use a keyring provider that logs failed lookups
  2. Don't define a username/password for PyPi
  3. Run pdm install

Expected Behavior

A single keyring lookup per source repository without a username or password.

Environment Information

Error: keyring/pdm-pypi-pypi is not in the password store.
Error: keyring/pdm-pypi-pypi/__token__ is not in the password store.
Error: keyring/pdm-pypi-pypi is not in the password store.
Error: keyring/pdm-pypi-pypi/__token__ is not in the password store.
PDM version:
  2.22.1
Python Interpreter:
  /home/adam/scratch/temp/.venv/bin/python (3.13)
Project Root:
  /home/adam/scratch/temp
Local Packages:

Error: keyring/pdm-pypi-pypi is not in the password store.
Error: keyring/pdm-pypi-pypi/__token__ is not in the password store.
Error: keyring/pdm-pypi-pypi is not in the password store.
Error: keyring/pdm-pypi-pypi/__token__ is not in the password store.
{
  "implementation_name": "cpython",
  "implementation_version": "3.13.1",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "6.12.7-zen1-1-zen",
  "platform_system": "Linux",
  "platform_version": "#1 ZEN SMP PREEMPT_DYNAMIC Fri, 27 Dec 2024 14:24:32 +0000",
  "python_full_version": "3.13.1",
  "platform_python_implementation": "CPython",
  "python_version": "3.13",
  "sys_platform": "linux"
}

Verbose Command Output

No response

Additional Context

No response

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.
@ad1217 ad1217 added the 🐛 bug Something isn't working label Jan 2, 2025
@frostming frostming linked a pull request Jan 10, 2025 that will close this issue
2 tasks
@ad1217
Copy link
Author

ad1217 commented Jan 10, 2025

Two in the project I referenced for the message count, but just PyPi in most projects. I still get quite a lot of messages in projects with just PyPi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant