You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
poetry 1.1.4 locks all packages to be pulled from secondary repo #3306
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
OS version and name: macOS 10.14
Poetry version: 1.1.4
Issue
Hi,
I'm experiencing this behavior on 1.1.4. In pyproject.toml I have configured a secondary repo:
[[tool.poetry.source]]
name = "xxx"url = "https://PRIVATE"secondary = true
As such, I expect that poetry will fetch most packages from the main PyPI. And 1.1.3 indeed does that. However, 1.1.4 adds this configuration to every package (non-private as well) in poetry.lock:
[[package]]
name = "alabaster"version = "0.7.12"description = "A configurable sidebar-enabled Sphinx theme"category = "main"optional = truepython-versions = "*"
[package.source]
type = "legacy"url = "https://PRIVATE"reference = "xxx"
IMO this is unexpected behavior. I did git bisect and found out that this bug was introduced in 74fc8eb, in an attempt to fix other pypi-related issues.
Reacted by Daniel Salfran, Ben Avrahami, Erich Blume, psteegstra, Jakub Lański, haenry, Lê Cao Nguyên, Tom Rochette, Aviram Hassan, Max Fröhlich and 9 more
# Always put PyPI last to prefer private repositories# but only if we have no other default sourceifnotpoetry.pool.has_default():
has_sources=bool(sources)
poetry.pool.add_repository(PyPiRepository(), nothas_sources, has_sources)
else:
ifio.is_debug():
io.write_line("Deactivating the PyPI repository")
It seems there's missing logic about secondary repos here, sth like if not poetry.pool.has_primary() would be needed (just a concept, there's no such a function as for now).
Reacted by Ben Avrahami, Dan Robinson, omerhazan, Xavier Francisco, Will Frey, psteegstra, Alex Joz, yebinama, Alberto Garza, Nawfal Tachfine and 4 more
Also experiencing the same issue. I have fixed it on my own and was going to open a pull request but it seems it was already done :)
A quick workaround is to redefine the Pypi repository but it's kind of ugly as it add an entry "package.source" in the lock file for every package coming from Pypi.
Activity
jaklan commentedon Nov 5, 2020
It seems there's missing logic about secondary repos here, sth like
if not poetry.pool.has_primary()would be needed (just a concept, there's no such a function as for now).aviramha commentedon Nov 10, 2020
Also affected by this.
yebinama commentedon Nov 24, 2020
Also experiencing the same issue. I have fixed it on my own and was going to open a pull request but it seems it was already done :)
A quick workaround is to redefine the Pypi repository but it's kind of ugly as it add an entry "package.source" in the lock file for every package coming from Pypi.
sinoroc commentedon Nov 24, 2020
@maksbotan @jaklan @aviramha @yebinama
@tomzx contributed a possible fix here: #3406
Would you mind testing it if you get a chance?
mxab commentedon Mar 4, 2021
I tried it with 1.1.5 but my lock ran for more than 5 minutes. I guess this is not yet resolved
dwyatte commentedon Apr 7, 2021
@sinoroc I can confirm that this is still affecting poetry 1.1.5. Here's a simple
pyproject.tomlthat uses https://mirrors.aliyun.com/pypi/simple/ as a secondary index:And the resulting
poetry.lock:alabastershould be pulled from pypi.org since I've marked https://mirrors.aliyun.com/pypi/simple/ as secondary.progmatic-99 commentedon Dec 30, 2021
Is there any workaround for this??
jaklan commentedon Dec 30, 2021
@progmatic-99 update Poetry as it's already fixed for months?
progmatic-99 commentedon Dec 30, 2021
Sorry, noob mistake @jaklan
github-actions commentedon 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.