This repository has been archived by the owner on Apr 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI setup, fixes for linting, type checking, etc.
- Loading branch information
Showing
15 changed files
with
427 additions
and
139 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,11 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
uses: ./.github/workflows/tests.yaml | ||
lint: | ||
uses: ./.github/workflows/lint.yaml | ||
format: | ||
uses: ./.github/workflows/format.yaml |
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,27 @@ | ||
name: format | ||
|
||
on: [workflow_call] | ||
|
||
jobs: | ||
format: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10"] | ||
os: [ubuntu-22.04] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install project | ||
run: pip install .[formatting] | ||
- name: Run black | ||
run: black . --check --diff --color | ||
- name: Run codespell | ||
run: codespell --enable-colors | ||
- name: Run isort | ||
run: isort looptrace_napari tests --check --diff --color |
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: lint | ||
|
||
on: [workflow_call] | ||
|
||
jobs: | ||
lint: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10"] | ||
os: [ubuntu-22.04] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install project | ||
run: pip install .[linting] | ||
- name: Run mypy on Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
run: mypy | ||
- name: Run pylint on Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
run: pylint looptrace_napari |
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,23 @@ | ||
name: Tests | ||
|
||
on: [workflow_call] | ||
|
||
jobs: | ||
tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.10", "3.11", "3.12" ] | ||
os: [ ubuntu-latest, macos-latest, windows-latest, ubuntu-20.04 ] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install project | ||
run: python -m pip install .[test] | ||
- name: Run unit tests on Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
run: pytest tests -vv --cov=./ --cov-report=xml |
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 |
---|---|---|
|
@@ -4,3 +4,6 @@ build/ | |
*.pyc | ||
.venv/ | ||
__pycache__/ | ||
|
||
# test-related | ||
.coverage* |
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,12 +1,17 @@ | ||
"""Documentation-related helpers""" | ||
|
||
from dataclasses import dataclass | ||
|
||
from typing_extensions import Annotated | ||
|
||
from .types import PathOrPaths | ||
|
||
|
||
@dataclass(frozen=True, kw_only=True) | ||
class CommonReaderDoc: | ||
path_type = Annotated[PathOrPaths, "The file(s) or folder(s) for which to attempt to infer reader function"] | ||
path_type = Annotated[ | ||
PathOrPaths, | ||
"The file(s) or folder(s) for which to attempt to infer reader function", | ||
] | ||
returns = "A None if we can't read the given path(s), else a reader function" | ||
notes = "https://napari.org/stable/plugins/guides.html#layer-data-tuples" |
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
Oops, something went wrong.