Skip to content

Commit 571d46f

Browse files
fix: ensure verify setup in pre-commit
1 parent 7a0480d commit 571d46f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ repos:
2727
hooks:
2828
- id: isort
2929
name: isort (python)
30+
- repo: local
31+
hooks:
32+
- id: verify-setup
33+
name: verify versions in setup
34+
entry: scripts/verify_setup.sh
35+
language: script

scripts/verify_setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e
66
# Verify versions matches the git tag
77
SETUP_VERSION=$(grep -oP '(?<=version=")[^"]+' setup.py)
88
PKGBUILD_VERSION=$(grep -oP '(?<=pkgver=)[^ ]+' PKGBUILD)
9-
PYPROJECT_VERSION=$(grep -oP '(?<=version = )[^ ]+' pyproject.toml)
9+
PYPROJECT_VERSION=$(grep -oP '(?<=version = ")[^"]+' pyproject.toml)
1010
GIT_TAG=$(git describe --tags --abbrev=0)
1111
test "$SETUP_VERSION" == "$GIT_TAG" || (echo "setup.py is version ${SETUP_VERSION} but should be ${GIT_TAG}" && exit 1)
1212
test "$PKGBUILD_VERSION" == "$GIT_TAG" || (echo "PKGBUILD is version ${PKGBUILD_VERSION} but should be ${GIT_TAG}" && exit 1)

0 commit comments

Comments
 (0)