From 71cc4729b67f09128804c4be8b3c806628782bcc Mon Sep 17 00:00:00 2001 From: Mikita Sakalouski <38785549+mikita-sakalouski@users.noreply.github.com> Date: Tue, 1 Oct 2024 23:50:58 +0200 Subject: [PATCH 1/3] feat: add pre-commit hook for Hatch project manager --- .pre-commit-hooks.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 000000000..969320ce1 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,7 @@ +- id: hatch + name: hatch + description: "Hatch: Hatch is a modern, extensible Python project manager." + entry: hatch + language: python + minimum_pre_commit_version: 2.9.2 + require_serial: true \ No newline at end of file From 2791aa1672861c42fcc388872aa2243406fd7a0c Mon Sep 17 00:00:00 2001 From: Mikita Sakalouski <38785549+mikita-sakalouski@users.noreply.github.com> Date: Wed, 2 Oct 2024 00:47:40 +0200 Subject: [PATCH 2/3] feat: add new pre-commit hooks for managing Hatch project requirements --- .pre-commit-hooks.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 969320ce1..ae5ffb92e 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -4,4 +4,25 @@ entry: hatch language: python minimum_pre_commit_version: 2.9.2 + require_serial: true +- id: hatch-requirements-project-only + name: hatch-requirements-project-only + description: "Hatch: Write project requirements to requirements.txt" + entry: "sh -c 'hatch dep show requirements > requirements.txt'" + language: python + minimum_pre_commit_version: 2.9.2 + require_serial: true +- id: hatch-requirements-env-only + name: hatch-requirements-env-only + description: "Hatch: Write project requirements to requirements.txt" + entry: "sh -c 'hatch dep show requirements > requirements.txt'" + language: python + minimum_pre_commit_version: 2.9.2 + require_serial: true +- id: hatch-requirements-all + name: hatch-requirements-all + description: "Hatch: Write project requirements to requirements.txt" + entry: "sh -c 'hatch dep show requirements > requirements.txt'" + language: python + minimum_pre_commit_version: 2.9.2 require_serial: true \ No newline at end of file From ec70e4e7c705a30c4952a99744efdf2e546a4f92 Mon Sep 17 00:00:00 2001 From: Mikita Sakalouski <38785549+mikita-sakalouski@users.noreply.github.com> Date: Wed, 2 Oct 2024 00:57:27 +0200 Subject: [PATCH 3/3] feat: update pre-commit hooks to specify requirement types for Hatch --- .pre-commit-hooks.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index ae5ffb92e..1d4f04fe8 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -7,22 +7,22 @@ require_serial: true - id: hatch-requirements-project-only name: hatch-requirements-project-only - description: "Hatch: Write project requirements to requirements.txt" - entry: "sh -c 'hatch dep show requirements > requirements.txt'" + description: "Hatch: Write project only requirements to requirements.txt" + entry: "sh -c 'hatch dep show requirements --project-only > requirements.txt'" language: python minimum_pre_commit_version: 2.9.2 require_serial: true - id: hatch-requirements-env-only name: hatch-requirements-env-only - description: "Hatch: Write project requirements to requirements.txt" - entry: "sh -c 'hatch dep show requirements > requirements.txt'" + description: "Hatch: Write env only requirements to requirements.txt" + entry: "sh -c 'hatch dep show requirements --env-only > requirements.txt'" language: python minimum_pre_commit_version: 2.9.2 require_serial: true - id: hatch-requirements-all name: hatch-requirements-all - description: "Hatch: Write project requirements to requirements.txt" - entry: "sh -c 'hatch dep show requirements > requirements.txt'" + description: "Hatch: Write all requirements to requirements.txt" + entry: "sh -c 'hatch dep show requirements --all > requirements.txt'" language: python minimum_pre_commit_version: 2.9.2 require_serial: true \ No newline at end of file