diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..e7d6c20c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,83 @@ +# 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 + +jobs: + test_opengl: + 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. +# maybe as simple as: https://github.com/marketplace/actions/setup-opengl +# - 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 + + 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 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..e4b0ce29 100644 --- a/accelerate/src/vbo.pyx +++ b/accelerate/src/vbo.pyx @@ -188,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 ) @@ -242,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: