Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions pages/common/poetry-init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# poetry init

> Create a basic `pyproject.toml` file interactively.
> More information: <https://python-poetry.org/docs/cli/#init>.

- Create a `pyproject.toml` file interactively:

`poetry init`

- Create a `pyproject.toml` file with prefilled values:

`poetry init --name {{package_name}} --author {{"Author Name <email@example.com>"}}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`poetry init --name {{package_name}} --author {{"Author Name <email@example.com>"}}`
`poetry init --name {{package_name}} --author "{{Author Name <email@example.com>}}"`

https://github.com/tldr-pages/tldr/blob/main/contributing-guides/style-guide.md#placeholder-syntax


- Create a `pyproject.toml` file without interaction (use defaults):

`poetry init --no-interaction`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`poetry init --no-interaction`
`poetry init {{[-n|--no-interaction]}}`

https://python-poetry.org/docs/cli/#global-options


- Create a `pyproject.toml` file and add a dependency:

`poetry init --dependency {{package_name}}`

- Create a `pyproject.toml` file and add a development dependency:

`poetry init --dev-dependency {{package_name}}`

- Display help:

`poetry init --help`