Custom repository doesn't have precedence over PyPI
See original GitHub issue- I am on the latest Poetry version.
- 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 Mojave 10.14.6
- Poetry version: 1.1.3
- Link of a Gist with the contents of your pyproject.toml file:
[[tool.poetry.source]]
name = 'foobar'
url = 'http://repository.intranet.foobar.com/artifactory/api/pypi/pypi-virtual/simple'
[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Issue
In docs we can read:
Any custom repository will have precedence over PyPI.
In the above example, foobar
is a proxy repo incl. both internal packages and the public ones from PyPI. Running poetry install
should cause a creation of poetry.lock
, where all the packages have foobar
in their source
field. However, it’s completely opposite - none of the packages has a source
field, which means all of them are downloaded directly from PyPI.
When I add default = true
to the above source
element, which means PyPI is disabled, everything works properly - generated poetry.lock
includes foobar
as a source
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 final requirements.txt
doesn’t include neither --index-url
nor --extra-index-url
(it seems it depends on the actually used sources, not the pyproject.toml
content).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (3 by maintainers)
@abn here it is: #3269.
There is a regression in
1.1.4
caused by the above fix: https://github.com/python-poetry/poetry/issues/3306