Skip to content

Commit

Permalink
python: try bumping to Python 3.11 again [CPP-882] (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Mobarak authored Apr 3, 2023
1 parent 58ccd8f commit 4ef4b43
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 105 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---
name: main

on:
'on':
push:
branches:
- 'main'
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@910f37ee23653fd4b243fe5c7f81ff26a8a6a64e
with:
version: '6.3.2'
version: '6.4.3'
setup-python: false

- name: Run Checks
Expand All @@ -189,7 +189,7 @@ jobs:

frontend_distribute:
name: Run frontend benchmarks, build, sign and distribute
needs: [ checks, backend_bench ]
needs: [checks, backend_bench]
runs-on: ubuntu-latest
steps:
- shell: bash
Expand All @@ -206,7 +206,7 @@ jobs:
ref: main
workflow_file_name: distribute.yml
client_payload: '{
"branch": "${{ github.head_ref || github.ref_name }}",
"branch": "${{ github.head_ref || github.ref_name }}",
"run_id": "${{ github.run_id }}",
"should_release": "${{ env.SHOULD_RELEASE || false}}",
"version": "${{ env.VERSION }}",
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ main.app/
.DS_Store
swiftnav_console/console_resources.py
*.*~
py39-dist/
py39/
py311-dist/
py311/
dist/
console_backend/tests/fileout.json
get-pip.py
Expand Down
171 changes: 85 additions & 86 deletions Makefile.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ rust backend:
```
cargo make prep-debug-pyside
cargo make build-dist
py39-dist/bin/python3 -m swiftnav_console.main --read-capnp-recording console_backend/tests/data/console-capnp-20220419-033358.pickle
py311-dist/bin/python3 -m swiftnav_console.main --read-capnp-recording console_backend/tests/data/console-capnp-20220419-033358.pickle
```

## Debugging an intermittent crash on startup
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ We're using Qt 6 via PySide6 (the official Python bindings for Qt).

QML (QtQuick Mark-up Language) is used to model the UI.

### Python 3.9 Standalone Build
### Python 3.11 Standalone Build

[python-build-standalone](https://github.com/indygreg/python-build-standalone) provides
redistributable builds of Python, these builds are designed to function in a variety
Expand Down
2 changes: 1 addition & 1 deletion console_backend/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
def get_py_version_cfgs():
# For now each Cfg Py_3_X flag is interpreted as "at least 3.X"
version = sys.version_info[0:2]
py3_min = 9
py3_min = 11
out_cfg = []
for minor in range(py3_min, version[1] + 1):
out_cfg.append(f"--cfg=Py_3_{minor}")
Expand Down
4 changes: 2 additions & 2 deletions entrypoint/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ fn pythonhome_dir() -> Result<PathBuf> {
fn webengine_dir() -> Result<PathBuf> {
let app_dir = pythonhome_dir()?;
if cfg!(target_os = "macos") {
Ok(app_dir.join("lib/python3.9/site-packages/PySide6/Qt/lib/QtWebEngineCore.framework/Versions/A/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess"))
Ok(app_dir.join("lib/python3.11/site-packages/PySide6/Qt/lib/QtWebEngineCore.framework/Versions/A/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess"))
} else if cfg!(target_os = "windows") {
Ok(app_dir.join("Lib/site-packages/PySide6/QtWebEngineProcess.exe"))
} else {
Ok(app_dir.join("lib/python3.9/site-packages/PySide6/Qt/libexec/QtWebEngineProcess"))
Ok(app_dir.join("lib/python3.11/site-packages/PySide6/Qt/libexec/QtWebEngineProcess"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion installers/Windows/Installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ManifestDPIAware true
!define app_name "Swift Console"
!define app_executable "swift-console.exe"
!define outfile_prefix "swift-console"
!define installer_dir "py39-dist"
!define installer_dir "py311-dist"
!define company_name "Swift Navigation"
!define old_shortcut "${app_name} (Old).lnk"

Expand Down
2 changes: 1 addition & 1 deletion standalone-py/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.*~
pyo3_config*.txt
py39.*
py311.*
python/
4 changes: 2 additions & 2 deletions utils/debug_intermittent_startup_crash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function uniqueFn () {
echo "$uniquefn"
}

#if [ ! -d py39-dist ]; then
#if [ ! -d py311-dist ]; then
# cargo make build-dist
#fi

Expand All @@ -73,7 +73,7 @@ trap 'exec 2>&4 1>&3; echo Ctrl-C pressed, exiting loop. ; exit' SIGINT SIGTERM

echo "Logging to $logfn"

cd ${scriptpath}/../py39-dist
cd ${scriptpath}/../py311-dist
# macOS (or any platform using lldb) works differently.
# The looping is done within the debugger in a python script.
# This is faster, as the debugger doesn't have to shutdown and restart,
Expand Down
2 changes: 1 addition & 1 deletion utils/find_intermittent_startup_crash.ps1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
for ($i=0; $i -lt 1000; $i++) { .\py39-dist\python -m swiftnav_console.main --file .\console_backend\tests\data\ins_updates.sbp ; echo $i }
for ($i=0; $i -lt 1000; $i++) { .\py311-dist\python -m swiftnav_console.main --file .\console_backend\tests\data\ins_updates.sbp ; echo $i }
4 changes: 2 additions & 2 deletions utils/symlink-qt-installer-libs-to-pyside6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ if [[ ! -e "${QTDIR}/lib/libQt6Core.so.6" ]]; then
fi

# Check if PySide6 is installed
pyside6_qt_lib_dir=$(realpath "${SCRIPT_DIR}/../py39/lib/python3.9/site-packages/PySide6/Qt/lib")
pyside6_qt_lib_dir=$(realpath "${SCRIPT_DIR}/../311/lib/python3.11/site-packages/PySide6/Qt/lib")
if [[ ! -e "$pyside6_qt_lib_dir" ]]; then
echo >&2 "Could not find $pyside6_qt_lib_dir. aborting."
exit 1
fi

cd "${QTDIR}/lib"
qtdir_libs=$(ls -1 libQt6*.so.6 | sort)
cd "${SCRIPT_DIR}/../py39/lib/python3.9/site-packages/PySide6/Qt/lib"
cd "${SCRIPT_DIR}/../311/lib/python3.11/site-packages/PySide6/Qt/lib"

bkup_dir_suffix=""
while [[ -e "original_libs${bkup_dir_suffix}" ]]; do
Expand Down

0 comments on commit 4ef4b43

Please sign in to comment.