%global pypi_name vispy Name: python-%{pypi_name} Version: 0.14.2 Release: %{autorelease} Summary: Interactive visualization in Python %global forgeurl0 https://github.com/vispy/vispy %global forgeurl1 https://github.com/vispy/test-data %global tag1 test-data-10 %forgemeta -a License: BSD-3-Clause URL: http://vispy.org/ Source0: %forgesource0 Source1: %forgesource1 BuildRequires: gcc BuildRequires: git-core BuildRequires: glfw BuildRequires: libglvnd-gles BuildRequires: libXi BuildRequires: mesa-dri-drivers BuildRequires: mesa-libEGL BuildRequires: mesa-libGL BuildRequires: python3-devel BuildRequires: python3dist(pytest) # Tests need `QtOpenGLWidgets` which is not in the base package. BuildRequires: python3-pyqt6 BuildRequires: (xdpyinfo or xrandr) BuildRequires: xorg-x11-server-Xvfb %global _description %{expand: VisPy is a high-performance interactive 2D/3D data visualization library. VisPy leverages the computational power of modern Graphics Processing Units (GPUs) through the OpenGL library to display very large datasets. Applications of VisPy include: - High-quality interactive scientific plots with millions of points - Direct visualization of real-time data - Fast interactive visualization of 3D models (meshes, volume rendering) - OpenGL visualization demos - Scientific GUIs with fast, scalable visualization widgets (Qt or IPython notebook with WebGL)} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} Requires: (xdpyinfo or xrandr) Requires: (python3-pyqt6 if (python3-vispy+pyqt6 or python3-vispy+pyside6)) %description -n python3-%{pypi_name} %_description # Excluded extra's: # `pyqt5` - deprecated Qt5 bindings (use PyQt6) # `pyside` - deprecated Qt4 bindings (use PySide6 and Qt6) # `pyside2` - deprecated Ot5 bindings (use PySide6 and Qt6) %pyproject_extras_subpkg -n python3-%{pypi_name} ipython-static pyglet pyqt6 pyside6 sdl2 wx tk io %prep %forgeautosetup -p1 # Install test data (needs git repo) mkdir -p %{_builddir}/.vispy/test_data pushd %{_builddir}/.vispy/test_data tar xzf %{SOURCE1} --strip-components=1 git init git config user.name "Fedora" git config user.email "fedora@example.org" git add --all git commit -m "[Fedora] Test data for vispy" git tag %tag1 popd sed -r \ -e 's/oldest-supported-numpy/numpy/' \ -i pyproject.toml # Disable coverage for tests sed -r \ -e 's/coverage=True/coverage=False/' \ -i make/make.py %generate_buildrequires %pyproject_buildrequires -x ipython-static,pyglet,pyqt6,pyside6,sdl2,wx,tk,io %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{pypi_name} %check # https://github.com/vispy/vispy/blob/main/.github/workflows/main.yml # Start xvfb mkdir tmp export DISPLAY=:99.0 Xvfb :99 -screen 0 1400x900x24 -ac +extension GLX +render >/dev/null 2>&1 & sleep 5 # Tests requiring network k="${k-}${k+ and }not test_read_write_image" k="${k-}${k+ and }not test_wavefront" k="${k-}${k+ and }not test_config" k="${k-}${k+ and }not test_perspective_render" k="${k-}${k+ and }not test_panzoom" k="${k-}${k+ and }not test_turntable_gesture_zoom" k="${k-}${k+ and }not test_perspective_render" # Tests appears to hang or requires interaction (graphical test) k="${k-}${k+ and }not test_run" # Failing `pyglet` tests # AttributeError: module 'pyglet.window' has no attribute 'get_platform' pyglet="${pyglet-}${pyglet+ and }not test_fs" # AssertionError: assert 343 <= (3 + 20) pyglet="${pyglet-}${pyglet+ and }not test_multiple_canvases" # Failing `pyside6` tests # Fatal Python error: Segmentation fault pyside6="${pyside6-}${pyside6+ and }not test_functionality_proxy" pyside6="${pyside6-}${pyside6+ and }not test_init" # Failing `wx` tests # IndexError: list index out of range wx="${wx-}${wx+ and }not test_frame_buffer_helper" # AssertionError wx="${wx-}${wx+ and }not test_canvas_render" wx="${wx-}${wx+ and }not test_blend_presets" # Failing `tkinter` tests # Fatal Python error: Segmentation fault tk="${tk-}${tk+ and }not test_image_clims_and_gamma" # IndexError: list index out of range tk="${tk-}${tk+ and }not test_frame_buffer_helper" # AssertionError tk="${tk-}${tk+ and }not test_canvas_render" tk="${tk-}${tk+ and }not test_blend_presets" %{py3_test_envvars} %{python3} -c "import vispy; print(vispy.sys_info())" # Upstream provides a utility for testing. # Usage: python3 make test # Passing args to the script fails. Call it without the wrapper. %{py3_test_envvars} HOME=%{_builddir} _VISPY_TESTING_APP=nobackend \ %{python3} -m pytest -v -m 'not vispy_app_test' ${k+-k }"${k-}" \ -ra %{buildroot}%{python3_sitearch}/vispy %{py3_test_envvars} HOME=%{_builddir} _VISPY_TESTING_APP=pyglet \ %{python3} -m pytest -v -m 'vispy_app_test' \ ${k+-k }"${k-}${pyglet+ and }${pyglet-}" \ -ra %{buildroot}%{python3_sitearch}/vispy %{py3_test_envvars} HOME=%{_builddir} _VISPY_TESTING_APP=pyqt6 \ %{python3} -m pytest -v -m 'vispy_app_test' \ ${k+-k }"${k-}" \ -ra %{buildroot}%{python3_sitearch}/vispy %{py3_test_envvars} HOME=%{_builddir} _VISPY_TESTING_APP=pyside6 \ %{python3} -m pytest -v -m 'vispy_app_test' \ ${k+-k }"${k-}${pyside6+ and }${pyside6-}" \ -ra %{buildroot}%{python3_sitearch}/vispy %{py3_test_envvars} HOME=%{_builddir} _VISPY_TESTING_APP=sdl2 \ %{python3} -m pytest -v -m 'vispy_app_test' \ ${k+-k }"${k-}" \ -ra %{buildroot}%{python3_sitearch}/vispy %{py3_test_envvars} HOME=%{_builddir} _VISPY_TESTING_APP=wx \ %{python3} -m pytest -v -m 'vispy_app_test' \ ${k+-k }"${k-}${wx+ and }${wx-}" \ -ra %{buildroot}%{python3_sitearch}/vispy %{py3_test_envvars} HOME=%{_builddir} _VISPY_TESTING_APP=tkinter \ %{python3} -m pytest -v -m 'vispy_app_test' \ ${k+-k }"${k-}${tk+ and }${tk-}" \ -ra %{buildroot}%{python3_sitearch}/vispy %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.rst CHANGELOG.md CITATION.rst %changelog %autochangelog