Skip to content

Commit

Permalink
fix: ensure verify setup in pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderGrooff committed Jul 8, 2023
1 parent 7a0480d commit 571d46f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ repos:
hooks:
- id: isort
name: isort (python)
- repo: local
hooks:
- id: verify-setup
name: verify versions in setup
entry: scripts/verify_setup.sh
language: script
2 changes: 1 addition & 1 deletion scripts/verify_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
# Verify versions matches the git tag
SETUP_VERSION=$(grep -oP '(?<=version=")[^"]+' setup.py)
PKGBUILD_VERSION=$(grep -oP '(?<=pkgver=)[^ ]+' PKGBUILD)
PYPROJECT_VERSION=$(grep -oP '(?<=version = )[^ ]+' pyproject.toml)
PYPROJECT_VERSION=$(grep -oP '(?<=version = ")[^"]+' pyproject.toml)
GIT_TAG=$(git describe --tags --abbrev=0)
test "$SETUP_VERSION" == "$GIT_TAG" || (echo "setup.py is version ${SETUP_VERSION} but should be ${GIT_TAG}" && exit 1)
test "$PKGBUILD_VERSION" == "$GIT_TAG" || (echo "PKGBUILD is version ${PKGBUILD_VERSION} but should be ${GIT_TAG}" && exit 1)
Expand Down

0 comments on commit 571d46f

Please sign in to comment.