question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jaklancommented, Oct 22, 2020

@abn here it is: #3269.

0reactions
jaklancommented, Nov 5, 2020

There is a regression in 1.1.4 caused by the above fix: https://github.com/python-poetry/poetry/issues/3306

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip: prioritize a private pypi server - python - Stack Overflow
This cannot be achieved. pip devs have stated that all package indexes always have equal priority, and that this will not change.
Read more >
Repositories | Documentation | Poetry - Python dependency ...
If you do not want any of the custom sources to take precedence over PyPI, you must declare all package sources to be...
Read more >
Configure and customize pip - ONAP Wiki
I try to run to install a package from the staging repo, but it fails. But I do find vnfsdk on that repo....
Read more >
Using the .condarc conda configuration file
The precedence by which the conda configuration is built out is shown below. Each new arrow takes precedence over the ones before it....
Read more >
mkdocs-multirepo-plugin - PyPI
Build documentation in multiple repos into one site. ... pip install mkdocs-multirepo-plugin ... nav takes precedence over repos (see below).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found