From 047587ca57a2ec5431acc2f5f7d8dff0c7d0e17f Mon Sep 17 00:00:00 2001 From: Christophe Pradal Date: Sun, 28 Jan 2024 14:49:29 +0100 Subject: [PATCH 01/16] Update README.md Add badge for action --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ab926e..949751f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # PyQGLViewer - -[![Build Status](https://travis-ci.org/fredboudon/PyQGLViewer.svg?branch=master)](https://travis-ci.org/fredboudon/PyQGLViewer) [![Build status](https://ci.appveyor.com/api/projects/status/7jo1h7frejsot8uh/branch/master?svg=true)](https://ci.appveyor.com/project/fredboudon/pyqglviewer/branch/master) +![ workflow](https://github.com/openalea/PyQGLViewer/actions/workflows/conda-package-build.yml/badge.svg) ## Presentation From 27d140f26172cecc62cedf373a71624bb3da814c Mon Sep 17 00:00:00 2001 From: baugetfa Date: Tue, 22 Jul 2025 09:49:44 +0200 Subject: [PATCH 02/16] update CI, meta.yaml --- .github/workflows/conda-package-build.yml | 21 +++++++++++++-------- conda/meta.yaml | 3 ++- setup.py | 3 +++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/conda-package-build.yml b/.github/workflows/conda-package-build.yml index ea4c4d5..ed7d257 100644 --- a/.github/workflows/conda-package-build.yml +++ b/.github/workflows/conda-package-build.yml @@ -1,18 +1,23 @@ -name: Building Package +name: OpenAlea CI on: push: - branches: - - '**' + branches: + - main + - master tags: - 'v*' pull_request: - branches: - - '**' - + types: + - opened + - synchronize + - reopened + release: + types: + - published jobs: build: - uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@main - secrets: + uses: openalea/action-build-publish-anaconda/.github/workflows/openalea_ci.yml@main + secrets: anaconda_token: ${{ secrets.ANACONDA_TOKEN }} diff --git a/conda/meta.yaml b/conda/meta.yaml index a2feeb0..b3b0251 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,9 +1,10 @@ # do not edit the following line. It will be updated automatically {% set data = load_setup_py_data() %} +{% set version = environ.get('SETUPTOOLS_SCM_PRETEND_VERSION', "0.0.0.dev") %} package: name: pyqglviewer - version: {{ data.get('version') }} + version: {{ version }} source: path: .. diff --git a/setup.py b/setup.py index 0b16def..fb4ffc7 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,9 @@ def get_version(): url=url, license=license, + use_scm_version=True, + setup_requires=['setuptools_scm'], + # pure python packages packages = [ 'PyQGLViewer' From d1f881a59c2b53a501fb9ecb17ea83ce5d7cee03 Mon Sep 17 00:00:00 2001 From: baugetfa Date: Tue, 22 Jul 2025 09:55:04 +0200 Subject: [PATCH 03/16] update CI, meta.yaml 2 --- conda/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/conda/meta.yaml b/conda/meta.yaml index b3b0251..9b2ad5f 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -15,6 +15,7 @@ about: summary: PyQGLViewer is a set of Python bindings for the libQGLViewer C++ library which extends the Qt framework with widgets and tools that eases the creation of OpenGL 3D viewers. build: + string: py{{ PY_VER }} number: 2 requirements: From 1bbad30766dbf4525c26f1eacff354beffb53116 Mon Sep 17 00:00:00 2001 From: baugetfa Date: Tue, 22 Jul 2025 13:29:12 +0200 Subject: [PATCH 04/16] WIP to fix linux and win CI --- pyproject-linux.toml | 2 +- pyproject-win.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject-linux.toml b/pyproject-linux.toml index 5b35757..f1126d1 100644 --- a/pyproject-linux.toml +++ b/pyproject-linux.toml @@ -27,5 +27,5 @@ extra-link-args=['-L${CONDA_PREFIX}/lib','-L${PREFIX}/lib'] [tool.sip.project] sip-module="PyQt5.sip" -abi-version='12' +abi-version='12.8' diff --git a/pyproject-win.toml b/pyproject-win.toml index 3c4cd48..3678979 100644 --- a/pyproject-win.toml +++ b/pyproject-win.toml @@ -27,5 +27,5 @@ extra-link-args=['-L%CONDA_PREFIX%/Library/lib','-L%PREFIX%/Library/lib'] [tool.sip.project] sip-module="PyQt5.sip" -abi-version='12' +abi-version='12.8' From 86b08847c6b1cb567bd739f2aceb9c52a8b7488d Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Wed, 20 Aug 2025 16:59:54 +0200 Subject: [PATCH 05/16] simplify pinning, relying on those defined in condaforge pinning provided by OpenAlea CI --- conda/meta.yaml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index 9b2ad5f..1a6aaf6 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -23,18 +23,9 @@ requirements: - __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.14") }} # [osx and x86_64] build: - {{ compiler('cxx')}} + - {{ stdlib("c") }} - make # [unix] - pkg-config # [linux] - - sysroot_linux-64 # [linux64] - - binutils_impl_linux-64 # [linux] - - {{ cdt('mesa-libgl-devel') }} # [linux] - - {{ cdt('mesa-dri-drivers') }} # [linux] - - {{ cdt('libxext') }} # [linux] - - {{ cdt('libselinux') }} # [linux] - - {{ cdt('libxdamage') }} # [linux] - - {{ cdt('libxxf86vm') }} # [linux] - - {{ cdt('libxfixes') }} # [linux] - - {{ cdt('libxcb') }} # [linux] # from https://conda-forge.org/docs/maintainer/knowledge_base.html#libgl - python # [build_platform != target_platform] - sip # [build_platform != target_platform] @@ -42,15 +33,14 @@ requirements: host: - python - pip - - qt-main >=5.15 + - qt-main - pyqt - - libqglviewer >=2.8 + - libqglviewer - sip - pyqt5-sip - pyqt-builder - libxcb # [linux] - pthread-stubs # [linux] - - {{ cdt('mesa-libgl-devel') }} # [linux] - xorg-libxfixes # [linux] From 34719e26e5f44fb130aeb2c1b45b4a8a43ef31d7 Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Wed, 20 Aug 2025 17:27:34 +0200 Subject: [PATCH 06/16] restore libgl --- conda/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conda/meta.yaml b/conda/meta.yaml index 1a6aaf6..f9de9a3 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -26,6 +26,7 @@ requirements: - {{ stdlib("c") }} - make # [unix] - pkg-config # [linux] + - {{ cdt('mesa-libgl-devel') }} # [linux] # from https://conda-forge.org/docs/maintainer/knowledge_base.html#libgl - python # [build_platform != target_platform] - sip # [build_platform != target_platform] @@ -39,6 +40,7 @@ requirements: - sip - pyqt5-sip - pyqt-builder + - {{ cdt('mesa-libgl-devel') }} # [linux] - libxcb # [linux] - pthread-stubs # [linux] - xorg-libxfixes # [linux] From d4da9ad4cdf6946c856e6759ee2686e9caf07724 Mon Sep 17 00:00:00 2001 From: AurelienBesnier Date: Fri, 29 Aug 2025 13:21:43 +0200 Subject: [PATCH 07/16] Adding test --- conda/meta.yaml | 7 +++++++ test/test_pyqglviewer.py | 42 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 test/test_pyqglviewer.py diff --git a/conda/meta.yaml b/conda/meta.yaml index f9de9a3..860901b 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -56,5 +56,12 @@ requirements: - xorg-libxfixes # [linux] test: + requires: + - pytest + - pytest-qt imports: - PyQGLViewer + source_files: + - test/*.py + commands: + - pytest -v \ No newline at end of file diff --git a/test/test_pyqglviewer.py b/test/test_pyqglviewer.py new file mode 100644 index 0000000..c76584d --- /dev/null +++ b/test/test_pyqglviewer.py @@ -0,0 +1,42 @@ +from PyQGLViewer import * +import OpenGL.GL as ogl +import math + +def draw_qgl_logo(nbSteps = 200.0, specialColor = False): + ogl.glBegin(ogl.GL_QUAD_STRIP) + for i in range(0,int(nbSteps)): + ratio = i/float(nbSteps) + angle = 21.0*ratio + c = math.cos(angle) + s = math.sin(angle) + r1 = 1.0 - 0.8*ratio + r2 = 0.8 - 0.8*ratio + alt = ratio - 0.5 + nor = 0.5 + up = math.sqrt(1.0-nor*nor) + if specialColor: + ogl.glColor3f(1.0-ratio, .8 , ratio/2.0) + else: + ogl.glColor3f(1.0-ratio, 0.2 , ratio) + ogl.glNormal3f(nor*c, up, nor*s) + ogl.glVertex3f(r1*c, alt, r1*s) + ogl.glVertex3f(r2*c, alt+0.05, r2*s) + ogl.glEnd() + + +def test_pyqglviewer(qtbot): + + class Viewer(QGLViewer): + def __init__(self, parent=None): + QGLViewer.__init__(self, parent) + + def draw(self): + draw_qgl_logo() + + def main(): + viewer = Viewer() + viewer.setWindowTitle("simpleViewer") + viewer.show() + qtbot.addWidget(viewer) + + main() \ No newline at end of file From 0566d5af76d6222ec8d7050cdafe024c4496dab2 Mon Sep 17 00:00:00 2001 From: AurelienBesnier Date: Fri, 29 Aug 2025 13:34:17 +0200 Subject: [PATCH 08/16] Adding assertion --- test/test_pyqglviewer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_pyqglviewer.py b/test/test_pyqglviewer.py index c76584d..2c8353a 100644 --- a/test/test_pyqglviewer.py +++ b/test/test_pyqglviewer.py @@ -38,5 +38,6 @@ def main(): viewer.setWindowTitle("simpleViewer") viewer.show() qtbot.addWidget(viewer) + assert viewer.isVisible() main() \ No newline at end of file From 13b700d58d910dbdd1e26a65bb035871f48ba322 Mon Sep 17 00:00:00 2001 From: AurelienBesnier Date: Fri, 29 Aug 2025 13:41:56 +0200 Subject: [PATCH 09/16] Adding virtual test package --- conda/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/conda/meta.yaml b/conda/meta.yaml index 860901b..deb264f 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -59,6 +59,7 @@ test: requires: - pytest - pytest-qt + - pytest-xvfb imports: - PyQGLViewer source_files: From 42d7f608953826f154ac477677ade71ed51917ab Mon Sep 17 00:00:00 2001 From: AurelienBesnier Date: Fri, 29 Aug 2025 14:11:23 +0200 Subject: [PATCH 10/16] Testing gl func only on unix systems --- conda/meta.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index deb264f..dec5e9e 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -56,13 +56,13 @@ requirements: - xorg-libxfixes # [linux] test: - requires: - - pytest - - pytest-qt - - pytest-xvfb + requires: # [unix] + - pytest # [unix] + - pytest-qt # [unix] + - pytest-xvfb # [unix] imports: - PyQGLViewer - source_files: - - test/*.py - commands: - - pytest -v \ No newline at end of file + source_files: # [unix] + - test/*.py # [unix] + commands: # [unix] + - pytest -v # [unix] \ No newline at end of file From ba02e73252072add6dcf50cd900e3dc2cd70cb45 Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Thu, 4 Sep 2025 10:13:18 +0200 Subject: [PATCH 11/16] constrain no qt6 Add no qt6 as run constraint --- conda/meta.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index dec5e9e..5c02ad6 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -21,6 +21,9 @@ build: requirements: run_constrained: # [osx and x86_64] - __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.14") }} # [osx and x86_64] + # import of qt6 in same env clobber qt5 install + - pyside6 <0a0 + - qt6-main <0a0 build: - {{ compiler('cxx')}} - {{ stdlib("c") }} @@ -65,4 +68,4 @@ test: source_files: # [unix] - test/*.py # [unix] commands: # [unix] - - pytest -v # [unix] \ No newline at end of file + - pytest -v # [unix] From a3b2a2773ed7d7fd7ec1ee365884b0af70fff91a Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Thu, 4 Sep 2025 10:16:58 +0200 Subject: [PATCH 12/16] typo --- conda/meta.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index 5c02ad6..ab19109 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -19,8 +19,7 @@ build: number: 2 requirements: - run_constrained: # [osx and x86_64] - - __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.14") }} # [osx and x86_64] + run_constrained: # import of qt6 in same env clobber qt5 install - pyside6 <0a0 - qt6-main <0a0 From 6ea536c7e7c2cf1b662e3af7843e621b5aa2e611 Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Thu, 4 Sep 2025 10:53:23 +0200 Subject: [PATCH 13/16] release no qt6 run constraint Remove no qt6 run constraints, as it leads to incompatibilities with matplotlib install --- conda/meta.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index ab19109..44ffb69 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -19,10 +19,6 @@ build: number: 2 requirements: - run_constrained: - # import of qt6 in same env clobber qt5 install - - pyside6 <0a0 - - qt6-main <0a0 build: - {{ compiler('cxx')}} - {{ stdlib("c") }} From bd448094042429730dd9af960c3cb7be13927a11 Mon Sep 17 00:00:00 2001 From: christian34 Date: Thu, 11 Sep 2025 22:33:10 +0000 Subject: [PATCH 14/16] [openalea-bot] synced local '.github/workflows/' with remote 'workflow-templates/' --- .github/workflows/conda-package-build.yml | 23 ---------------- .github/workflows/openalea_ci.yml | 33 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 23 deletions(-) delete mode 100644 .github/workflows/conda-package-build.yml create mode 100644 .github/workflows/openalea_ci.yml diff --git a/.github/workflows/conda-package-build.yml b/.github/workflows/conda-package-build.yml deleted file mode 100644 index ed7d257..0000000 --- a/.github/workflows/conda-package-build.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: OpenAlea CI - -on: - push: - branches: - - main - - master - tags: - - 'v*' - pull_request: - types: - - opened - - synchronize - - reopened - release: - types: - - published - -jobs: - build: - uses: openalea/action-build-publish-anaconda/.github/workflows/openalea_ci.yml@main - secrets: - anaconda_token: ${{ secrets.ANACONDA_TOKEN }} diff --git a/.github/workflows/openalea_ci.yml b/.github/workflows/openalea_ci.yml new file mode 100644 index 0000000..3d610de --- /dev/null +++ b/.github/workflows/openalea_ci.yml @@ -0,0 +1,33 @@ +name: OpenAlea CI + +on: + push: + branches: + - main + - master + tags: + - 'v*' + pull_request: + types: + - opened + - synchronize + - reopened + release: + types: + - published + workflow_dispatch: + inputs: + check_before_tag: + description: "Run OpenAlea CI pre-tag build" + required: false + default: "true" + type: boolean + +run-name: > + ${{ github.event_name == 'workflow_dispatch' && 'OpenAlea CI pre-tag build' || 'OpenAlea CI' }} + +jobs: + build: + uses: openalea/action-build-publish-anaconda/.github/workflows/openalea_ci.yml@main + secrets: + anaconda_token: ${{ secrets.ANACONDA_TOKEN }} \ No newline at end of file From 28017a27054bb088df58fb0a395ce70cdd93b0ad Mon Sep 17 00:00:00 2001 From: christian34 Date: Tue, 16 Sep 2025 16:17:15 +0000 Subject: [PATCH 15/16] [openalea-bot] synced local '.github/workflows/' with remote 'workflow-templates/' --- .github/workflows/conda-package-build.yml | 23 ---------------- .github/workflows/openalea_ci.yml | 33 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 23 deletions(-) delete mode 100644 .github/workflows/conda-package-build.yml create mode 100644 .github/workflows/openalea_ci.yml diff --git a/.github/workflows/conda-package-build.yml b/.github/workflows/conda-package-build.yml deleted file mode 100644 index ed7d257..0000000 --- a/.github/workflows/conda-package-build.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: OpenAlea CI - -on: - push: - branches: - - main - - master - tags: - - 'v*' - pull_request: - types: - - opened - - synchronize - - reopened - release: - types: - - published - -jobs: - build: - uses: openalea/action-build-publish-anaconda/.github/workflows/openalea_ci.yml@main - secrets: - anaconda_token: ${{ secrets.ANACONDA_TOKEN }} diff --git a/.github/workflows/openalea_ci.yml b/.github/workflows/openalea_ci.yml new file mode 100644 index 0000000..3d610de --- /dev/null +++ b/.github/workflows/openalea_ci.yml @@ -0,0 +1,33 @@ +name: OpenAlea CI + +on: + push: + branches: + - main + - master + tags: + - 'v*' + pull_request: + types: + - opened + - synchronize + - reopened + release: + types: + - published + workflow_dispatch: + inputs: + check_before_tag: + description: "Run OpenAlea CI pre-tag build" + required: false + default: "true" + type: boolean + +run-name: > + ${{ github.event_name == 'workflow_dispatch' && 'OpenAlea CI pre-tag build' || 'OpenAlea CI' }} + +jobs: + build: + uses: openalea/action-build-publish-anaconda/.github/workflows/openalea_ci.yml@main + secrets: + anaconda_token: ${{ secrets.ANACONDA_TOKEN }} \ No newline at end of file From 62efedaf17a9ad08b78ebae8431ef8771c837ccf Mon Sep 17 00:00:00 2001 From: Christian Fournier Date: Tue, 16 Sep 2025 18:52:16 +0200 Subject: [PATCH 16/16] remove unused setup --- conda/meta.yaml | 7 ++---- setup.py.old | 62 ------------------------------------------------- 2 files changed, 2 insertions(+), 67 deletions(-) delete mode 100644 setup.py.old diff --git a/conda/meta.yaml b/conda/meta.yaml index fbfddcb..981986a 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,7 +1,6 @@ # do not edit the following line. It will be updated automatically #{% set data = load_setup_py_data() %} {% set version = environ.get('SETUPTOOLS_SCM_PRETEND_VERSION', "0.0.0.dev") %} -{% set version = environ.get('SETUPTOOLS_SCM_PRETEND_VERSION', "0.0.0.dev") %} package: name: pyqglviewer @@ -16,7 +15,6 @@ about: summary: PyQGLViewer is a set of Python bindings for the libQGLViewer C++ library which extends the Qt framework with widgets and tools that eases the creation of OpenGL 3D viewers. build: - string: py{{ PY_VER }} number: 2 string: py{{ PY_VER }} script_env: @@ -24,8 +22,7 @@ build: requirements: build: - - {{ compiler('cxx')}} - - {{ stdlib("c") }} + - {{ compiler('cxx')}} - make # [unix] - pkg-config # [linux] - {{ cdt('mesa-libgl-devel') }} # [linux] @@ -65,4 +62,4 @@ test: source_files: # [unix] - test/*.py # [unix] commands: # [unix] - - pytest -v # [unix] \ No newline at end of file + - pytest -v # [unix] \ No newline at end of file diff --git a/setup.py.old b/setup.py.old deleted file mode 100644 index 84a97ed..0000000 --- a/setup.py.old +++ /dev/null @@ -1,62 +0,0 @@ -# Header -import os, sys -pj = os.path.join - -name = 'PyQGLViewer' -description = 'Python bindings of libQGLViewer.' -long_description= 'PyQGLViewer is a set of Python bindings for the libQGLViewer C++ library which extends the Qt framework with widgets and tools that eases the creation of OpenGL 3D viewers.' -authors = 'Frédéric Boudon' -authors_email = 'frederic.boudon@cirad.fr' -url= 'https://github.com/fredboudon/PyQGLViewer' -# LGPL compatible INRIA license -license = 'Cecill-C' - -############## -# Setup script - - -# check that meta version is updated -def get_version(): - versionfile = open(pj(os.path.dirname(__file__),'sip', 'PyQGLViewer', 'qglviewerversion.sip')).read() - lid = versionfile.index('#define PYQGLVIEWER_VERSION') - version = int(versionfile[lid:versionfile.index('\n',lid)].split()[2],16) - major = (version & 0xff0000) >> 16 - minor = (version & 0x00ff00) >> 8 - rev = (version & 0x0000ff) - return str(major)+'.'+str(minor)+'.'+str(rev) - -version = get_version() - - -from setuptools import setup - - -setup( - name='PyQGLViewer', - # version=version, - # description=description, - # long_description=long_description, - # authors=authors, - # author_email=authors_email, - # url=url, - # license=license, - - use_scm_version=True, - setup_requires=['setuptools_scm'], - - # pure python packages - packages = [ - 'PyQGLViewer' - ], - - # python packages directory - package_dir = { '' : 'src',}, - - package_data={ - "": ['*.pyd', '*.so', '*.dylib'], - }, - - include_package_data = True, - zip_safe = False, - -)