Skip to content

Adding new source should set explicit flag by default #9908

@ggolda

Description

@ggolda

Issue Kind

Change in current behaviour

Description

According to the documentation (Poetry Repositories Documentation) and current Poetry behavior, when a new source is added, it is automatically assigned a primary priority, causing PyPI to be ignored.

I believe this behavior is counterintuitive and should not be the default. In my opinion, it is error-prone and can lead to issues like the one my team encountered. We were using Poetry for the first time, and as a result, all of our dependencies were being loaded from an external mirror instead of PyPI.

I understand that it is our fault and such behavior is documented, but it is not what you would expect from a package manager. Usually at least in my experience with other languages and package managers (such as npm, composer, or even go get) by default they prioritize the main package repository and fallback to the supplementary if it is explicitly stated.

So in my opinion, a better alternative is to assign an explicit priority to added sources. Existing system is more than flexible enough to handle other requirements if such arise.

Impact

Improve user experience for users who do not read every section of documentation before starting to use the tool. Make it similar to average expectation of users coming from another languages.

Workarounds

This should be a default behavior in my opinion:

poetry source add --priority=explicit https://path/to/source

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliRelated to the command linearea/sourcesReleated to package sources/indexes/repositorieskind/featureFeature requests/implementationsstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions