-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from stardist/tests
Refactor code and add tests
- Loading branch information
Showing
12 changed files
with
356 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: 'Run tests' | ||
|
||
inputs: | ||
python-version: | ||
required: true | ||
install-packages: | ||
required: true | ||
default: "'.[test]'" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up Python ${{ inputs.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
# these libraries enable testing on qt on linux | ||
- uses: tlambert03/setup-qt-libs@v1 | ||
|
||
# strategy borrowed from vispy for installing opengl libs on windows | ||
- name: Install Windows OpenGL | ||
if: runner.os == 'Windows' | ||
shell: pwsh | ||
run: | | ||
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git | ||
powershell gl-ci-helpers/appveyor/install_opengl.ps1 | ||
- name: Install package | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip wheel setuptools | ||
python -m pip install ${{ inputs.install-packages }} | ||
- name: Find test directory | ||
shell: bash | ||
run: | | ||
python -W ignore -c "import stardist_napari; print(f'pytest_dir={stardist_napari.__path__[0]}')" >> $GITHUB_ENV | ||
# run tests inside the installed stardist_napari package | ||
- name: Test with pytest | ||
uses: GabrielBB/xvfb-action@v1 | ||
with: | ||
run: python -m pytest -v --color=yes --durations=0 ${{ env.pytest_dir }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.platform }} py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ['3.7', '3.8', '3.9', '3.10'] | ||
exclude: | ||
# TODO: no stardist wheels yet | ||
- python-version: '3.10' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ./.github/actions/test | ||
with: | ||
python-version: ${{ matrix.python-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Test (PyPI) | ||
|
||
on: | ||
schedule: | ||
- cron: "0 18 * * *" | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.platform }} py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ['3.7', '3.8', '3.9', '3.10'] | ||
exclude: | ||
# TODO: no stardist wheels yet | ||
- python-version: '3.10' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ./.github/actions/test | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
install-packages: "'stardist-napari[test]'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
import os | ||
|
||
DEBUG = os.environ.get("STARDIST_NAPARI_DEBUG", "").lower() in ( | ||
"y", | ||
"yes", | ||
"t", | ||
"true", | ||
"on", | ||
"1", | ||
) | ||
del os | ||
|
||
from ._dock_widget import plugin_wrapper as make_dock_widget | ||
from ._version import __version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.