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.

poetry not respecting index-url in pip.conf

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:OSX 10.15.1

  • Poetry version: 1.0.0b0

Issue

we have a pip.conf file like the following:

[global]
timeout = 20
index-url = https://pypi.fbn.org/simple

if you run pip install numpy, you’re restricted to the versions on our server as expected:

Looking in indexes: https://pypi.fbn.org/simple
Collecting numpy
  Downloading https://repo-fbn-org.s3.amazonaws.com/pypi/2a3e/numpy/numpy-1.16.5....

running the same command from poetry:

poetry add numpy
Using version ^1.17.3 for numpy

so its going out to pypi.org instead of our repo.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

24reactions
sdispatercommented, Nov 12, 2019

@thehesiod The fact that Poetry is using pip internally is an implementation detail and, as such, it only understands its own configuration files. So it’s unlikely that Poetry will ever use the pip.conf file.

18reactions
jhbuhrmancommented, Apr 5, 2020

@thehesiod The fact that Poetry is using pip internally is an implementation detail and, as such, it only understands its own configuration files. So it’s unlikely that Poetry will ever use the pip.conf file.

@sdispater The problem is that in using pip, poetry implicitly does make use of the pip config (for example during poetry install, IIRC), but during poetry add, it does not. This on itself seems inconsistent to me… (this is all from memory, I checked it a few months ago)

In order to get rid of that inconsistency, and you still want to (or have to) use pip, I think you should instruct pip to fully ignore whatever config is present and let it get its config provided by poetry (if that is possible at all).

But then it becomes even more important that a user can configure poetry on per-user basis and/or system-wide for the nexus-like index url and trusted host setting, ref. https://github.com/python-poetry/poetry/issues/1632 and https://github.com/python-poetry/poetry/issues/1070.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Repositories | Documentation | Poetry - Python dependency ...
Repositories Poetry supports the use of PyPI and private repositories for discovery ... This is not the same configuration used when publishing a...
Read more >
Poetry: changing to private pypi repository on the command line
This is not changed with poetry config repositories.private "$PIP_EXTRA_INDEX_URL" . How should we change this then? python-poetry.
Read more >
Adding a global config to specify package indexes
I'd like to propose introducing a standardized config for users to specify package indexes. Right now, each tool must have its own config, ......
Read more >
PyPI packages in the Package Registry - GitLab Docs
--index-url tells the client to check for the package at the provided URL only. If you're following the guide and want to install...
Read more >
Why you should use Poetry instead of Pip or Conda for Python ...
This is something that Poetry can do but Pip cannot. In Poetry, we could specify the following configuration in the pyproject.toml file to...
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