From 509813f6a1bcdbef5c7b20d519bc9696468c2a2a Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Fri, 20 Jun 2025 13:09:58 -0700 Subject: [PATCH 1/5] added test workflow --- .github/workflows/test.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..bfc26413 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,46 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: test + +on: [push, pull_request] +# on: + # push: + # branches: [ "master" ] + # pull_request: + # branches: [ "master" ] + +jobs: + build: + strategy: + fail-fast: false + matrix: +# tox could handle the python matrix -- but this way we get better reporting from gitHub actions + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install pyopengl + run: | + python -m pip install --upgrade pip + python -m pip install . + + - name: Install test dependencies + run: | + python -m pip install numpy psutil pygame pytest + + - name: Test pyopengl + run: | + pytest tests + + # - name: Test with tox + # run: | + # tox + From 3f7787dc224b925ff8f8490530d5ab1ac76ad6c9 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Fri, 20 Jun 2025 13:45:20 -0700 Subject: [PATCH 2/5] cleaned up test config a bit -- tests not passing, but aren't passing on my local machine either. --- .github/workflows/test.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bfc26413..0fdfda63 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,21 +3,24 @@ name: test -on: [push, pull_request] -# on: - # push: - # branches: [ "master" ] - # pull_request: - # branches: [ "master" ] +on: + - push + - pull_request jobs: build: strategy: fail-fast: false matrix: -# tox could handle the python matrix -- but this way we get better reporting from gitHub actions +# tox could handle the python matrix -- but this way we get better +# separation and reporting from gitHub actions python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - os: [ubuntu-latest, windows-latest, macos-latest] + os: +# Ubuntu test runners don't have OpenGL +# I *think* Mesa could be installed, but haven't figured that out yet. +# - ubuntu-latest + - windows-latest + - macos-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -40,7 +43,4 @@ jobs: run: | pytest tests - # - name: Test with tox - # run: | - # tox From 641f3d080b264640e605eb1a4b78174517e45b71 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Fri, 20 Jun 2025 14:02:28 -0700 Subject: [PATCH 3/5] applied patch to make accelerate compile -- added tests for accelerate --- .github/workflows/test.yml | 40 +++++++++++++++++++++++++++++++++++++- accelerate/src/vbo.pyx | 1 + 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fdfda63..a8fc61a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: - pull_request jobs: - build: + test_opengl: strategy: fail-fast: false matrix: @@ -18,6 +18,7 @@ jobs: os: # Ubuntu test runners don't have OpenGL # I *think* Mesa could be installed, but haven't figured that out yet. +# maybe as simple as: https://github.com/marketplace/actions/setup-opengl # - ubuntu-latest - windows-latest - macos-latest @@ -43,4 +44,41 @@ jobs: run: | pytest tests + test_opengl-accelerate: + strategy: + fail-fast: false + matrix: +# tox could handle the python matrix -- but this way we get better +# separation and reporting from gitHub actions + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + os: +# Ubuntu test runners don't have OpenGL +# I *think* Mesa could be installed, but haven't figured that out yet. +# - ubuntu-latest + - windows-latest + - macos-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Accelerate + run: | + python -m pip install --upgrade pip + python -m pip install . # also need PyOpenGL + python -m pip install accelerate/ + + - name: Install test dependencies + run: | + cd accelerate + python -m pip install -r test-requirements.txt + + - name: Test Accelerate + run: | + cd accelerate + pytest tests diff --git a/accelerate/src/vbo.pyx b/accelerate/src/vbo.pyx index 13f9e99d..6e92c059 100644 --- a/accelerate/src/vbo.pyx +++ b/accelerate/src/vbo.pyx @@ -1,6 +1,7 @@ """Cython-coded VBO implementation""" #cython: language_level=3 import ctypes, weakref +from ctypes import c_long as long from OpenGL_accelerate.formathandler cimport FormatHandler from OpenGL import error from OpenGL._bytes import bytes,unicode From 92abdc4098915d7fe82265503416864285ca6633 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Fri, 20 Jun 2025 14:05:15 -0700 Subject: [PATCH 4/5] removed extra install of PyOpenGL --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8fc61a6..e7d6c20c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,7 +69,6 @@ jobs: - name: Install Accelerate run: | python -m pip install --upgrade pip - python -m pip install . # also need PyOpenGL python -m pip install accelerate/ - name: Install test dependencies From f88d98b96b5e76ef624705ad2078e49ef202bc99 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Thu, 10 Jul 2025 14:38:24 -0700 Subject: [PATCH 5/5] updated fix for python2 long type to use python int. --- accelerate/src/vbo.pyx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/accelerate/src/vbo.pyx b/accelerate/src/vbo.pyx index 6e92c059..e4b0ce29 100644 --- a/accelerate/src/vbo.pyx +++ b/accelerate/src/vbo.pyx @@ -1,7 +1,6 @@ """Cython-coded VBO implementation""" #cython: language_level=3 import ctypes, weakref -from ctypes import c_long as long from OpenGL_accelerate.formathandler cimport FormatHandler from OpenGL import error from OpenGL._bytes import bytes,unicode @@ -189,8 +188,8 @@ cdef class VBO: assert not self.created, """Already created the buffer""" buffers = self.get_implementation().glGenBuffers(1) try: - self.buffer = long( buffers ) - except (TypeError,ValueError) as err: + self.buffer = int( buffers ) + except (TypeError, ValueError) as err: self.buffer = buffers[0] self.target = self.c_resolve( self.target_spec ) self.usage = self.c_resolve( self.usage_spec ) @@ -243,7 +242,7 @@ cdef class VBO: """Add an integer to this VBO (offset)""" if hasattr( other, 'offset' ): other = other.offset - assert isinstance( other, (int,long) ), """Only know how to add integer/long offsets""" + assert isinstance( other, int), """Only know how to add integer offsets""" return VBOOffset( self, other ) cdef int check_live( self ): if self.data is _NULL: