Skip to content

Commit

Permalink
Move to codecov (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamltyson authored Jul 27, 2022
1 parent 58b6d71 commit 9fb775d
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 31 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion brainreg_segment/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 0 additions & 4 deletions pytest.ini

This file was deleted.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"black",
"pytest-cov",
"pytest",
"pytest-qt",
"coverage",
"gitpython",
"coverage>=5.0.3",
"bump2version",
"pre-commit",
"flake8",
Expand Down
Empty file added tests/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test_unit/test_atlas/test_atlas_utils.py
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
25 changes: 18 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
# 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
DISPLAY XAUTHORITY
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

0 comments on commit 9fb775d

Please sign in to comment.