Skip to content

Commit

Permalink
Merge pull request #12 from refeyn/qt68upgrade
Browse files Browse the repository at this point in the history
Update to Qt 6.8
  • Loading branch information
matsjoyce-refeyn authored Oct 30, 2024
2 parents 7c9caf2 + e1194e9 commit 16c69c0
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 42 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ jobs:
cache-dependency-path: "./requirements.txt"

- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
aqtversion: "==3.1.*"
version: "6.5.3"
version: "6.8.0"
arch: "win64_msvc2022_64"
archives: "qttools qtdeclarative qtbase qtsvg icu"
documentation: true
doc-archives: "qtcore qtgui qtqml qtqmlcore qtqmlmodels qtquick qtquickcontrols qtquickdialogs qtsvg"
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ if(NOT INSTALL_SUBPATH)
endif()

find_package(Qt6 REQUIRED COMPONENTS Quick Svg)
qt_standard_project_setup(REQUIRES 6.5)
qt_standard_project_setup(REQUIRES 6.8)

add_subdirectory(QuickGraphLib)
6 changes: 3 additions & 3 deletions QuickGraphLib/PreFabs/ImageAxes.qml
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ QuickGraphLib.AntialiasingContainer {
property var colors: QuickGraphLib.ColorMaps.colors(root.colorMesh.colormap)

stops: colors.map((color, i) => gradStop.createObject(grad, {
"color": color,
"position": i / (colors.length - 1)
}))
"color": color,
"position": i / (colors.length - 1)
}))
}
}
QuickGraphLib.Axis {
Expand Down
8 changes: 4 additions & 4 deletions QuickGraphLib/bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ find_path(
)
find_library(
shiboken_shared_libraries
NAMES shiboken6 shiboken6.abi3 libshiboken6.abi3.so.6.5
NAMES shiboken6 shiboken6.abi3 libshiboken6.abi3.so.6.8
PATH_SUFFIXES shiboken6
PATHS "${Python_SITELIB}"
REQUIRED
)
find_library(
pyside_shared_library
NAMES pyside6 pyside6.abi3 libpyside6.abi3.so.6.5
NAMES pyside6 pyside6.abi3 libpyside6.abi3.so.6.8
PATH_SUFFIXES PySide6
PATHS "${Python_SITELIB}"
REQUIRED
)
find_library(
pyside_qml_shared_library
NAMES pyside6qml pyside6qml.abi3 libpyside6qml.abi3.so.6.5
NAMES pyside6qml pyside6qml.abi3 libpyside6qml.abi3.so.6.8
PATH_SUFFIXES PySide6
PATHS "${Python_SITELIB}"
REQUIRED
Expand Down Expand Up @@ -145,7 +145,7 @@ python_add_library(
ShibokenHelpers.cpp
WITH_SOABI
USE_SABI
3.7
3.9
)

# Apply relevant include and link flags.
Expand Down
1 change: 1 addition & 0 deletions QuickGraphLib/bindings/pyigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
cm = contextlib.nullcontext()
with cm:
pyi_generator.PySide6 = PySide6
pyi_generator.os = os
pyi_generator.main()

# Fixup
Expand Down
3 changes: 1 addition & 2 deletions QuickGraphLib/contours.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def contour_line(
)
result = []
for loop in gen.lines(height):
assert isinstance(loop, np.ndarray), "Loop is not an array" # For mypy
result.append(QGLPolygonF.fromNDArray(loop))
result.append(QGLPolygonF.fromNDArray(loop)) # type: ignore[arg-type]
return result


Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ A scientific graphing library for [QtQuick](https://doc.qt.io/qt-6/qtquick-index
Links:
- [Online documentation](https://refeyn.github.io/QuickGraphLib)
- [PyPI page](https://pypi.org/project/QuickGraphLib/)
- [Pre-built artefacts](https://github.com/refeyn/QuickGraphLib/releases/latest)

Key advantages:

Expand All @@ -19,7 +20,17 @@ Key advantages:
The example gallery can be run using (provided the Python environment has [PySide6](https://pypi.org/project/PySide6/) and [contourpy](https://pypi.org/project/contourpy/) installed):

```bash
python examples\gallery.py
python examples/gallery.py
```

<p align="center"><img src="https://github.com/refeyn/QuickGraphLib/assets/103422031/56fdff62-ef77-4184-9f43-59a76b92d728" width="80%"></p>

## Qt version compatibility

This version of QuickGraphLib is compatible with Qt and PySide6 6.8.0. If you use this module from C++, then Qt's ABI stability guarantees means the compiled binaries will work for any Qt version >= 6.8 and < 7.0. If you use this module from Python, there are some additional features that rely on the PySide6 library version. Therefore the PySide6 version must be 6.8.0.2 exactly. Other 6.8 versions of PySide6 may work, but there are no guarantees.

The pre-built wheels aim to be compatible with the most recent recent Qt LTS version, which is currently 6.8. Pre-built wheels for higher non-LTS Qt versions will likely be available once Qt 6.9 is released.

## Python version compatibility

QuickGraphLib is compatible with the same Python versions and glibc versions that PySide6 is. For PySide6 6.8, the minimum Python version is 3.9.
10 changes: 5 additions & 5 deletions ci/setup_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

if sys.platform == "linux":
qt_platform = "linux"
qt_arch = "gcc_64"
qt_arch = "linux_gcc_64"

elif sys.platform == "win32":
qt_platform = "windows"
qt_arch = "win64_msvc2019_64"
qt_arch = "win64_msvc2022_64"

elif sys.platform == "darwin":
qtPlatform = "mac"
qtArch = "clang_64"
qt_platform = "mac"
qt_arch = "clang_64"

else:
raise RuntimeError(f"Unknown platform {sys.platform}")
Expand All @@ -26,7 +26,7 @@
"install-qt",
qt_platform,
"desktop",
"6.5.3",
"6.8.0",
qt_arch,
"-O",
"./qt",
Expand Down
2 changes: 1 addition & 1 deletion docs/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"In file included from",
]

QT_PATH = pathlib.Path(os.environ.get("Qt6_DIR", "C:/Qt/6.5.3/msvc2019_64"))
QT_PATH = pathlib.Path(os.environ.get("QT_ROOT_DIR", "C:/Qt/6.8.0/msvc2022_64"))
QT_VERSION = QT_PATH.parts[-2]
QDOC_PATH = QT_PATH / "bin/qdoc.exe"
INDEX_PATH = QT_PATH.parent.parent / ("Docs/Qt-" + QT_VERSION)
Expand Down
6 changes: 3 additions & 3 deletions examples/BuiltinColormaps.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ Item {

orientation: Gradient.Horizontal
stops: colors.map((color, i) => gradStop.createObject(grad, {
"color": color,
"position": i / (colors.length - 1)
}))
"color": color,
"position": i / (colors.length - 1)
}))
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions examples/Conway.qml
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,20 @@ QQL.ColumnLayout {
QQC.ComboBox {
id: displayModeCombo

model: [{
model: [
{
"value": "historyCells",
"text": "Cells with history"
}, {
},
{
"value": "cells",
"text": "Cells"
}, {
},
{
"value": "neighbourCounts",
"text": "Neighbour counts"
}]
}
]
textRole: "text"
valueRole: "value"
}
Expand Down
17 changes: 8 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "A scientific graphing library for QtQuick"
readme = "README.md"
license = { file = "LICENCE" }
authors = [{ name = "Matthew Joyce", email = "matthew.joyce@refeyn.com" }]
dependencies = ["PySide6", "contourpy"]
dependencies = ["PySide6==6.8.0.2", "contourpy", "numpy<2"]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: X11 Applications :: Qt",
Expand Down Expand Up @@ -38,20 +38,19 @@ analyse = [
"pytest-cov",
# Building
"scikit-build-core",
"shiboken6_generator==6.5.3",
"PySide6==6.5.3",
"shiboken6_generator==6.8.0.2",
"setuptools_scm",
]

[build-system]
requires = ["scikit-build-core", "shiboken6_generator==6.5.3", "PySide6==6.5.3"]
requires = ["scikit-build-core", "shiboken6_generator==6.8.0.2", "PySide6==6.8.0.2"]
build-backend = "scikit_build_core.build"

[tool.scikit-build]
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
sdist.include = ["QuickGraphLib/_version.py"]
sdist.exclude = [".github", ".vscode"]
wheel.py-api = "cp37"
wheel.py-api = "cp39"

[tool.scikit-build.cmake.define]
INSTALL_SUBPATH = "."
Expand All @@ -61,10 +60,10 @@ write_to = "QuickGraphLib/_version.py"

[tool.cibuildwheel]
build = [
"cp37-macosx_x86_64",
"cp37-win_amd64",
"cp37-manylinux_x86_64",
# "cp37-manylinux_aarch64",
"cp39-macosx_x86_64",
"cp39-win_amd64",
"cp39-manylinux_x86_64",
# "cp39-manylinux_aarch64",
]
before-all = "python ci/setup_qt.py"
repair-wheel-command = ""
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ pluggy==1.5.0
pre-commit==3.7.1
pylint==3.2.6
pyproject_hooks==1.1.0
PySide6==6.5.3
PySide6-Addons==6.5.3
PySide6-Essentials==6.5.3
PySide6==6.8.0.2
PySide6-Addons==6.8.0.2
PySide6-Essentials==6.8.0.2
pytest==8.3.1
pytest-cov==5.0.0
PyYAML==6.0.1
scikit_build_core==0.9.8
setuptools-scm==8.1.0
shiboken6==6.5.3
shiboken6-generator==6.5.3
shiboken6==6.8.0.2
shiboken6-generator==6.8.0.2
tomli==2.0.1
tomlkit==0.13.0
typing_extensions==4.12.2
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

0 comments on commit 16c69c0

Please sign in to comment.