From 9f0263bc3304f1b2211698249a602dddfa48c814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20M=C3=BCller?= Date: Tue, 25 Jun 2024 11:57:32 +0200 Subject: [PATCH] Binary build for Windows again (#706) * build system updates * updated github actions * use newer upload artifact action * don't crash app on insufficient/invalid cal data fixes #699 --- .github/workflows/release_linux.yml | 12 ++++++------ .github/workflows/release_win.yml | 10 +++++----- requirements.txt | 14 +++++++------- .../Windows/CalibrationSettings.py | 19 ++++++++++++++----- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release_linux.yml b/.github/workflows/release_linux.yml index 301f1733..aff68d41 100644 --- a/.github/workflows/release_linux.yml +++ b/.github/workflows/release_linux.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install python @@ -28,21 +28,21 @@ jobs: run: | python3.11 -m venv build . build/bin/activate - python -m pip install pip==23.3.2 setuptools==69.0.3 + python -m pip install pip==24.1 setuptools==70.1.0 pip install -r requirements.txt - pip install PyInstaller==6.3.0 + pip install PyInstaller==6.8.0 + python3 -m pip install -U PyQt6-sip + python3 -m pip install -U PyQt6 - name: Build binary run: | . build/bin/activate python setup.py -V pyinstaller --onefile \ -p src \ - --add-data "build/lib/python3.11/site-packages/PyQt6/sip.*.so:PyQt6/sip.so" \ - --add-data "build/lib/python3.11/site-packages/PyQt6/Qt6:PyQt6/Qt6" -n nanovna-saver \ nanovna-saver.py - name: Archive production artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: NanoVNASaver.linux_modern path: dist/nanovna-saver diff --git a/.github/workflows/release_win.yml b/.github/workflows/release_win.yml index fd4e53a6..536d4d28 100644 --- a/.github/workflows/release_win.yml +++ b/.github/workflows/release_win.yml @@ -14,11 +14,11 @@ jobs: arch: [x64, ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.12 architecture: ${{ matrix.arch }} @@ -26,10 +26,10 @@ jobs: run: | python3 -m venv venv .\venv\Scripts\activate - python3 -m pip install pip==23.3.2 + python3 -m pip install pip==24.1 python3 -m pip install -U setuptools setuptools-scm python3 -m pip install -r requirements.txt - python3 -m pip install PyInstaller==6.3.0 + python3 -m pip install PyInstaller==6.8.0 python3 -m pip install -U PyQt6-sip python3 -m pip install -U PyQt6 - name: Build binary @@ -38,7 +38,7 @@ jobs: python3 setup.py -V pyinstaller --onefile --noconsole -i icon_48x48.ico -p src -n nanovna-saver.exe nanovna-saver.py - name: Archive production artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: NanoVNASaver.${{ matrix.arch }} path: dist/nanovna-saver.exe diff --git a/requirements.txt b/requirements.txt index 0610e348..2d4f3809 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ pyserial==3.5 -PyQt6==6.5.2 +PyQt6==6.7.0 PyQt6-sip==13.6.0 -sip==6.8.1 -numpy==1.26.3 -scipy==1.12.0 -Cython==3.0.8 -setuptools==69.0.3 -setuptools-scm==8.0.4 +sip==6.8.4 +numpy==1.26.4 +scipy==1.13.1 +Cython==3.0.10 +setuptools==70.1.0 +setuptools-scm==8.1.0 diff --git a/src/NanoVNASaver/Windows/CalibrationSettings.py b/src/NanoVNASaver/Windows/CalibrationSettings.py index ea8385c3..756bc1cb 100644 --- a/src/NanoVNASaver/Windows/CalibrationSettings.py +++ b/src/NanoVNASaver/Windows/CalibrationSettings.py @@ -539,6 +539,13 @@ def calculate(self): ) return + if not self.app.calibration.isValid1Port(): + self.app.showError( + "Not enough data to apply calibration." + " Please complete SOL calibration and try again." + ) + return + cal_element.short_is_ideal = True cal_element.open_is_ideal = True cal_element.load_is_ideal = True @@ -633,18 +640,20 @@ def calculate(self): self.app.sweepSource, ) self.app.worker.signals.updated.emit() + except ValueError as e: - if logger.isEnabledFor(logging.DEBUG): - raise # showError here hides the calibration window, # so we need to pop up our own - QtWidgets.QMessageBox.warning( - self, "Error applying calibration", str(e) - ) self.calibration_status_label.setText( "Applying calibration failed." ) self.calibration_source_label.setText(self.app.calibration.source) + self.app.showError( + f"{e}" + " Please complete SOL calibration and try again." + ) + self.reset() + return def loadCalibration(self): filename, _ = QtWidgets.QFileDialog.getOpenFileName(