Add __version__ field to module

Closes #248.
This commit is contained in:
jaseg 2023-03-30 13:57:01 +02:00
parent 80f5ea64a1
commit 5a1a2734f2
2 changed files with 11 additions and 2 deletions

View file

@ -3,6 +3,12 @@
[ $# -eq 1 ] || exit 2
VER="$1"
echo "$VER" | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+$' || {
echo "Call this script as ./do_release.sh [version] where version has format 1.2.3, without \"v\" prefix."
exit 2
}
echo "Creating version $VER"
if [ -n "$(git diff --name-only --cached)" ]; then
@ -10,8 +16,9 @@ if [ -n "$(git diff --name-only --cached)" ]; then
exit 2
fi
sed -i "s/^\\(\\s*version\\s*=\\s*['\"]\\)[^'\"]*\\(['\"]\\s*\\)$/\\1"$VER"\\2/" pyproject.toml
git add pyproject.toml
sed -i "s/^\\(\\s*version\\s*=\\s*['\"]\\)[^'\"]*\\(['\"]\\s*\\)$/\\1v"$VER"\\2/" pyproject.toml
sed -i "s/^\\(\\s*version\\s*=\\s*['\"]\\)[^'\"]*\\(['\"]\\s*\\)$/\\1"$VER"\\2/" mpv.py
git add pyproject.toml mpv.py
git commit -m "Version $VER" --no-edit
git -c user.signingkey=E36F75307F0A0EC2D145FF5CED7A208EEEC76F2D -c user.email=python-mpv@jaseg.de tag -s "v$VER" -m "Version $VER"
git push --tags origin

2
mpv.py
View file

@ -17,6 +17,8 @@
#
# You can find copies of the GPLv2 and LGPLv2.1 licenses in the project repository's LICENSE.GPL and LICENSE.LGPL files.
__version__ = '1.0.3'
from ctypes import *
import ctypes.util
import threading