-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Custom repository doesn't have precedence over PyPI #3238
Comments
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
Can you please try the fix at #3251. Using pipxpipx install --suffix=@3251 'poetry @ git+https://github.com/python-poetry/poetry.git@refs/pull/3251/head' Using a container (podman | docker)podman run --rm -i --entrypoint bash python:3.8 <<EOF
set -xe
python -m pip install -q git+https://github.com/python-poetry/poetry.git@refs/pull/3251/head
install -d foobar
pushd foobar
cat > pyproject.toml <<TOML
[tool.poetry]
name = "foobar"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
[[tool.poetry.source]]
name = 'testpypi'
url = 'https://test.pypi.org/simple'
[tool.poetry.dependencies]
python = "^3.8"
py-serializer = "0.9.5"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
TOML
poetry lock
poetry export -f requirements.txt
EOF |
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
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
is this the same issue as #3249 ? |
@abn I've jus tested the PR. [package.source]
type = "legacy"
url = "http://repository.intranet.foobar.com/artifactory/api/pypi/pypi-virtual/simple"
reference = 'foobar' But... there's one more thing. I've also run: When using At first sight it seems okay, but we have to remember about the issue with pip and PS Of course there should be also |
@jaklan appreciate the input on that. I'd suggest we raise that as a new issue. I agree that a per package index is better for the extra-index case. One worry, however, is that people seem to be attached to the current export format because some do text processing of the output it for various reasons. |
@abn here it is: #3269. |
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
Resolved with |
There is a regression in |
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. |
-vvv
option).Issue
In docs we can read:
In the above example,
foobar
is a proxy repo incl. both internal packages and the public ones from PyPI. Runningpoetry install
should cause a creation ofpoetry.lock
, where all the packages havefoobar
in theirsource
field. However, it's completely opposite - none of the packages has asource
field, which means all of them are downloaded directly from PyPI.When I add
default = true
to the abovesource
element, which means PyPI is disabled, everything works properly - generatedpoetry.lock
includesfoobar
as asource
for all packages and installation doesn't break, so it's not a problem with repository itself.It's especially frustrating when you want to use
poetry export
(for any reason), because then the finalrequirements.txt
doesn't include neither--index-url
nor--extra-index-url
(it seems it depends on the actually used sources, not thepyproject.toml
content).The text was updated successfully, but these errors were encountered: