Skip to content

Commit

Permalink
Binary build for Windows again (#706)
Browse files Browse the repository at this point in the history
* build system updates
* updated github actions
* use newer upload artifact action
* don't crash app on insufficient/invalid cal data fixes #699
  • Loading branch information
zarath authored Jun 25, 2024
1 parent a2f9044 commit 9f0263b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 23 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/release_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install python
Expand All @@ -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
10 changes: 5 additions & 5 deletions .github/workflows/release_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ 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 }}
- name: Install dependencies and pyinstall
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
Expand All @@ -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
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
19 changes: 14 additions & 5 deletions src/NanoVNASaver/Windows/CalibrationSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 9f0263b

Please sign in to comment.