Skip to content

Commit

Permalink
Merge pull request #112 from SciKit-Surgery/110-pyside6
Browse files Browse the repository at this point in the history
110 - pyside6
  • Loading branch information
mxochicale committed Mar 30, 2023
2 parents 7b341bd + 7a2532a commit dc9f7ff
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 50 deletions.
98 changes: 80 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,59 @@ on: push
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-latest, windows-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
python-ver: [3.8]
experimental: [false]
include:
- python-ver: 3.9
os: ubuntu-latest
experimental: true
- python-ver: 3.9
os: windows-latest
experimental: true
- python-ver: 3.9
os: macos-latest
experimental: true
- python-ver: '3.10'
os: ubuntu-latest
experimental: true
- python-ver: '3.10'
os: macos-latest
experimental: true
- python-ver: '3.10'
os: windows-latest
experimental: true
- python-ver: 3.11
os: ubuntu-latest
experimental: true
- python-ver: 3.11
os: macos-latest
experimental: true
- python-ver: 3.11
os: windows-latest
experimental: true
- python-ver: 3.12-dev
os: ubuntu-latest
experimental: true
- python-ver: 3.12-dev
os: macos-latest
experimental: true
- python-ver: 3.12-dev
os: windows-latest
experimental: true

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 10

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: ${{ matrix.python-ver }}


# VTK uses OpenGL 2.0, but the windows Server version used on
Expand All @@ -36,38 +78,58 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
pip install -r requirements-dev.txt
- name: Run tox on ubuntu using xvfb
- name: Install dependencies and run tests using xvfb (ubuntu-latest)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install xvfb libxkbcommon-x11-0
sudo Xvfb :1 -screen 0 1024x768x24 </dev/null &
export DISPLAY=":1"
export LD_LIBRARY_PATH=$pythonLocation"/lib/python3.7/site-packages/PySide2/Qt/plugins/platfoms"
tox
sudo apt-get update
sudo apt-get install xvfb
sudo apt-get install libegl-dev
## Qt for X11 Requirements> https://doc.qt.io/qt-6/linux-requirements.html
sudo apt-get install libfontconfig1-dev libfreetype6-dev
sudo apt-get install libx11-dev libx11-xcb-dev
sudo apt-get install libxext-dev libxfixes-dev
sudo apt-get install libxi-dev libxrender-dev
sudo apt-get install libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev
sudo apt-get install libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev
sudo apt-get install libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev
sudo apt-get install libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev
sudo apt-get install libxkbcommon-dev libxkbcommon-x11-dev
export DISPLAY=:1
sudo Xvfb $DISPLAY -screen 0 1024x768x24 </dev/null &
export QT_DEBUG_PLUGINS=0
export LD_LIBRARY_PATH=$pythonLocation"/lib/python${{ matrix.python-version }}/site-packages/PySide6/Qt/plugins/platforms"
coverage erase
coverage run -a --source ./sksurgerybard -m pytest -v -s
coverage report -m
- name: Run tox on windows/mac
- name: Run tests Windows/Mac
# Matches the 'o' in 'windows' or 'macos'
if: contains(matrix.os, 'o')
run: |
tox
coverage erase
coverage run -a --source ./sksurgerybard -m pytest -v -s
coverage report -m
- name: Linting
run: |
pylint --rcfile=tests/pylintrc sksurgerybard
- name: Run coveralls
run: |
pip install coveralls pyyaml
coveralls
deploy:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8

- name: Install dependencies
run: python -m pip install wheel twine setuptools versioneer
Expand Down
15 changes: 12 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Basic Augmented Reality Demo.
:target: https://github.com/SciKit-Surgery/scikit-surgerybard
:alt: Logo

|
.. image:: https://github.com/SciKit-Surgery/scikit-surgerybard/workflows/.github/workflows/ci.yml/badge.svg
:target: https://github.com/SciKit-Surgery/scikit-surgerybard/actions
:alt: Travis CI test status
Expand All @@ -32,16 +34,23 @@ Basic Augmented Reality Demo.
:alt: Follow scikit_surgery on twitter


Authors: Matt Clarkson, Mian Ahmad, Tom Dowrick, Stephen Thompson
Author(s): Stephen Thompson and Matt Clarkson;
Contributor(s): Miguel Xochicale, Thomas Dowrick, and Mian Ahmad.

Basic Augmented Reality Demo (BARD) is part of the `SciKit-Surgery`_ software project, developed at the `Wellcome EPSRC Centre for Interventional and Surgical Sciences`_, part of `University College London (UCL)`_.

The BARD is tested on Python 3.6.
The BARD is tested on Python 3.8. and may support other Python versions.


Developing
----------


Encountering Problems?
^^^^^^^^^^^^^^^^^^^^^^
Please get in touch or raise an `issue`_.


Contributing
^^^^^^^^^^^^

Expand Down Expand Up @@ -77,4 +86,4 @@ Supported by `Wellcome`_ and `EPSRC`_.
.. _`EPSRC`: https://www.epsrc.ac.uk/
.. _`contributing guidelines`: https://github.com/SciKit-Surgery/scikit-surgerybard/blob/master/CONTRIBUTING.rst
.. _`license file`: https://github.com/SciKit-Surgery/scikit-surgerybard/blob/master/LICENSE

.. _`issue`: https://github.com/SciKit-Surgery/scikit-surgerybard/issues/new
5 changes: 3 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ coveralls
mock
pyfakefs
parameterized
pylint>2.13
pylint<=2.17.0
sphinx
sphinx_rtd_theme
pyinstaller
pytest
tox
vtk<=9.0.1
vtk>=9.2.5
versioneer
pyyaml
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# doc/requirements.rst
numpy
glob2
PySide2<5.15.0
scikit-surgerycalibration>=0.1.9
scikit-surgerycore>=0.6.8
scikit-surgeryutils>=1.2.1
scikit-surgeryvtk
scikit-surgeryarucotracker>=0.2.5
opencv-contrib-python-headless
pyside6>=6.4.2
scikit-surgerycalibration>=0.2.4
scikit-surgerycore>=0.6.10
scikit-surgeryutils==2.0rc0
scikit-surgeryvtk==2.0rc0
scikit-surgeryarucotracker>=1.0.1
opencv-contrib-python-headless>=4.2.0.32
#scikit-surgeryspeech>=0.2.0 #uncomment this to use speech interface
#PocketSphinx # uncomment this to use speech with sphinx
15 changes: 7 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@


'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',

'Topic :: Scientific/Engineering :: Information Analysis',
Expand All @@ -56,13 +55,13 @@
install_requires=[
'numpy',
'glob2',
'PySide2<5.15.0',
'opencv-contrib-python-headless',
'scikit-surgerycore>=0.6.8',
'scikit-surgerycalibration>=0.1.9',
'scikit-surgeryutils>=1.2.1',
'scikit-surgeryvtk',
'scikit-surgeryarucotracker>=0.2.5',
'pyside6>=6.4.2',
'opencv-contrib-python-headless>=4.2.0.32',
'scikit-surgerycore>=0.6.10',
'scikit-surgerycalibration>=0.2.4',
'scikit-surgeryutils==2.0rc0',
'scikit-surgeryvtk==2.0rc0',
'scikit-surgeryarucotracker>=1.0.1',
],

entry_points={
Expand Down
2 changes: 1 addition & 1 deletion sksurgerybard/interaction/speech_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pylint:disable=super-with-arguments, raise-missing-from

from PySide2.QtCore import QObject, Slot, QThread
from PySide6.QtCore import QObject, Slot, QThread # pylint:disable=no-name-in-module
try:
from sksurgeryspeech.algorithms.voice_recognition_service import \
VoiceRecognitionService #pylint: disable=import-error
Expand Down
2 changes: 1 addition & 1 deletion sksurgerybard/ui/sksurgerybard_command_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

""" Demo app, to show OpenCV video and PySide2 widgets together."""

from PySide2.QtWidgets import QApplication
from PySide6.QtWidgets import QApplication # pylint:disable=no-name-in-module
from sksurgerycore.configuration.configuration_manager import \
ConfigurationManager
from sksurgerybard.widgets.bard_overlay_app import BARDOverlayApp
Expand Down
2 changes: 1 addition & 1 deletion tests/interaction/test_speech_interation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import pytest

from PySide2.QtWidgets import QApplication
from PySide6.QtWidgets import QApplication # pylint:disable=no-name-in-module


try:
Expand Down
2 changes: 1 addition & 1 deletion tests/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -340,4 +340,4 @@ analyse-fallback-blocks=no

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.Exception
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from PySide2.QtCore import QObject, Signal, Slot, QThread, QTimer
from PySide6.QtCore import QObject, Signal, Slot, QThread, QTimer

class VoiceRecognitionService(QObject):
"""A fake Voice recognition service, to enable us to do some
Expand Down
14 changes: 7 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# content of: tox.ini , put in same dir as setup.py
[tox]
envlist = py37,lint
envlist = py38,lint
skipsdist = True
requires = setuptools >= 47.1

[travis]
python =
3.7: py37, docs, lint
3.8: py38, docs, lint

[testenv]
passenv = *
Expand All @@ -21,22 +21,22 @@ commands = versioneer install
coverage report -m

[testenv:lint]
basepython=python3.7
basepython=python3.8
deps=pylint
{[testenv]deps}
commands=pylint --rcfile=tests/pylintrc --extension-pkg-whitelist=PySide2,vtk,cv2, sksurgerybard tests
commands=pylint --rcfile=tests/pylintrc --extension-pkg-whitelist=PySide6,vtk,cv2, sksurgerybard tests

[testenv:docs]
basepython=python3.7
basepython=python3.8
changedir = doc
commands = sphinx-build -M html . build

[testenv:installer]
basepython=python3.7
basepython=python3.8
commands=python -c "print('Installer not needed for this project.')"

[testenv:pip3]
basepython=python3.7
basepython=python3.8
changedir=pip_test
skip_install=True
commands = pip install {posargs}
Expand Down

0 comments on commit dc9f7ff

Please sign in to comment.