2020-02-03 16:46:41 +00:00
|
|
|
# poetry
|
|
|
|
|
|
|
|
> Manage Python packages and dependencies.
|
2022-10-17 16:44:48 +01:00
|
|
|
> More information: <https://python-poetry.org/docs/cli/>.
|
2020-02-03 16:46:41 +00:00
|
|
|
|
|
|
|
- Create a new Poetry project in the directory with a specific name:
|
|
|
|
|
|
|
|
`poetry new {{project_name}}`
|
|
|
|
|
|
|
|
- Install a dependency and its subdependencies:
|
|
|
|
|
|
|
|
`poetry add {{dependency}}`
|
|
|
|
|
2021-11-30 14:12:11 +00:00
|
|
|
- Install a development dependency and its subdependencies:
|
|
|
|
|
2022-11-22 11:13:19 +00:00
|
|
|
`poetry add --group dev {{dependency}}`
|
2021-11-30 14:12:11 +00:00
|
|
|
|
2020-02-03 16:46:41 +00:00
|
|
|
- Interactively initialize the current directory as a new Poetry project:
|
|
|
|
|
|
|
|
`poetry init`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Get the latest version of all dependencies and update `poetry.lock`:
|
2020-02-03 16:46:41 +00:00
|
|
|
|
|
|
|
`poetry update`
|
|
|
|
|
|
|
|
- Execute a command inside the project's virtual environment:
|
|
|
|
|
|
|
|
`poetry run {{command}}`
|
2022-10-17 16:44:48 +01:00
|
|
|
|
|
|
|
- Bump the minor version of the project in `pyproject.toml`:
|
|
|
|
|
|
|
|
`poetry version minor`
|