From 71454609575ca557e0a9ba63dffad3075cf491e3 Mon Sep 17 00:00:00 2001 From: Pablo <48098178+PabloRuizCuevas@users.noreply.github.com> Date: Mon, 17 Oct 2022 15:42:42 +0200 Subject: [PATCH 1/5] Added poetry-build pre-commit-hook --- .pre-commit-hooks.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index d2662b8a420..a8cf8c84de2 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -24,3 +24,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 From 3dbaea49039317c9baf6dca212802dca757783b5 Mon Sep 17 00:00:00 2001 From: Pablo <48098178+PabloRuizCuevas@users.noreply.github.com> Date: Mon, 17 Oct 2022 15:53:33 +0200 Subject: [PATCH 2/5] updated docs pre-commit build --- docs/pre-commit-hooks.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/pre-commit-hooks.md b/docs/pre-commit-hooks.md index 7fa16e8e896..0e4f657066f 100644 --- a/docs/pre-commit-hooks.md +++ b/docs/pre-commit-hooks.md @@ -46,6 +46,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 From 4ecc10df9477a801ce1db12ad96f0932e0e1377d Mon Sep 17 00:00:00 2001 From: Pablo <48098178+PabloRuizCuevas@users.noreply.github.com> Date: Mon, 17 Oct 2022 15:55:54 +0200 Subject: [PATCH 3/5] Added pre-commit hook build info to docs cli --- docs/cli.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/cli.md b/docs/cli.md index dee328483da..d47f082bff2 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -493,6 +493,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 ``` From 6fc10477c783df2b23d14c8200c145cdce14891a Mon Sep 17 00:00:00 2001 From: Pablo <48098178+PabloRuizCuevas@users.noreply.github.com> Date: Mon, 17 Oct 2022 17:31:38 +0200 Subject: [PATCH 4/5] trailing space From 35f5217487cdfbe9ebae7419e37809d77e882be8 Mon Sep 17 00:00:00 2001 From: Pablo <48098178+PabloRuizCuevas@users.noreply.github.com> Date: Tue, 18 Oct 2022 09:22:04 +0200 Subject: [PATCH 5/5] Update .pre-commit-hooks.yaml removed white space --- .pre-commit-hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index a8cf8c84de2..97633b87c00 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -24,7 +24,7 @@ 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