build: stop using finicky version setter

This commit is contained in:
Daylin Morgan 2023-05-28 17:21:11 -05:00
parent 900dcefff7
commit 08cf8ee7d1
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F
3 changed files with 2 additions and 24 deletions

View file

@ -1,10 +1,5 @@
# See https://pre-commit.com for more information # See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks # See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types:
- pre-commit
- post-commit
default_stages:
- commit
repos: repos:
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 23.3.0 rev: 23.3.0
@ -16,11 +11,4 @@ repos:
hooks: hooks:
- id: ruff - id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes] 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
stages: [post-commit]
always_run: true

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
TAG=$(git describe --tags --always --dirty=-dev)
VERSION="${TAG#v}"
if [ "$NO_VERIFY" ]; then
echo 'post-commit hook skipped' 1>&2
exit 0
fi
if [[ "$(git diff --name-only HEAD HEAD~1)" == *"src/viv/viv.py"* ]]; then
sed -i "s/__version__ = \".*\"/__version__ = \"$VERSION\"/g" src/viv/viv.py
fi

View file

@ -52,7 +52,7 @@ from typing import (
from urllib.error import HTTPError from urllib.error import HTTPError
from urllib.request import urlopen from urllib.request import urlopen
__version__ = "23.5a1-13-gc1bf007" __version__ = "23.5a1-dev"
STABLE = "23.5a1" STABLE = "23.5a1"