summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-03-30 13:57:01 +0200
committerjaseg <git@jaseg.de>2023-03-30 13:57:01 +0200
commit5a1a2734f2238cd201b4c94d878eb9daf31c3b63 (patch)
treeeb0bbad10f2b6b53c01b94fe03ace37eaad5c6f8
parent80f5ea64a1313698ba1b1e555d63f30f17ce935c (diff)
downloadpython-mpv-5a1a2734f2238cd201b4c94d878eb9daf31c3b63.tar.gz
python-mpv-5a1a2734f2238cd201b4c94d878eb9daf31c3b63.tar.bz2
python-mpv-5a1a2734f2238cd201b4c94d878eb9daf31c3b63.zip
Add __version__ field to module
Closes #248.
-rwxr-xr-xdo_release.sh11
-rw-r--r--mpv.py2
2 files changed, 11 insertions, 2 deletions
diff --git a/do_release.sh b/do_release.sh
index df301f2..fb50fcb 100755
--- a/do_release.sh
+++ b/do_release.sh
@@ -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
diff --git a/mpv.py b/mpv.py
index 350456c..0de35a4 100644
--- a/mpv.py
+++ b/mpv.py
@@ -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