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-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# poetry run

> Execute a command in the Poetry virtual environment.
> More information: <https://python-poetry.org/docs/cli/#run>.

- Run a Python script in the virtual environment:

`poetry run python {{script.py}}`
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 run python {{script.py}}`
`poetry run python {{path/to/script.py}}`


- Run a command in the virtual environment:

`poetry run {{command}}`

- Run pytest in the virtual environment:

`poetry run pytest`

- Run a Python module as a script:

`poetry run python -m {{module_name}}`

- Run a custom script defined in `pyproject.toml`:

`poetry run {{script_name}}`

- Display help:

`poetry run --help`