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

Private repos don't actually take precedence #1677

Closed
1 task done
marcelmindemann opened this issue Dec 5, 2019 · 5 comments
Closed
1 task done

Private repos don't actually take precedence #1677

marcelmindemann opened this issue Dec 5, 2019 · 5 comments
Labels
area/docs Documentation issues/improvements

Comments

@marcelmindemann
Copy link

marcelmindemann commented Dec 5, 2019

  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

I am using poetry 1.0.0b8. According to the latest documentation (https://github.com/sdispater/poetry/blob/master/docs/docs/repositories.md), if I have a project with a custom source in my pyproject.toml, it will always take precedence when installing packages.

This is not the case: We have a custom python package in our company JFrog that we named pyvault. By chance, there is a package in PyPI with the same name. In any project where we have our internal JFrog as a source, poetry add pyvault still adds the pyvault from PyPI. We can change that by specifying pyvault = { version = "^1.0", source = "jfrog" } in the pyroject.toml, so there is a work around, but the documentation is wrong.

@marcelmindemann marcelmindemann added the area/docs Documentation issues/improvements label Dec 5, 2019
@pappasam
Copy link

pappasam commented Dec 7, 2019

I'm also curious to see whether, and how, this treatment of private package indexes has been intentionally changed. Maybe there's a more-elegant treatment of alternative sources that just needs better documentation 🤞

@adawalli
Copy link
Contributor

I also noticed this behavior when using artifactory. My work around is to use artifactory virtual repository, and then add
default=true
to the TOML entry for the repo, but its not ideal

@Imaclean74
Copy link
Contributor

I was also surprised by this new behavior. Previously raised this issue : #1658
setting default=true does the trick but it's not obvious this is required

@levrik
Copy link

levrik commented Mar 21, 2020

A comment here states that the PyPi repo is always added as last so private repos are preferred.
https://github.com/python-poetry/poetry/blob/master/poetry/factory.py#L185-L188
But it's added as the default repo which seems to always be put in the first place here:
https://github.com/python-poetry/poetry/blob/master/poetry/repositories/pool.py#L53

Looks like a bug to me.

linw1995 added a commit to linw1995/poetry that referenced this issue Jul 16, 2020
abn added a commit to abn/poetry that referenced this issue Oct 19, 2020
When a project specifies non default sources, PyPI gets added as the
default source. This will prioritise packages available in PyPI when
the package exists in both index. This change ensures that PyPI is
only used as a default when no other sources are provided.

Resolves: python-poetry#1677 python-poetry#2564 python-poetry#3238
abn added a commit to abn/poetry that referenced this issue Oct 19, 2020
When a project specifies non default sources, PyPI gets added as the
default source. This will prioritise packages available in PyPI when
the package exists in both index. This change ensures that PyPI is
only used as a default when no other sources are provided.

Resolves: python-poetry#1677 python-poetry#2564 python-poetry#3238
abn added a commit to abn/poetry that referenced this issue Oct 19, 2020
When a project specifies non default sources, PyPI gets added as the
default source. This will prioritise packages available in PyPI when
the package exists in both index. This change ensures that PyPI is
only used as a default when no other sources are provided.

Resolves: python-poetry#1677 python-poetry#2564 python-poetry#3238
abn added a commit to abn/poetry that referenced this issue Oct 23, 2020
When a project specifies non default sources, PyPI gets added as the
default source. This will prioritise packages available in PyPI when
the package exists in both index. This change ensures that PyPI is
only used as a default when no other sources are provided.

Resolves: python-poetry#1677 python-poetry#2564 python-poetry#3238
@abn abn closed this as completed in 3067fd4 Oct 23, 2020
Copy link

github-actions bot commented Mar 2, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Documentation issues/improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants