Skip to content

Commit

Permalink
Merge branch 'main' of github.com:vispy/vispy into complex-volume
Browse files Browse the repository at this point in the history
  • Loading branch information
brisvag committed Oct 23, 2023
2 parents 3ad2e95 + c366456 commit bac8c07
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 20 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
sleep 5
# export python_version
echo "python_version=310" >> $GITHUB_OUTPUT
- uses: mamba-org/provision-with-micromamba@v16
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./ci/requirements/py${{ steps.vars.outputs.python_version }}.yml
- name: Install conda-dependencies
Expand Down Expand Up @@ -169,17 +169,17 @@ jobs:
matrix:
include:
- test_number: 1
python_version: "3.8"
python_version: "3.9"
deps: "min"
test: "standard"
new_qt: false
- test_number: 2
python_version: "3.8"
python_version: "3.9"
deps: "full"
test: "standard"
new_qt: false
- test_number: 3
python_version: "3.8"
python_version: "3.9"
deps: "osmesa"
test: "osmesa"
new_qt: false
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
# export python_version
PY_VER=${{ matrix.python_version }}
echo "python_version=${PY_VER//.}" >> $GITHUB_OUTPUT
- uses: mamba-org/provision-with-micromamba@v16
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./ci/requirements/py${{ steps.vars.outputs.python_version }}.yml
- name: Install conda-dependencies
Expand Down Expand Up @@ -254,7 +254,7 @@ jobs:
export DISPLAY=:99.0
fi
if [ "${{ matrix.test }}" == 'osmesa' ]; then
export OSMESA_LIBRARY=~/micromamba-root/envs/vispy-tests/lib/libOSMesa32.so;
export OSMESA_LIBRARY=~/micromamba/envs/vispy-tests/lib/libOSMesa.so;
export VISPY_GL_LIB=$OSMESA_LIBRARY
fi
micromamba list
Expand All @@ -267,7 +267,7 @@ jobs:
python make test unit --tb=short
fi
if [ "${{ matrix.test }}" == 'osmesa' ]; then
export OSMESA_LIBRARY=~/micromamba-root/envs/vispy-tests/lib/libOSMesa32.so
export OSMESA_LIBRARY=~/micromamba/envs/vispy-tests/lib/libOSMesa.so
export VISPY_GL_LIB=$OSMESA_LIBRARY
make osmesa
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
CIBW_TEST_COMMAND: "python -c \"import vispy; vispy.test('nobackend')\""
CIBW_BUILD_VERBOSITY: "2"
# Get numpy release candidate to have Python 3.12 compatibility (hopefully)
CIBW_BEFORE_BUILD: "pip install -U Cython pip setuptools; pip install -U --pre numpy"
CIBW_BEFORE_TEST: "pip install -U Cython pip setuptools; pip install -U --pre numpy"
CIBW_BEFORE_BUILD: "python -m pip install -U Cython pip setuptools"
CIBW_BEFORE_TEST: "python -m pip install -U Cython pip setuptools"
#CIBW_BEFORE_BUILD_MACOS: "pip install -U pip setuptools"
CIBW_BEFORE_BUILD_LINUX: "yum install -y fontconfig || apk add fontconfig-dev jpeg-dev; pip install freetype-py"
# If freetype-py is installed from source (no wheel found), include bundled freetype library
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ node_modules/
vispy/static/
vispy/version.py
.vscode
vispy/visuals/text/_sdf_cpu*.pyd
vispy/visuals/text/_sdf_cpu*.pyd
.spyproject
2 changes: 1 addition & 1 deletion ci/requirements/linux_osmesa_deps_conda.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
coveralls
cython
libglu
mesalib <21.0.0
mesalib
meshio
numpy
pillow
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements/py38.yml → ci/requirements/py39.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ name: vispy-tests
channels:
- conda-forge
dependencies:
- python=3.8
- python=3.9
- pip
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"""

import os
import sys
from os import path as op
from setuptools import setup, find_packages

Expand Down Expand Up @@ -59,6 +60,10 @@ def set_builtin(name, value):
),
]

install_requires = ['numpy', 'freetype-py', 'hsluv', 'kiwisolver', 'packaging']
if sys.version_info < (3, 9):
install_requires.append("importlib-resources")

readme = open('README.rst', 'r').read()
setup(
name=name,
Expand Down Expand Up @@ -92,7 +97,7 @@ def set_builtin(name, value):
platforms='any',
provides=['vispy'],
python_requires='>=3.8',
install_requires=['numpy', 'freetype-py', 'hsluv', 'kiwisolver', 'packaging'],
install_requires=install_requires,
extras_require={
'ipython-static': ['ipython'],
'pyglet': ['pyglet>=1.2'],
Expand Down
14 changes: 7 additions & 7 deletions vispy/app/backends/_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ def __init__(self, vispy_canvas, **kwargs):

# must set physical size before setting visible or fullscreen
# operations may make the size invalid
if hasattr(self, 'devicePixelRatio'):
if hasattr(self, 'devicePixelRatioF'):
# handle high DPI displays in PyQt5
ratio = self.devicePixelRatio()
ratio = self.devicePixelRatioF()
else:
ratio = 1
self._physical_size = (p.size[0] * ratio, p.size[1] * ratio)
Expand Down Expand Up @@ -421,7 +421,7 @@ def screen_changed(self, new_screen):
If display resolutions are the same this is essentially a no-op except for the redraw.
If the display resolutions differ (HiDPI versus regular displays) the canvas needs to
be redrawn to reset the physical size based on the current `devicePixelRatio()` and
be redrawn to reset the physical size based on the current `devicePixelRatioF()` and
redrawn with that new size.
"""
Expand Down Expand Up @@ -909,11 +909,11 @@ def initializeGL(self):
def resizeGL(self, w, h):
if self._vispy_canvas is None:
return
if hasattr(self, 'devicePixelRatio'):
# We take into account devicePixelRatio, which is non-unity on
if hasattr(self, 'devicePixelRatioF'):
# We take into account devicePixelRatioF, which is non-unity on
# e.g HiDPI displays.
# self.devicePixelRatio() is a float and should have been in Qt5 according to the documentation
ratio = self.devicePixelRatio()
# self.devicePixelRatioF() is a float and should have been in Qt5 according to the documentation
ratio = self.devicePixelRatioF()
w = int(w * ratio)
h = int(h * ratio)
self._vispy_set_physical_size(w, h)
Expand Down

0 comments on commit bac8c07

Please sign in to comment.