'Using poetry and pip to install dependencies with private repositories
Ahoi!
We are a small team and currently using poetry for developing our python packages. Since we do have a private artifactory we have the following pyproject.toml things set:
[[tool.poetry.source]]
name = "main-private-artifactory"
url = "https://xx.yy"
default = true
[[tool.poetry.source]]
name = "special-private-arti"
url = "https://xx.mm"
Which works well when using poetry. No outgoing calls and it finds the packages quite fine. just for completeness sake the special package is specified like this in the .toml file:
[tool.poetry.dependencies]
special-package = {version = "^1.0.0", source = "special-private-arti"}
Now since pip should support installing from a pyproject.toml I created a new venv and tried to install our packages dependencies by executing:
pip install . -vv
in the same directory where pyproject.toml resides. I have a few problems with that:
- When looking at the verbose output it shows pip is calling
https://pypi.org/simplewhich should be a BIG nono according to mypyproject.tomlfile. - It does not find the special package since it ignores my defined sources
Anyone have an approach I can try other than changing back to venv and requirements.txt?
Cheers, ~HFinch
Solution 1:[1]
I am actually fighting with the same issue. Have you already found a solution?
I found out that using the -i/--index-url of pip helps, when your private pypi server redirects also to pypi.org/simple.
So as workaround for me worked
pip install . -vv -i https://xx.mm
As a next step will check the poetry issues on gitlab.
Cheers Tom
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | tomtom |
