version info

This commit is contained in:
Christian Zangl 2024-06-28 21:58:10 +02:00
parent c8ff616cf9
commit 1d15326025
No known key found for this signature in database
GPG Key ID: 6D468AC36E2A4B3D
4 changed files with 13 additions and 8 deletions

View File

@ -34,20 +34,24 @@ jobs:
SITEPKG=$(pipenv run python -c "import site; print(site.getsitepackages()[-1])")
pipenv run pyinstaller run.py --hidden-import chkbit --hidden-import chkbit_cli --onefile --name chkbit --console --paths $SITEPKG
cat build/chkbit/warn-chkbit.txt
a=$(grep -oP '(?<=version = ")[^"]+' pyproject.toml)
b=$(grep -oP '(?<=__version__ = ")[^"]+' chkbit_cli/__init__.py)
if [[ $a != $b ]]; then echo "version error $a $b"; exit 1; fi
cd dist; ls -l
if [ "$RUNNER_OS" == "Linux" ]; then
./chkbit --version
c=$(./chkbit --version)
tar -czf chkbit-linux_amd64.tar.gz chkbit
elif [ "$RUNNER_OS" == "macOS" ]; then
./chkbit --version
c=$(./chkbit --version)
tar -czf chkbit-macos_amd64.tar.gz chkbit
elif [ "$RUNNER_OS" == "Windows" ]; then
chkbit.exe --version
c=$(chkbit.exe --version)
7z a -tzip chkbit-windows_amd64.zip chkbit.exe
else
echo 'unknown runner'
exit 1
fi
if [[ $a != $c ]]; then echo "version error $a $c"; exit 1; fi
- name: artifact
uses: actions/upload-artifact@v4

View File

@ -2,3 +2,5 @@ from .cli import CLI
from .progress import Progress
from .sparklines import sparkify
from .rate_calc import RateCalc
__version__ = "4.2.1"

View File

@ -8,9 +8,7 @@ import threading
import time
from datetime import datetime, timedelta
from chkbit import Context, Status, IndexThread
from . import CLI, Progress, RateCalc, sparkify
import importlib.metadata
from . import CLI, Progress, RateCalc, sparkify, __version__
EPILOG = """
@ -348,7 +346,7 @@ class Main:
args = parser.parse_args()
if args.version:
print(importlib.metadata.version("chkbit"))
print(__version__)
return
self.verbose = args.verbose or args.show_ignored_only

View File

@ -1,6 +1,7 @@
[project]
name = "chkbit"
version = "4.2.0"
# because of packaging issues we keep this here and in chkbit_cli/__init__.py
version = "4.2.1"
description = "chkbit checks the data integrity of your files"
authors = [
{name = "Christian Zangl", email = "laktak@cdak.net"},