From ea9a184e6ad5fa64ed8f66fb598d552730cc9a7a Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Sun, 28 May 2023 17:31:10 -0500 Subject: [PATCH] chore: try adding back pre-commit --- .pre-commit-config.yaml | 8 +++++++- scripts/bump-dev.sh | 5 +++++ src/viv/viv.py | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100755 scripts/bump-dev.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f1aa0e..9ad90db 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,4 +11,10 @@ repos: hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] - + - repo: local + hooks: + - id: set-version + language: script + name: sets __version__ in viv.py + entry: ./scripts/bump-dev.sh + files: viv.py$ diff --git a/scripts/bump-dev.sh b/scripts/bump-dev.sh new file mode 100755 index 0000000..fea0dac --- /dev/null +++ b/scripts/bump-dev.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +TAG=$(git describe --tags --always --dirty=-dev --exclude 'latest') +VERSION="${TAG#v}" +sed -i "s/__version__ = \".*\"/__version__ = \"$VERSION\"/g" src/viv/viv.py +git add src/viv/viv.py diff --git a/src/viv/viv.py b/src/viv/viv.py index 4e44054..c392257 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -52,7 +52,7 @@ from typing import ( from urllib.error import HTTPError from urllib.request import urlopen -__version__ = "23.5a1-dev" +__version__ = "23.5a1-16-g445a523-dev" class Config: