diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 6a054e2..8cc22a9 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -1,6 +1,3 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - name: tests on: [push, pull_request] @@ -12,20 +9,14 @@ jobs: - uses: brainglobe/actions/lint@v1 test: - needs: linting + needs: [linting] name: ${{ matrix.os }} py${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: matrix: - # Run all supported Python versions on linux - python-version: ["3.8", "3.9"] - os: [ubuntu-latest] - # Include one windows and macos run - include: - - os: macos-latest - python-version: "3.9" - - os: windows-latest - python-version: "3.9" + # Run all supported Python versions on linux and windows + python-version: ["3.8", "3.9", "3.10"] + os: [ubuntu-latest, windows-latest] steps: # Setup pyqt libraries diff --git a/README.md b/README.md index 4c5b27a..cb60a34 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ [![Development Status](https://img.shields.io/pypi/status/brainreg-segment.svg)](https://github.com/brainglobe/brainreg-segment) [![Tests](https://img.shields.io/github/workflow/status/brainglobe/brainreg-segment/tests)]( https://github.com/brainglobe/brainreg-segment/actions) -[![Coverage Status](https://coveralls.io/repos/github/brainglobe/brainreg-segment/badge.svg?branch=master)](https://coveralls.io/github/brainglobe/brainreg-segment?branch=master) -[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black) +[![codecov](https://codecov.io/gh/brainglobe/brainreg-segment/branch/master/graph/badge.svg?token=WP9KTPZE5R)](https://codecov.io/gh/brainglobe/brainreg-segment)[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black) [![Twitter](https://img.shields.io/twitter/follow/brain_globe?style=social)](https://twitter.com/brain_globe) # brainreg-segment diff --git a/brainreg_segment/segment.py b/brainreg_segment/segment.py index 0e845be..dc362ea 100644 --- a/brainreg_segment/segment.py +++ b/brainreg_segment/segment.py @@ -2,11 +2,11 @@ import napari import numpy as np -from bg_atlasapi import BrainGlobeAtlas from napari.qt.threading import thread_worker from qtpy import QtCore from qtpy.QtWidgets import QFileDialog, QGridLayout, QGroupBox, QLabel, QWidget +from bg_atlasapi import BrainGlobeAtlas from brainreg_segment.atlas.utils import ( get_available_atlases, structure_from_viewer, diff --git a/pyproject.toml b/pyproject.toml index e0dbe4a..9e9b6f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,3 +23,5 @@ exclude = ''' [tool.isort] profile = "black" line_length = 79 +sections=["FUTURE","STDLIB","THIRDPARTY","BRAINGLOBE","FIRSTPARTY","LOCALFOLDER"] +known_brainglobe=["brainreg", "brainreg_segment", "brainglobe_napari_io", "bg_space", "bg_atlasapi"] diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 01c75af..0000000 --- a/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -[pytest] -addopts = --cov=brainreg_segment -markers = - slow: marks tests as slow (deselect with '-m "not slow"') diff --git a/setup.py b/setup.py index 1ade0a4..8b7424d 100644 --- a/setup.py +++ b/setup.py @@ -35,8 +35,8 @@ "black", "pytest-cov", "pytest", - "pytest-qt", - "coverage", + "gitpython", + "coverage>=5.0.3", "bump2version", "pre-commit", "flake8", diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/tests/test_integration/test_tracks/test_track_analysis.py b/tests/tests/test_integration/test_tracks/test_track_analysis.py index 7d5e322..556d376 100644 --- a/tests/tests/test_integration/test_tracks/test_track_analysis.py +++ b/tests/tests/test_integration/test_tracks/test_track_analysis.py @@ -2,8 +2,8 @@ import numpy as np import pandas as pd -from bg_atlasapi import BrainGlobeAtlas +from bg_atlasapi import BrainGlobeAtlas from brainreg_segment.tracks.analysis import run_track_analysis atlas_name = "allen_mouse_50um" diff --git a/tests/tests/test_unit/test_atlas/test_atlas_utils.py b/tests/tests/test_unit/test_atlas/test_atlas_utils.py index 77aa882..e338a8b 100644 --- a/tests/tests/test_unit/test_atlas/test_atlas_utils.py +++ b/tests/tests/test_unit/test_atlas/test_atlas_utils.py @@ -1,6 +1,6 @@ import numpy as np -from bg_atlasapi import BrainGlobeAtlas +from bg_atlasapi import BrainGlobeAtlas from brainreg_segment.atlas import utils as atlas_utils atlas_name = "allen_mouse_50um" diff --git a/tox.ini b/tox.ini index 01d67b0..af8b2b7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,23 @@ # For more information about tox, see https://tox.readthedocs.io/en/latest/ [tox] -envlist = py{38,39} +envlist = py{38,39,310}-{linux,windows} [gh-actions] python = 3.8: py38 3.9: py39 + 3.10: py310 + +[gh-actions:env] +PLATFORM = + ubuntu-latest: linux + windows-latest: windows [testenv] +platform = + macos: darwin + linux: linux + windows: win32 passenv = CI GITHUB_ACTIONS @@ -15,12 +25,13 @@ passenv = NUMPY_EXPERIMENTAL_ARRAY_FUNCTION PYVISTA_OFF_SCREEN deps = - # Even though napari is a requirement for cellfinder-napari, we have to - # ensure it is installed with the default Qt backend here. - napari[pyqt] pytest # https://docs.pytest.org/en/latest/contents.html pytest-cov # https://pytest-cov.readthedocs.io/en/latest/ - pytest-qt pytest-xvfb ; sys_platform == 'linux' -commands = - pytest -v --color=yes --cov=brainreg_segment --cov-report=xml + # you can remove these if you don't use them + napari + magicgui + pytest-qt + qtpy + pyqt5 +commands = pytest -v --color=yes --cov=brainreg_segment --cov-report=xml