I have a Python project that uses Poetry for dependency management.
I want to install a Python module from a private registry.
I know I can add it to the pyproject.toml file in a given source like this:
[[tool.poetry.source]]
name = "private-pipy-registry"
url = "https://my-private-pipy-registry"
but this registry url differs whether my project is run in review or production. I could add both review and production sources to the .toml file but this is not a suitable solution either.
I tried to use the poetry.config command line to add a private source.
This works when I want to publish this Python package to a private registry:
poetry config repositories.my-repo "https://my-url/my-pypi/simple"
peotry publish --repository my-repo --build -u my-username -p my-password
but does not work when I want to install a dependency from a private registry as I first described:
poetry config repositories.my-repo "https://my-url/my-pypi/simple"
poetry config http-basic.repo my-username my-password
poetry update
It returns: Because my-new-lib depends on my-private-lib (0.1.2) which doesn’t match any versions, version solving failed.
Do you know if I am missing something, if it is a known issue and if there is any solution? Thanks.
EDIT: I solved it by unsetting any repositories that were listed in poetry config --list, running poetry config repositories.my-repo --unset and resetting these repositories config