Specifying your dependencies with Poetry¶
Declaring your project metadata¶
Poetry is a PEP 517-compliant build backend, which means that
it can generate your project
using a standardized interface that can be consumed directly by pip.
To do that, first make sure that
build-system section of your
declares the build backend as follows:
[build-system] requires = ["poetry_core>=1.0.0"] build-backend = "poetry.core.masonry.api"
Then, you will be able to install it on Read the Docs just using pip, with a configuration like this:
version: 2 build: os: ubuntu-20.04 tools: python: "3.9" python: install: - method: pip path: .
Locking your dependencies¶
pyproject.toml file you are free to specify the dependency
that are most appropriate for your project,
either by leaving them unpinned or setting some constraints.
However, to achieve Reproducible Builds
it is better that you lock your dependencies,
so that the decision to upgrade any of them is yours.
Poetry does this using
that contain the exact versions of all your transitive dependencies
(that is, all the dependencies of your dependencies).
The first time you run
poetry install in your project directory
Poetry will generate a new poetry.lock
with the versions available at that moment.
You can then commit your poetry.lock to version
so that Read the Docs also uses these exact dependencies.