By default, Poetry is configured to use the PyPI repository, for package installation and publishing.
So, when you add dependencies to your project, Poetry will assume they are available on PyPI.
This represent most cases and will likely be enough for most users.
However, at times, you may need to keep your package private while still being able to share it with your teammates. In this case, you will need to use a private repository.
Adding a new repository is easy with the
poetry config repositories.foo https://foo.bar/simple/
This will set the url for repository
If you want to store your credentials for a specific repository, you can do so easily:
poetry config http-basic.foo username password
If you do not specify the password you will be prompted to write it.
To publish to PyPI, you can set your credentials for the repository
poetry config http-basic.pypi username password
You can also specify the username and password when using the
Now that you can publish to your private repository, you need to be able to install dependencies from it.
For that, you have to edit your
pyproject.toml file, like so
[[tool.poetry.source]] name = "foo" url = "https://foo.bar/simple/"
From now on, Poetry will also look for packages in your private repository.