14
0

Accepting request 966735 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/966735
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-opengl-accelerate?expand=0&rev=11
This commit is contained in:
2022-04-04 17:26:31 +00:00
committed by Git OBS Bridge
6 changed files with 101 additions and 41 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:12e5518b0216a478527c7ce5ddce623c3d0517adeb87226da767772e8b7f2f06
size 538350

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f022fff9456e7a0ecd3e5ed2c3e598c917c527f6b418fcd99dc4f90c7e7f7645
size 588161

27
_service Normal file
View File

@@ -0,0 +1,27 @@
<!--
# vim: set syntax=xml
-->
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/mcfletch/pyopengl</param>
<param name="scm">git</param>
<param name="include">accelerate</param>
<!-- INFO: This is latest revision as of 20220401
<param name="revision">227f9c66976d9f5dadf62b9a97e6beaec84831ca</param>
-->
<param name="versionformat">%h</param>
<!-- Not sure if it's because of a lack of tagging, etc
but this was the only hacky way I could make this work
Not sure if it's a limitation of 'obs-service-tar_scm'
or my understanding of it.
-->
<param name="versionrewrite-pattern">227f9c66</param>
<param name="versionrewrite-replacement">3.1.6</param>
<param name="filename">PyOpenGL-accelerate</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
</services>

View File

@@ -1,3 +1,21 @@
-------------------------------------------------------------------
Fri Apr 1 18:52:20 UTC 2022 - Scott Bradnick <scott.bradnick@suse.com>
- Adding _service file
- Cleaning up Source0 declaration since PyPI doesn't have a tarball
- Updating hash for 'accelerate/test' Source[1,2]
- Adding code to %prep section to deal w/ how _service pulls down
files for the gzip'd tarball
-------------------------------------------------------------------
Thu Mar 31 15:25:18 UTC 2022 - Scott Bradnick <scott.bradnick@suse.com>
- Update to 3.1.6
* Pulled directly from https://github.com/mcfletch/pyopengl since
pypi.org (via py2pack fetch) doesn't have this version available.
* Seems that some packages which use PyOpenGL and accelerate have
a soft requirement that they're the same version.
-------------------------------------------------------------------
Tue Mar 23 20:48:03 UTC 2021 - Ben Greiner <code@bnavigator.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-opengl-accelerate
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define tarname PyOpenGL-accelerate
%define _version 3.1.5
%define _version 3.1.6
Name: python-opengl-accelerate
Version: %{_version}
Release: 0
@@ -26,10 +26,11 @@ Summary: Acceleration for python-opengl
License: BSD-3-Clause
Group: Development/Libraries/Python
URL: http://pyopengl.sourceforge.net
Source0: https://files.pythonhosted.org/packages/source/P/%{tarname}/%{tarname}-%{_version}.tar.gz
Source0: %{tarname}-%{_version}.tar.gz
# test files: GitHub repo has no tags, use commit hash
Source1: https://github.com/mcfletch/pyopengl/raw/6ec398da44/accelerate/tests/test_arraydatatypeaccel.py
Source2: https://github.com/mcfletch/pyopengl/raw/6ec398da44/accelerate/tests/test_numpyaccel.py
Source1: https://github.com/mcfletch/pyopengl/raw/c26398b91a/accelerate/tests/test_arraydatatypeaccel.py
Source2: https://github.com/mcfletch/pyopengl/raw/c26398b91a/accelerate/tests/test_numpyaccel.py
#
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module opengl >= %{version}}
@@ -51,6 +52,12 @@ code.
%prep
%setup -q -n %{tarname}-%{_version}
# _service pulldown creates %%{tarname}-%%{_version}/accelerate/<required files>,
# move them to root of build area and remove 'accelerate' directory
# to continue as normal.
mv accelerate/* ./
rmdir accelerate
# Force Cython to rebuild .c files
rm src/*.c

View File

@@ -3,12 +3,18 @@ from OpenGL.arrays import arraydatatype as adt
from OpenGL.arrays import vbo
from OpenGL import GL
from OpenGL._bytes import integer_types
import pytest
try:
import numpy
except ImportError:
numpy = None
try:
import OpenGL_accelerate
except ImportError:
pytest.skip('Accelerate not installed, skipping', allow_module_level=True)
class _BaseTest( object ):
array = None
def setUp( self ):
self.handler = adt.ArrayDatatype
assert self.handler.isAccelerated
@@ -38,14 +44,16 @@ class _BaseTest( object ):
p = self.handler.arrayToGLType( self.array )
assert p == GL.GL_FLOAT
if numpy:
# Skip if modifies the functions, which are *shared* between the
# classes...
#@pytest.mark.skipif( not numpy, reason="Numpy not available")
class TestNumpy( _BaseTest, unittest.TestCase ):
# Skip if modifies the functions, which are *shared* between the
# classes...
@pytest.mark.skipif( not numpy, reason="Numpy not available")
class TestNumpy( _BaseTest, unittest.TestCase ):
def setUp( self ):
self.array = numpy.array( [[1,2,3],[4,5,6]],'f')
super(TestNumpy,self).setUp()
self.array = numpy.array( [[1,2,3],[4,5,6]],'f')
handler = adt.ArrayDatatype.getHandler( self.array )
handler.registerReturn( )
def test_dataPointer( self ):
p = self.handler.dataPointer( self.array )
assert isinstance( p, integer_types)
@@ -69,7 +77,7 @@ if numpy:
p = self.handler.asArray( numpy.array( [1,2,3],'d'), GL.GL_FLOAT )
assert p.dtype == numpy.float32
def test_zeros_small( self ):
z = self.handler.zeros( 0, GL.GL_BYTE )
z = self.handler.zeros( (0,), GL.GL_BYTE )
assert z.dtype == numpy.byte, z
class TestVBO( _BaseTest, unittest.TestCase ):