From 47d98ec51060c753daf3f4f037e9427465b9a7e1 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:12:46 +0100 Subject: [PATCH 1/6] DX: remove git commit message helper VS Code extension --- .vscode/extensions.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 7eaf302e..cacc4d62 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -14,7 +14,6 @@ "stkb.rewrap", "streetsidesoftware.code-spell-checker", "tamasfe.even-better-toml", - "trentrand.git-commit-helper-vscode", "yzhang.markdown-all-in-one" ], "unwantedRecommendations": [ From 762ffd730090ff0e3a657a9398a1b02c17b73ade Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:12:46 +0100 Subject: [PATCH 2/6] FIX: remove `packaging` from dependencies --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ef1ce377..46c82e39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,6 @@ requires = ["setuptools>=61.2"] [project] authors = [{name = "Common Partial Wave Analysis", email = "compwa-admin@ep1.rub.de"}] -dependencies = ["packaging"] description = "Python scripts used by the ComPWA/actions repository" dynamic = ["version"] license = {text = "License :: OSI Approved :: MIT License"} From 1fa980e6f3c37e0574543bc101c4b427f6f3ac5a Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:12:46 +0100 Subject: [PATCH 3/6] MAINT: update lock files --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da6fce97..0a06cdee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: check-useless-excludes - repo: https://github.com/ComPWA/policy - rev: 0.5.0 + rev: 0.5.3 hooks: - id: check-dev-files args: @@ -25,7 +25,7 @@ repos: - --update-lock-files=no - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.0 + rev: v0.7.1 hooks: - id: ruff args: [--fix] @@ -61,7 +61,7 @@ repos: - --in-place - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.15.1 + rev: v8.15.2 hooks: - id: cspell @@ -77,6 +77,6 @@ repos: )$ - repo: https://github.com/ComPWA/pyright-pre-commit - rev: v1.1.385 + rev: v1.1.386 hooks: - id: pyright From 54e4dc3901b4ec6bd759516346a551d3640d84ad Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:12:47 +0100 Subject: [PATCH 4/6] FIX: remove developer dependencies from extras --- .github/workflows/ci.yml | 2 +- .pre-commit-config.yaml | 2 +- CONTRIBUTING.md | 20 +++++++++++++++++++- pyproject.toml | 14 +++++--------- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1b164a9..79edf73a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,4 +31,4 @@ jobs: if: inputs.specific-pip-packages == '' secrets: token: ${{ secrets.PAT }} - uses: ComPWA/actions/.github/workflows/pre-commit.yml@v2 + uses: ComPWA/actions/.github/workflows/pre-commit.yml@v2.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0a06cdee..2223c758 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: check-useless-excludes - repo: https://github.com/ComPWA/policy - rev: 0.5.3 + rev: 0.5.4 hooks: - id: check-dev-files args: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e321da3e..1e9ddcc6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,8 +19,26 @@ uv sync source .venv/bin/activate ``` -Formatting and linting checks are automatically performed when committing changes. This is done with [pre-commit](https://pre-commit.com). To install the hooks in your local repository, run [`pre-commit install`](https://pre-commit.com/#3-install-the-git-hook-scripts) **once**: +Formatting and linting checks are automatically performed when committing changes. This is done with [pre-commit](https://pre-commit.com). To install the hooks in your local repository, run install `pre-commit` with `uv`: + +```shell +uv tool install pre-commit --with pre-commit-uv --force-reinstall +``` + +and [`pre-commit install`](https://pre-commit.com/#3-install-the-git-hook-scripts) **once**: ```shell pre-commit install --install-hooks ``` + +In addition, it may be handy to install `tox`: + +```shell +uv tool install tox --with tox-uv +``` + +If the repository provides a Tox configuration under [`pyproject.toml`](./pyproject.toml), you can see which jobs it defines with: + +```shell +tox list +``` diff --git a/pyproject.toml b/pyproject.toml index 46c82e39..a84d49d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,19 +10,13 @@ license = {text = "License :: OSI Approved :: MIT License"} name = "compwa-actions" requires-python = ">=3.12" -[project.optional-dependencies] -dev = [ - "compwa-actions[sty]", -] -sty = [ - "pre-commit-uv", - "ruff", -] - [project.readme] content-type = "text/markdown" file = "README.md" +[dependency-groups] +dev = ["ruff"] + [tool.setuptools] include-package-data = false license-files = ["LICENSE"] @@ -80,6 +74,8 @@ task-tags = ["cspell"] [tool.ruff.lint.isort] split-on-trailing-comma = false +[tool.ruff.lint.per-file-ignores] + [tool.ruff.lint.pydocstyle] convention = "google" From 911eb925148c22e929dbf4d4ec9e9a9ae0955bed Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:17:26 +0100 Subject: [PATCH 5/6] MAINT: remove redundant table --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a84d49d9..2f2d4112 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,8 +74,6 @@ task-tags = ["cspell"] [tool.ruff.lint.isort] split-on-trailing-comma = false -[tool.ruff.lint.per-file-ignores] - [tool.ruff.lint.pydocstyle] convention = "google" From 740f6c5b3c61d6f92c49bd150dbbe606c1c7ef1a Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:26:28 +0100 Subject: [PATCH 6/6] FIX: install `packaging` in `style` dependencies for `pyright` --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 2f2d4112..b2f46cb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ file = "README.md" [dependency-groups] dev = ["ruff"] +style = ["packaging"] [tool.setuptools] include-package-data = false