|
|
## Poetry
|
|
|
Dependencies are handled with [poetry](https://python-poetry.org/). The dependencies are specified in the `pyproject.toml` file and the specific versions are specified in the `poetry.lock` file.
|
|
|
|
|
|
## Install the dependencies
|
|
|
|
|
|
You can install the dependencies with the command `poetry install --no-root --no-dev`
|
|
|
|
|
|
(the effect of no-root is to not install the current package i.e. re2o)
|
|
|
|
|
|
If you want to also install the dev dependencies `poetry install --no-root`
|
|
|
|
|
|
If you want to install extra dependencies (mysql, postgresql, ldap) : `poetry install --no-root -E mysql` (replace mysql by postgresql or ldap if needed).
|
|
|
|
|
|
You can also, of course, use the `*-requirements.txt` files
|
|
|
|
|
|
## Update the dependencies
|
|
|
|
|
|
By default the dependencies that are used are the one pinned in the `poetry.lock` file. To update the dependencies (and the lock file), run `poetry update`.
|
|
|
|
|
|
## Add a dependency
|
|
|
|
|
|
To add a dependency, run the command
|
|
|
|
|
|
`poetry add <package>`
|
|
|
|
|
|
(this will also install the package in the env).
|
|
|
|
|
|
You can add the `--dev` or `-E <extra>` option to assign the dependency to either dev or an extra.
|
|
|
|
|
|
## Export to requirements files
|
|
|
```
|
|
|
poetry export > requirements.txt
|
|
|
poetry export --dev > dev-requirements.txt
|
|
|
poetry export -E mysql > mysql-requirements.txt
|
|
|
poetry export -E postgresql > postgresql-requirements.txt
|
|
|
poetry export -E ldap > ldap-requirements.txt
|
|
|
``` |