From cc363b4c57e37375cf5826307ca1e7c838506efc Mon Sep 17 00:00:00 2001 From: scito Date: Sun, 2 Jun 2024 10:22:34 +0200 Subject: [PATCH] update nuitka 2.3; fix build order; measure pyinstaller and nuitka --- Pipfile.lock | 6 +++--- build.sh | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 4dffe68..6bfc760 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -64,7 +64,7 @@ "sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3", "sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f" ], - "markers": "python_version >= '3.9'", + "markers": "python_version >= '3.10'", "version": "==1.26.4" }, "opencv-contrib-python": { @@ -410,10 +410,10 @@ }, "nuitka": { "hashes": [ - "sha256:aa78f838c2b5d165e2c071e9a9e705b2ac77506d24e91121321fa4b9740bba88" + "sha256:44f628d8b644e5166e5f47a2ee4aa192ca08f23f7fd784222d59cbf1a99733c1" ], "index": "pypi", - "version": "==2.2.3" + "version": "==2.3" }, "ordered-set": { "hashes": [ diff --git a/build.sh b/build.sh index 817583c..493a692 100755 --- a/build.sh +++ b/build.sh @@ -101,7 +101,7 @@ while test $# -gt 0; do echo "-C Ignore version check of protobuf/protoc" echo "-e Build exe" echo "-n Build nuitka exe" - echo "-L Do not build local (exe)" + echo "-L Do not run protoc and base build locally incl. exes" echo "-d Build docker" echo "-a Build arm" echo "-X Do not build x86_64" @@ -365,6 +365,13 @@ if $build_local; then if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi eval "$cmd" + # Update Code Coverage in README.md + + # https://github.com/marketplace/actions/pytest-coverage-comment + # Coverage-95%25-yellowgreen + echo -e "Update code coverage in README.md" + TOTAL_COVERAGE=$(cat $COVERAGE_OUT_FILE | grep 'TOTAL' | perl -ne 'print "$&" if /\b(\d{1,3})%/') && perl -i -pe "s/coverage-(\d{1,3}%)25-/coverage-${TOTAL_COVERAGE}25-/" README.md + # Pipenv if $run_pipenv; then @@ -399,7 +406,7 @@ if $build_local; then eval "$cmd" echo "local glibc: $LOCAL_GLIBC_VERSION" - cmd="pyinstaller -y --specpath installer --add-data $HOME/.local/__yolo_v3_qr_detector/:__yolo_v3_qr_detector/ --onefile $clean_flag src/extract_otp_secrets.py" + cmd="time pyinstaller -y --specpath installer --add-data $HOME/.local/__yolo_v3_qr_detector/:__yolo_v3_qr_detector/ --onefile $clean_flag src/extract_otp_secrets.py" if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi eval "$cmd" @@ -424,7 +431,7 @@ if $build_local; then if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi eval "$cmd" - cmd="$PYTHON -m nuitka --enable-plugin=tk-inter --enable-plugin=pyqt5 --include-data-dir=$HOME/.local/__yolo_v3_qr_detector/=__yolo_v3_qr_detector/ --onefile --output-dir=build/nuitka --output-filename=extract_otp_secrets_compiled src/extract_otp_secrets.py" + cmd="time $PYTHON -m nuitka --enable-plugin=tk-inter --enable-plugin=pyqt5 --noinclude-default-mode=nofollow --include-data-dir=$HOME/.local/__yolo_v3_qr_detector/=__yolo_v3_qr_detector/ --onefile --output-dir=build/nuitka --output-filename=extract_otp_secrets_compiled src/extract_otp_secrets.py" if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi eval "$cmd" @@ -447,13 +454,6 @@ if $build_local; then if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi eval "$cmd" - # Update Code Coverage in README.md - - # https://github.com/marketplace/actions/pytest-coverage-comment - # Coverage-95%25-yellowgreen - echo -e "Update code coverage in README.md" - TOTAL_COVERAGE=$(cat $COVERAGE_OUT_FILE | grep 'TOTAL' | perl -ne 'print "$&" if /\b(\d{1,3})%/') && perl -i -pe "s/coverage-(\d{1,3}%)25-/coverage-${TOTAL_COVERAGE}25-/" README.md - # create Windows win_file_version_info.txt cmd="VERSION_STR=$(setuptools-git-versioning) VERSION_MAJOR=$(cut -d '.' -f 1 <<< "$(setuptools-git-versioning)") VERSION_MINOR=$(cut -d '.' -f 2 <<< "$(setuptools-git-versioning)") VERSION_PATCH=$(cut -d '.' -f 3 <<< "$(setuptools-git-versioning)") VERSION_BUILD=$(($(git rev-list --count $(git tag | sort -V -r | sed '1!d')..HEAD))) COPYRIGHT_YEARS='2020-2023' envsubst < installer/win_file_version_info_template.txt > build/win_file_version_info.txt" if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi