Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added poetry-build pre-commit-hook #6821

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@
pass_filenames: false
files: ^poetry.lock$
args: ["-f", "requirements.txt", "-o", "requirements.txt"]

- id: poetry-build
name: poetry-build
description: run poetry build build the source and wheels archive
entry: poetry build
language: python
language_version: python3
pass_filenames: false
4 changes: 4 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,10 @@ When `--only` is specified, `--with` and `--without` options are ignored.

The `build` command builds the source and wheels archives.

{{% note %}}
This command is also available as a pre-commit hook. See [pre-commit hooks]({{< relref "pre-commit-hooks#poetry-build">}}) for more information.
{{% /note %}}

```bash
poetry build
```
Expand Down
11 changes: 11 additions & 0 deletions docs/pre-commit-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ The hook takes the same arguments as the poetry command.
For more information see the [lock command]({{< relref "cli#lock" >}}).


## poetry-build

The `poetry-build` hook calls the `poetry build` command
To build the source and wheels archives.

### Arguments

The hook takes the same arguments as the poetry command.
For more information see the [build command]({{< relref "cli#build" >}}).


## poetry-export

The `poetry-export` hook calls the `poetry export` command
Expand Down