Skip to content

Commit

Permalink
MNT: Add support for PySide6 (#147)
Browse files Browse the repository at this point in the history
* prepare

* fix

* revert

* pyqt5

* pyside

* bump python version

* fix

* revert

* revert

* try again

* Update .ci/setup_headless_display.sh

* Update .github/workflows/ci.yml

* update

* fetch highest

* remove cruft

* just in case

* update logo

* fix

* py3.10

* try again

* fix

* revert

Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
  • Loading branch information
GuillaumeFavelier and larsoner authored Mar 1, 2022
1 parent 7c7ded8 commit 698d729
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .ci/setup_headless_display.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -ef

sudo apt-get update
sudo apt-get install -yqq libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libopengl0
sudo apt-get install -yqq libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libopengl0 libegl1
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset
18 changes: 7 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ on:

jobs:
pip-pre:
name: ubuntu-latest / Python3.9 / PySide2 / pyvista-main / qtpy-master
name: ubuntu-latest / Python3.9 / ${{ matrix.pyside }} / pyvista-main / qtpy-master
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pyside: ['PySide2', 'PySide6']
defaults:
run:
shell: bash
Expand All @@ -32,13 +34,11 @@ jobs:
name: 'Setup python'
- run: |
python -m pip install --upgrade pip wheel
wget -q https://osf.io/kej3v/download -O vtk-9.0.20201117-cp39-cp39-linux_x86_64.whl
pip install --progress-bar off vtk-9.0.20201117-cp39-cp39-linux_x86_64.whl
pip install --progress-bar off https://github.com/pyvista/pyvista/zipball/main
pip install --progress-bar off https://github.com/spyder-ide/qtpy/zipball/master
pip install --upgrade -r requirements_test.txt
name: 'Install dependencies with pip'
- run: pip install PySide2
- run: pip install ${{ matrix.pyside }}
name: 'Install Qt binding'
- run: |
pip install -e .
Expand All @@ -51,7 +51,7 @@ jobs:
name: 'Upload coverage to CodeCov'

pip:
name: ${{ matrix.os }} / pip / pyvista-${{ matrix.pyvista }}
name: ${{ matrix.os }} / pip / PyQt5 / pyvista-${{ matrix.pyvista }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -64,7 +64,7 @@ jobs:
env:
ALLOW_PLOTTING: 'true'
DISPLAY: ':99'
PYTHON_VERSION: '3.8'
PYTHON_VERSION: '3.9'
steps:
- uses: actions/checkout@v2
- run: .ci/setup_headless_display.sh
Expand All @@ -86,11 +86,7 @@ jobs:
name: 'Install dependencies with pip'
- run: pip install PyQt5
name: 'Install Qt binding'
if: matrix.os == 'macos-latest'
- run: pip install PySide2
name: 'Install Qt binding'
if: matrix.os != 'macos-latest'
- run: pip install pyvista==${{ matrix.pyvista }}
- run: pip install --upgrade "pyvista==${{ matrix.pyvista }}.*"
name: 'Install PyVista'
- run: |
pip install -e .
Expand Down
Binary file modified docs/_static/pyvista_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/pyvista_logo_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pyvistaqt/data/pyvista_logo_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyvistaqt/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(
self.accepted.connect(self.emit_accepted)

if directory:
self.FileMode(QFileDialog.DirectoryOnly)
self.FileMode(QFileDialog.Directory)
self.setOption(QFileDialog.ShowDirsOnly, True)

if save_mode:
Expand Down
2 changes: 1 addition & 1 deletion pyvistaqt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _setup_ipython(ipython: Any = None) -> Any:
from IPython import get_ipython

ipython = get_ipython()
ipython.magic("gui qt")
ipython.run_line_magic("gui", "qt")

# pylint: disable=redefined-outer-name
# pylint: disable=import-outside-toplevel
Expand Down
6 changes: 4 additions & 2 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ def test_editor(qtbot, plotting):
with qtbot.wait_exposed(editor):
editor.toggle()
assert editor.isVisible()
plotter.close()
editor.close()
assert not editor.isVisible()
plotter.close()

# editor=True by default
plotter = BackgroundPlotter(shape=(2, 1), off_screen=False)
Expand Down Expand Up @@ -803,7 +804,8 @@ def _create_testing_scene(empty_scene, show=False, off_screen=False):
border_width=10,
border_color='grey',
show=show,
off_screen=off_screen
off_screen=off_screen,
update_app_icon=False,
)
plotter.set_background('black', top='blue')
plotter.subplot(0, 0)
Expand Down

0 comments on commit 698d729

Please sign in to comment.