From 7be45bad83d312335ef2eac77694fdc4d2947dee Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Tue, 3 Sep 2024 11:49:39 +0200 Subject: [PATCH 01/13] download and set intel OpenCL icd --- .github/workflows/ci.yml | 16 ++++++++++++++-- src/silx/test/__init__.py | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11b0d93abf..263325251d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 # Install packages: - # OpenCL lib and icd + # OpenCL lib # xvfb to run the GUI test headless # libegl1-mesa: Required by Qt xcb platform plugin # libgl1-mesa-glx: For OpenGL @@ -63,7 +63,13 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install ocl-icd-opencl-dev intel-opencl-icd xvfb libegl1-mesa libgl1-mesa-glx xserver-xorg-video-dummy libxkbcommon-x11-0 libxkbcommon0 libxkbcommon-dev libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-cursor0 libxcb1 + sudo apt-get install ocl-icd-opencl-dev xvfb libegl1-mesa libgl1-mesa-glx xserver-xorg-video-dummy libxkbcommon-x11-0 libxkbcommon0 libxkbcommon-dev libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-cursor0 libxcb1 + + - name: Setup Intel OpenCL ICD + if: runner.os == 'Linux' + run: | + wget -nv http://www.silx.org/pub/OpenCL/intel_opencl_icd-6.4.0.38.tar.gz -O - | tar -xzvf - + echo $(pwd)/intel_opencl_icd/icd/libintelocl.so > intel_opencl_icd/vendors/intel64.icd - uses: actions/setup-python@v5 with: @@ -87,6 +93,9 @@ jobs: pip install -r ci/requirements-pinned.txt pip install --pre "${{ matrix.QT_API }}" pip install --pre "$(ls dist/silx*.whl)[full,test]" + if [ ${{ runner.os }} == 'Linux' ]; then + export OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors + fi python ./ci/info_platform.py pip list @@ -98,4 +107,7 @@ jobs: if [ ${{ runner.os }} == 'Windows' ]; then export WITH_GL_TEST=False fi + if [ ${{ runner.os }} == 'Linux' ]; then + export OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors + fi python -c "import silx.test, sys; sys.exit(silx.test.run_tests(verbosity=1, args=['--qt-binding=${{ matrix.QT_API }}']));" diff --git a/src/silx/test/__init__.py b/src/silx/test/__init__.py index 98faae32b2..a49c637720 100644 --- a/src/silx/test/__init__.py +++ b/src/silx/test/__init__.py @@ -68,6 +68,7 @@ def run_tests( "-Wignore:tostring() is deprecated. Use tobytes() instead.:DeprecationWarning:OpenGL.GL.VERSION.GL_2_0", "-Wignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning", "-Wignore:Unable to import recommended hash 'siphash24.siphash13', falling back to 'hashlib.sha256'. Run 'python3 -m pip install siphash24' to install the recommended hash.:UserWarning:pytools.persistent_dict", + "-Wignore:Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.:pyopencl.CompilerWarning", # Remove __array__ ignore once h5py v3.12 is released "-Wignore:__array__ implementation doesn't accept a copy keyword, so passing copy=False failed. __array__ must implement 'dtype' and 'copy' keyword arguments.:DeprecationWarning", ] + list(args) From d8c67085aaf027cbcd824e61242f283cb0dd836b Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Wed, 4 Sep 2024 11:48:18 +0200 Subject: [PATCH 02/13] explicitly disable opencl/opengl tests --- .github/workflows/ci.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 263325251d..c7a353bbd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,32 +22,50 @@ jobs: - os: ubuntu-20.04 python-version: "3.8" QT_API: PyQt5 + with_opencl: false + with_opengl: true - os: ubuntu-latest python-version: "3.11" QT_API: PyQt6 + with_opencl: true + with_opengl: true - os: ubuntu-latest python-version: "3.12" QT_API: PySide6 + with_opencl: true + with_opengl: true - os: macos-13 python-version: "3.10" QT_API: PyQt5 + with_opencl: true + with_opengl: true - os: macos-13 python-version: "3.12" QT_API: PyQt6 + with_opencl: true + with_opengl: true - os: macos-13 python-version: "3.9" QT_API: PySide6 + with_opencl: true + with_opengl: true - os: windows-latest python-version: "3.9" QT_API: PyQt5 + with_opencl: false + with_opengl: false - os: windows-latest python-version: "3.12" QT_API: PyQt6 + with_opencl: false + with_opengl: false - os: windows-latest python-version: "3.10" QT_API: PySide6 + with_opencl: false + with_opengl: false steps: - uses: actions/checkout@v4 @@ -103,10 +121,9 @@ jobs: env: QT_API: ${{ matrix.QT_API }} SILX_TEST_LOW_MEM: "False" + SILX_OPENCL: ${{ matrix.with_opencl && 'True' || 'False' }} + WITH_GL_TEST: ${{ matrix.with_opengl && 'True' || 'False' }} run: | - if [ ${{ runner.os }} == 'Windows' ]; then - export WITH_GL_TEST=False - fi if [ ${{ runner.os }} == 'Linux' ]; then export OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors fi From 66dcafe8d2f9c320cfc3419a0b13a093c73ffe80 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Wed, 4 Sep 2024 14:13:44 +0200 Subject: [PATCH 03/13] Avoid pytest to import pyopencl --- src/silx/test/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/silx/test/__init__.py b/src/silx/test/__init__.py index a49c637720..3df251d379 100644 --- a/src/silx/test/__init__.py +++ b/src/silx/test/__init__.py @@ -68,7 +68,7 @@ def run_tests( "-Wignore:tostring() is deprecated. Use tobytes() instead.:DeprecationWarning:OpenGL.GL.VERSION.GL_2_0", "-Wignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning", "-Wignore:Unable to import recommended hash 'siphash24.siphash13', falling back to 'hashlib.sha256'. Run 'python3 -m pip install siphash24' to install the recommended hash.:UserWarning:pytools.persistent_dict", - "-Wignore:Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.:pyopencl.CompilerWarning", + "-Wignore:Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more.:UserWarning", # Remove __array__ ignore once h5py v3.12 is released "-Wignore:__array__ implementation doesn't accept a copy keyword, so passing copy=False failed. __array__ must implement 'dtype' and 'copy' keyword arguments.:DeprecationWarning", ] + list(args) From c4228627394e0b29b08f2cddb3d7017b1e655eb4 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Wed, 4 Sep 2024 14:32:50 +0200 Subject: [PATCH 04/13] Install OpenGL on Windows --- .github/workflows/ci.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7a353bbd2..0ce7297e1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,49 +23,40 @@ jobs: python-version: "3.8" QT_API: PyQt5 with_opencl: false - with_opengl: true - os: ubuntu-latest python-version: "3.11" QT_API: PyQt6 with_opencl: true - with_opengl: true - os: ubuntu-latest python-version: "3.12" QT_API: PySide6 with_opencl: true - with_opengl: true - os: macos-13 python-version: "3.10" QT_API: PyQt5 with_opencl: true - with_opengl: true - os: macos-13 python-version: "3.12" QT_API: PyQt6 with_opencl: true - with_opengl: true - os: macos-13 python-version: "3.9" QT_API: PySide6 with_opencl: true - with_opengl: true - os: windows-latest python-version: "3.9" QT_API: PyQt5 with_opencl: false - with_opengl: false - os: windows-latest python-version: "3.12" QT_API: PyQt6 with_opencl: false - with_opengl: false - os: windows-latest python-version: "3.10" QT_API: PySide6 with_opencl: false - with_opengl: false steps: - uses: actions/checkout@v4 @@ -94,6 +85,11 @@ jobs: python-version: ${{ matrix.python-version }} cache: "pip" + - name: Setup OpenGL + if: runner.os == 'Windows' + run: | + C:\\msys64\\usr\\bin\\wget.exe -nv -O $(python -c 'import sys, os.path; print(os.path.dirname(sys.executable))')\\opengl32.dll http://www.silx.org/pub/silx/continuous_integration/opengl32_mingw-mesa-x86_64.dll + - name: Install build dependencies run: | pip install --upgrade --pre build cython setuptools wheel @@ -122,7 +118,6 @@ jobs: QT_API: ${{ matrix.QT_API }} SILX_TEST_LOW_MEM: "False" SILX_OPENCL: ${{ matrix.with_opencl && 'True' || 'False' }} - WITH_GL_TEST: ${{ matrix.with_opengl && 'True' || 'False' }} run: | if [ ${{ runner.os }} == 'Linux' ]; then export OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors From 57a68e39850a82795d1e9b27ba05d96356a74e00 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Mon, 2 Sep 2024 17:41:51 +0200 Subject: [PATCH 05/13] Change default Qt binding from PyQt5 to PySide6 --- requirements.txt | 2 +- setup.py | 2 +- src/silx/gui/qt/_qt.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 9d4240b3d7..fb470747d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,4 +28,4 @@ scipy # For silx.math.fit demo, silx.image.sift demo, silx.i pooch # For scipy.datasets.ascent Pillow # For silx.opencl.image.test pint # For silx.io.dictdump -PyQt5 # PySide6, PyQt6>=6.3 # For silx.gui +PySide6 >= 6.4 # PyQt6, PyQt5 # For silx.gui diff --git a/setup.py b/setup.py index aa974bee8e..89ed497fed 100644 --- a/setup.py +++ b/setup.py @@ -173,7 +173,7 @@ def get_project_configuration(): "matplotlib>=3.1.0", "PyOpenGL", "python-dateutil", - "PyQt5", + "PySide6>=6.4", # extra "hdf5plugin", "scipy", diff --git a/src/silx/gui/qt/_qt.py b/src/silx/gui/qt/_qt.py index e069f4b82e..fbd4a8eb7f 100644 --- a/src/silx/gui/qt/_qt.py +++ b/src/silx/gui/qt/_qt.py @@ -64,7 +64,7 @@ def _select_binding() -> str: :raises ImportError: :returns: Loaded binding """ - bindings = "PyQt5", "PySide6", "PyQt6" + bindings = "PySide6", "PyQt6", "PyQt5" envvar = os.environ.get("QT_API", "").lower() From 62c6bbc88267d53e4568cc54faa7166bda50a89a Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Mon, 2 Sep 2024 17:43:19 +0200 Subject: [PATCH 06/13] Change order of Qt bindings in documentation and docstrings --- doc/source/install.rst | 6 +++--- doc/source/license.rst | 4 ++-- doc/source/modules/gui/plot/getting_started.rst | 6 +++--- src/silx/gui/qt/__init__.py | 4 ++-- src/silx/gui/qt/_qt.py | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/source/install.rst b/doc/source/install.rst index cec12e94c0..b2511345d0 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -144,9 +144,9 @@ The mandatory dependencies are: The GUI widgets depend on the following extra packages: -* A Qt binding: either `PyQt5 `_ (>= 5.9), - `PySide6 `_ (>= 6.4) or - `PyQt6 `_ (>= 6.3) +* A Qt binding: either `PySide6 `_ (>= 6.4), + `PyQt6 `_ (>= 6.3) or + `PyQt5 `_ (>= 5.9) * `matplotlib `_ * `PyOpenGL `_ * `qtconsole `_ diff --git a/doc/source/license.rst b/doc/source/license.rst index 4adcbcf8fa..979cc71147 100644 --- a/doc/source/license.rst +++ b/doc/source/license.rst @@ -14,8 +14,8 @@ Note: silx uses the Qt library for its graphical user interfaces. A word of caution is to be provided. - If users develop and distribute software using modules accessing Qt by means of Riverbank Computing Qt bindings PyQt4 or PyQt5, those users will be conditioned by the license of their PyQt4/5 software (GPL or commercial). - If the end user does not own a commercial license of PyQt4 or PyQt5 and wishes to be free of any distribution condition, (s)he should be able to use PySide6 because it uses the LGPL license. + If users develop and distribute software using modules accessing Qt by means of Riverbank Computing Qt bindings PyQt6 or PyQt5, those users will be conditioned by the license of their PyQt6/5 software (GPL or commercial). + If the end user does not own a commercial license of PyQt6 or PyQt5 and wishes to be free of any distribution condition, (s)he should be able to use PySide6 because it uses the LGPL license. The following list provides the copyright and license of the different source files of the project: diff --git a/doc/source/modules/gui/plot/getting_started.rst b/doc/source/modules/gui/plot/getting_started.rst index ead9e43e43..18ad40f86c 100644 --- a/doc/source/modules/gui/plot/getting_started.rst +++ b/doc/source/modules/gui/plot/getting_started.rst @@ -38,7 +38,7 @@ Compatibility with IPython ++++++++++++++++++++++++++ silx widgets require Qt to be initialized. -If Qt is not yet loaded, silx tries to load PyQt5 first before trying other supported bindings. +If Qt is not yet loaded, silx tries to load PySide6 first before trying other supported bindings. With versions of IPython lower than 3.0 (e.g., on Debian 8), there is an incompatibility between the way silx loads Qt and the way IPython is doing it through the ``--gui`` option, @@ -87,13 +87,13 @@ A Qt GUI script must have a QApplication initialised before creating widgets: [...] qapp.exec() -Unless a Qt binding has already been loaded, :mod:`silx.gui.qt` uses one of the supported Qt bindings (PyQt5, PySide6, PyQt6). +Unless a Qt binding has already been loaded, :mod:`silx.gui.qt` uses one of the supported Qt bindings (PySide6, PyQt6, PyQt5). If you prefer to choose the Qt binding yourself, import it before importing a module from :mod:`silx.gui`: .. code-block:: python - import PyQt5.QtCore # Importing PyQt5 will force silx to use it + import PyQt6.QtCore # Importing PyQt6 will force silx to use it from silx.gui import qt diff --git a/src/silx/gui/qt/__init__.py b/src/silx/gui/qt/__init__.py index 675a178193..9626b4c0f6 100644 --- a/src/silx/gui/qt/__init__.py +++ b/src/silx/gui/qt/__init__.py @@ -23,14 +23,14 @@ # ###########################################################################*/ """Common wrapper over Python Qt bindings: -- `PyQt5 `_ - `PySide6 `_ - `PyQt6 `_ +- `PyQt5 `_ If a Qt binding is already loaded, it will be used. If the `QT_API` environment variable is set to one of the supported Qt bindings (case insensitive), this binding is loaded if available, otherwise the -different Qt bindings are tried in this order: PyQt5, PySide6, PyQt6. +different Qt bindings are tried in this order: PySide6, PyQt6, PyQt5. The name of the loaded Qt binding is stored in the BINDING variable. diff --git a/src/silx/gui/qt/_qt.py b/src/silx/gui/qt/_qt.py index fbd4a8eb7f..b3eec593c1 100644 --- a/src/silx/gui/qt/_qt.py +++ b/src/silx/gui/qt/_qt.py @@ -41,10 +41,10 @@ BINDING = None -"""The name of the Qt binding in use: PyQt5, PySide6, PyQt6.""" +"""The name of the Qt binding in use: PySide6, PyQt6, PyQt5.""" QtBinding = None # noqa -"""The Qt binding module in use: PyQt5, PySide6, PyQt6.""" +"""The Qt binding module in use: PySide6, PyQt6, PyQt5.""" HAS_SVG = False """True if Qt provides support for Scalable Vector Graphics (QtSVG).""" @@ -103,7 +103,7 @@ def _select_binding() -> str: else: return binding - raise ImportError("No Qt wrapper found. Install PyQt5, PySide6, PyQt6.") + raise ImportError("No Qt wrapper found. Install PySide6, PyQt6, PyQt5.") BINDING = _select_binding() From 47c38db3dfae453d3b3e95200b7092d3d20e79cc Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Mon, 2 Sep 2024 17:45:25 +0200 Subject: [PATCH 07/13] Use PySide6 for the windows app --- package/windows/pyinstaller.spec | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/package/windows/pyinstaller.spec b/package/windows/pyinstaller.spec index 91be598e65..da368f8e42 100644 --- a/package/windows/pyinstaller.spec +++ b/package/windows/pyinstaller.spec @@ -108,20 +108,17 @@ silx_coll = COLLECT( # Generate license file from current Python env def create_license_file(filename: str): - import PyQt5.QtCore + import PySide6.QtCore with open(filename, "w") as f: f.write( f""" This is free software. -This distribution of silx is provided under the -GNU General Public License v3 (https://www.gnu.org/licenses/gpl-3.0.en.html) since it includes PyQt5. - It includes mainy software packages with different licenses: - Python ({sys.version}): PSF license, https://www.python.org/ -- Qt ({PyQt5.QtCore.qVersion()}): GNU Lesser General Public License v3, https://www.qt.io/ +- Qt ({PySide6.QtCore.qVersion()}): GNU Lesser General Public License v3, https://www.qt.io/ """ ) From 7a8b68e97fd0f9c243e8296f55bb926e6733e9c0 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Wed, 4 Sep 2024 10:13:45 +0200 Subject: [PATCH 08/13] Install system packages for pyside to import in sdist tests --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 951d5b3840..55ecd441aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,6 +35,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Install system packages + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install xvfb libegl1-mesa libgl1-mesa-glx xserver-xorg-video-dummy libxkbcommon-x11-0 libxkbcommon0 libxkbcommon-dev libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-cursor0 libxcb1 - uses: actions/setup-python@v5 with: python-version: "3.12" From 632037ba623e0a99aa671934c2faeee13dfbf9d0 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Wed, 4 Sep 2024 10:14:37 +0200 Subject: [PATCH 09/13] Use manylinux 2_28 --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55ecd441aa..8c81040046 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,6 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install system packages - if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install xvfb libegl1-mesa libgl1-mesa-glx xserver-xorg-video-dummy libxkbcommon-x11-0 libxkbcommon0 libxkbcommon-dev libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-cursor0 libxcb1 @@ -172,6 +171,9 @@ jobs: CIBW_BUILD_VERBOSITY: 1 CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 + CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux_2_28 # Do not build for pypy and muslinux CIBW_SKIP: pp* *-musllinux_* CIBW_ARCHS: ${{ matrix.cibw_archs }} From bbcae860517d3f8e31dc01ecad3e3f649bcbc6f6 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Wed, 4 Sep 2024 10:35:58 +0200 Subject: [PATCH 10/13] Fix build doc and fail on warnings --- .github/workflows/release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c81040046..528de14189 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,6 +62,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Install system packages + run: | + sudo apt-get update + sudo apt-get install xvfb libegl1-mesa libgl1-mesa-glx xserver-xorg-video-dummy libxkbcommon-x11-0 libxkbcommon0 libxkbcommon-dev libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-cursor0 libxcb1 + - name: Setup Intel OpenCL ICD + run: | + wget -nv http://www.silx.org/pub/OpenCL/intel_opencl_icd-6.4.0.38.tar.gz -O - | tar -xzvf - + echo $(pwd)/intel_opencl_icd/icd/libintelocl.so > intel_opencl_icd/vendors/intel64.icd - uses: actions/setup-python@v5 with: python-version: "3.12" @@ -69,13 +77,14 @@ jobs: - name: Install pandoc&graphviz run: sudo apt-get install pandoc graphviz - name: Install silx - run: pip install .[full,test,doc] + run: pip install .[full,test,doc] siphash24 - name: Build doc env: QT_QPA_PLATFORM: "offscreen" run: | + export OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors export SILX_VERSION="$(python -c 'import silx; print(silx.strictversion)')" - sphinx-build doc/source/ "silx-${SILX_VERSION}_documentation/" + sphinx-build --fail-on-warning doc/source/ "silx-${SILX_VERSION}_documentation/" zip -r "silx-${SILX_VERSION}_documentation.zip" "silx-${SILX_VERSION}_documentation/" - uses: actions/upload-artifact@v4 with: From 17cdb059aa79b2f82f0aca6e434a49e381ef48a6 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Wed, 4 Sep 2024 11:10:12 +0200 Subject: [PATCH 11/13] install system dependencies for cibw tests --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 528de14189..5af9de8cca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -188,6 +188,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} # Install test dependencies + CIBW_BEFORE_TEST_LINUX: yum install -y mesa-libEGL mesa-libGL libxkbcommon-x11 libxkbcommon xcb-util-image xcb-util-keysyms libXrandr xcb-util-renderutil libXcursor libxcb CIBW_TEST_EXTRAS: "full,test" CIBW_TEST_COMMAND: python -c "import silx.test, sys; sys.exit(silx.test.run_tests(verbosity=3))" # Skip tests for emulated architectures and arm64 macos From 2cbea539a357183fa923a22742ecaf3c82e89b83 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Wed, 4 Sep 2024 11:54:26 +0200 Subject: [PATCH 12/13] remove useless declaration --- .github/workflows/release.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5af9de8cca..b9357dd680 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,19 +145,14 @@ jobs: include: - os: ubuntu-20.04 cibw_archs: "auto64" - with_sse2: true - os: ubuntu-20.04 cibw_archs: "aarch64" - with_sse2: false - os: ubuntu-20.04 cibw_archs: "ppc64le" - with_sse2: false - os: windows-2019 cibw_archs: "auto64" - with_sse2: true - os: macos-12 cibw_archs: "universal2" - with_sse2: true steps: - uses: actions/checkout@v4 From f859ef1b57126791f65b1949698ffeabf345e9d0 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Thu, 5 Sep 2024 12:18:24 +0200 Subject: [PATCH 13/13] Use a composite action to share system setup across jobs --- .github/actions/setup-system/action.yml | 33 +++++++++++++++++++++++++ .github/workflows/ci.yml | 30 +--------------------- .github/workflows/release.yml | 15 ++--------- 3 files changed, 36 insertions(+), 42 deletions(-) create mode 100644 .github/actions/setup-system/action.yml diff --git a/.github/actions/setup-system/action.yml b/.github/actions/setup-system/action.yml new file mode 100644 index 0000000000..82dbed53fa --- /dev/null +++ b/.github/actions/setup-system/action.yml @@ -0,0 +1,33 @@ +name: 'Setup Linux' +description: 'Install system packages and setup Intel Opencl ICD' + +runs: + using: "composite" + steps: + # Install packages: + # OpenCL lib + # xvfb to run the GUI test headless + # libegl1-mesa: Required by Qt xcb platform plugin + # libgl1-mesa-glx: For OpenGL + # xserver-xorg-video-dummy: For OpenGL + # libxkbcommon-x11-0, ..: needed for Qt plugins + - name: Install system packages + if: runner.os == 'Linux' + shell: bash + run: | + sudo apt-get update + sudo apt-get install ocl-icd-opencl-dev xvfb libegl1-mesa libgl1-mesa-glx xserver-xorg-video-dummy libxkbcommon-x11-0 libxkbcommon0 libxkbcommon-dev libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-cursor0 libxcb1 + + - name: Setup Intel OpenCL ICD + if: runner.os == 'Linux' + shell: bash + run: | + wget -nv http://www.silx.org/pub/OpenCL/intel_opencl_icd-6.4.0.38.tar.gz -O - | tar -xzvf - + echo $(pwd)/intel_opencl_icd/icd/libintelocl.so > intel_opencl_icd/vendors/intel64.icd + echo "OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors/intel64.icd" >> "$GITHUB_ENV" + + - name: Setup OpenGL + if: runner.os == 'Windows' + shell: bash + run: | + C:\\msys64\\usr\\bin\\wget.exe -nv -O $(python -c 'import sys, os.path; print(os.path.dirname(sys.executable))')\\opengl32.dll http://www.silx.org/pub/silx/continuous_integration/opengl32_mingw-mesa-x86_64.dll diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ce7297e1d..e2527cbc77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,34 +61,12 @@ jobs: steps: - uses: actions/checkout@v4 - # Install packages: - # OpenCL lib - # xvfb to run the GUI test headless - # libegl1-mesa: Required by Qt xcb platform plugin - # libgl1-mesa-glx: For OpenGL - # xserver-xorg-video-dummy: For OpenGL - # libxkbcommon-x11-0, ..: needed for Qt plugins - - name: Install system packages - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install ocl-icd-opencl-dev xvfb libegl1-mesa libgl1-mesa-glx xserver-xorg-video-dummy libxkbcommon-x11-0 libxkbcommon0 libxkbcommon-dev libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-cursor0 libxcb1 - - - name: Setup Intel OpenCL ICD - if: runner.os == 'Linux' - run: | - wget -nv http://www.silx.org/pub/OpenCL/intel_opencl_icd-6.4.0.38.tar.gz -O - | tar -xzvf - - echo $(pwd)/intel_opencl_icd/icd/libintelocl.so > intel_opencl_icd/vendors/intel64.icd - - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" - - name: Setup OpenGL - if: runner.os == 'Windows' - run: | - C:\\msys64\\usr\\bin\\wget.exe -nv -O $(python -c 'import sys, os.path; print(os.path.dirname(sys.executable))')\\opengl32.dll http://www.silx.org/pub/silx/continuous_integration/opengl32_mingw-mesa-x86_64.dll + - uses: ./.github/actions/setup-system - name: Install build dependencies run: | @@ -107,9 +85,6 @@ jobs: pip install -r ci/requirements-pinned.txt pip install --pre "${{ matrix.QT_API }}" pip install --pre "$(ls dist/silx*.whl)[full,test]" - if [ ${{ runner.os }} == 'Linux' ]; then - export OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors - fi python ./ci/info_platform.py pip list @@ -119,7 +94,4 @@ jobs: SILX_TEST_LOW_MEM: "False" SILX_OPENCL: ${{ matrix.with_opencl && 'True' || 'False' }} run: | - if [ ${{ runner.os }} == 'Linux' ]; then - export OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors - fi python -c "import silx.test, sys; sys.exit(silx.test.run_tests(verbosity=1, args=['--qt-binding=${{ matrix.QT_API }}']));" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9357dd680..8c21d7dcea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,14 +35,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install system packages - run: | - sudo apt-get update - sudo apt-get install xvfb libegl1-mesa libgl1-mesa-glx xserver-xorg-video-dummy libxkbcommon-x11-0 libxkbcommon0 libxkbcommon-dev libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-cursor0 libxcb1 - uses: actions/setup-python@v5 with: python-version: "3.12" cache: "pip" + - uses: ./.github/actions/setup-system - uses: actions/download-artifact@v4 with: name: cibw-sdist @@ -62,18 +59,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install system packages - run: | - sudo apt-get update - sudo apt-get install xvfb libegl1-mesa libgl1-mesa-glx xserver-xorg-video-dummy libxkbcommon-x11-0 libxkbcommon0 libxkbcommon-dev libxcb-icccm4 libxcb-image0 libxcb-shm0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-cursor0 libxcb1 - - name: Setup Intel OpenCL ICD - run: | - wget -nv http://www.silx.org/pub/OpenCL/intel_opencl_icd-6.4.0.38.tar.gz -O - | tar -xzvf - - echo $(pwd)/intel_opencl_icd/icd/libintelocl.so > intel_opencl_icd/vendors/intel64.icd - uses: actions/setup-python@v5 with: python-version: "3.12" cache: "pip" + - uses: ./.github/actions/setup-system - name: Install pandoc&graphviz run: sudo apt-get install pandoc graphviz - name: Install silx @@ -82,7 +72,6 @@ jobs: env: QT_QPA_PLATFORM: "offscreen" run: | - export OCL_ICD_VENDORS=$(pwd)/intel_opencl_icd/vendors export SILX_VERSION="$(python -c 'import silx; print(silx.strictversion)')" sphinx-build --fail-on-warning doc/source/ "silx-${SILX_VERSION}_documentation/" zip -r "silx-${SILX_VERSION}_documentation.zip" "silx-${SILX_VERSION}_documentation/"