Skip to content

Calling default index packages when overrided by pypi.url config value #3668

@KacperGawdzinski

Description

@KacperGawdzinski

Describe the bug

Hello!
I'm using multiple package indexes along with PDM.
Since we can't use pyproject.toml for the configuration due to missing environment variable interpolation, we can't internally set the credentials as plain text and upload to git.

That's why I've followed an issue which led to multiple config indexes and tried it as it would solve our problems.

I've set two respositories with:
pdm config pypi.url for our package mirror
and
pdm config pypi.internal.url for internal packages
I've also added correspoding credentials to each of them.

I thought it should disable default pypi https://pypi.org/simple repository as I did override it's value but after inspecting outgoing http traffic from my machine I've noticed:

Image

The first two lines are indeed my pypi.url and pypi.internal.url but the call to https://pypi.org/simple was made anyway.

As I tested with pyproject.toml, if I was to set the package registries there, then the call to pypi default registry is not made. I'd like the pdm config to behave the same way.

To reproduce

set pdm config pypi.url
set pdm config pypi.internal.url
set their credentials

fetch any package, a call to https://pypi.org/simple is made

Expected Behavior

If pdm config pypi.url is set, the default pypi registry will not be used.
If there are no matching packages the command should fail.

Environment Information

PDM version:
2.26.1
Python Interpreter:
/Users/user/repos/project/.venv/bin/python (3.12)
Project Root:
/Users/user/repos/project
Local Packages:
/Users/user/repos/project/.venv/lib/python3.12/site-packages

{
"implementation_name": "cpython",
"implementation_version": "3.14.0",
"os_name": "posix",
"platform_machine": "arm64",
"platform_release": "25.0.0",
"platform_system": "Darwin",
"platform_version": "Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:26 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6041",
"python_full_version": "3.12.12",
"platform_python_implementation": "CPython",
"python_version": "3.12",
"sys_platform": "darwin"
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions