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

Adding new source should set explicit flag by default #9908

Open
ggolda opened this issue Dec 18, 2024 · 0 comments
Open

Adding new source should set explicit flag by default #9908

ggolda opened this issue Dec 18, 2024 · 0 comments
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@ggolda
Copy link

ggolda commented Dec 18, 2024

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

@ggolda ggolda added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant