Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating dependencies and python version #9

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,36 @@ on:

jobs:
test:
name: ${{ matrix.platform }} py${{ matrix.python-version }}
name: ${{ matrix.platform }} ${{ matrix.python }}
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
python: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3

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

# these libraries, along with pytest-xvfb (added in the `deps` in tox.ini),
# enable testing on Qt on linux
- name: Install Linux libraries
if: runner.os == 'Linux'
run: |
sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \
libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
- uses: tlambert03/setup-qt-libs@v1

# strategy borrowed from vispy for installing opengl libs on windows
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
if (Test-Path -Path "C:\Windows\system32\opengl32.dll" -PathType Leaf) {Exit 0} else {Exit 1}

# note: if you need dependencies from conda, considering using
# setup-miniconda: https://github.com/conda-incubator/setup-miniconda
Expand All @@ -58,11 +58,14 @@ jobs:
python -m pip install --upgrade pip
pip install setuptools tox tox-gh-actions

# this runs the platform-specific tests declared in tox.ini
- name: Test with tox
run: tox
uses: GabrielBB/xvfb-action@v1
with:
run: python -m tox
env:
PLATFORM: ${{ matrix.platform }}
BACKEND: ${{ matrix.backend }}
TOXENV: ${{ matrix.toxenv }}

- name: Coverage
uses: codecov/codecov-action@v1
Expand All @@ -75,9 +78,9 @@ jobs:
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion grabber/grabberwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _mouse_drag(self, anchors: Anchors, event) -> None:
yield
# mouse move
while event.type == 'mouse_move' and len(anchors.selected_data) == 1:
coords = round(anchors.position[-2]), round(anchors.position[-1])
coords = round(event.position[-2]), round(event.position[-1])
if anchors.is_valid(coords) and not anchors.is_on_contour(coords):
self._grabber.drag(coords)
self._contour_layer.data = self._grabber.contour
Expand Down
9 changes: 5 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,28 @@ description = A tool for contour-based segmentation correction (2D only).
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
Development Status :: 2 - Pre-Alpha
Development Status :: 4 - Beta
Intended Audience :: Developers
Framework :: napari
Topic :: Software Development :: Testing
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Operating System :: OS Independent
License :: OSI Approved :: MIT License


[options]
packages = find:
python_requires = >=3.7
python_requires = >=3.8
setup_requires = setuptools_scm
# add your package requirements here
install_requires =
napari-plugin-engine>=0.1.4
pyift>=0.0.4
pyift>=0.1.0
opencv-python-headless>=4.4.0
scipy>=1.7.2

Expand Down
8 changes: 5 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
envlist = py{37,38,39}-{linux,macos,windows}
envlist = py{38,39,310,311}-{linux,macos,windows}

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[gh-actions:env]
PLATFORM =
Expand All @@ -22,7 +23,8 @@ platform =
passenv =
CI
GITHUB_ACTIONS
DISPLAY XAUTHORITY
DISPLAY
XAUTHORITY
NUMPY_EXPERIMENTAL_ARRAY_FUNCTION
PYVISTA_OFF_SCREEN
deps =
Expand Down