poetry not respecting index-url in pip.conf

Created on 8 Nov 2019  ·  9Comments  ·  Source: python-poetry/poetry

  • [x] I am on the latest Poetry version.
  • [x] 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:
```$ pip3 install numpy
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.
Bug

Most helpful comment

@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.

All 9 comments

Hello,

you have to tell poetry to use your private repo: See https://poetry.eustace.io/docs/repositories/

poetry can use our private repo, but it want it to ONLY pull from our private repo

poetry can use our private repo, but it want it to ONLY pull from our private repo

👍 – this is a common pattern for enterprises.

e.g. I do not have access to pypi.org, and requests to it hang indefinitley.

If you use the latest 1.0.0 prerelease, you can tell Poetry to only use a private index, see #908 and https://github.com/sdispater/poetry/blob/master/docs/docs/repositories.md#disabling-the-pypi-repository

ooo, will try!

seems to work, however I'm guessing it should still obey pip.conf long term no?

@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.

@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.

Agree that we would need a systemwide setting so we prevent some information to reside on our repositories...

Was this page helpful?
0 / 5 - 0 ratings