Skip to content

Commit 7864323

Browse files
committed
initial commit
0 parents  commit 7864323

19 files changed

+1388
-0
lines changed

.github/workflows/test_and_deploy.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# This workflows will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: tests
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- npe2
11+
tags:
12+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
13+
pull_request:
14+
branches:
15+
- main
16+
- npe2
17+
workflow_dispatch:
18+
19+
jobs:
20+
test:
21+
name: ${{ matrix.platform }} py${{ matrix.python-version }}
22+
runs-on: ${{ matrix.platform }}
23+
strategy:
24+
matrix:
25+
platform: [ubuntu-latest, windows-latest, macos-latest]
26+
python-version: [3.8, 3.9, '3.10']
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
# these libraries enable testing on Qt on linux
37+
- uses: tlambert03/setup-qt-libs@v1
38+
39+
# strategy borrowed from vispy for installing opengl libs on windows
40+
- name: Install Windows OpenGL
41+
if: runner.os == 'Windows'
42+
run: |
43+
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
44+
powershell gl-ci-helpers/appveyor/install_opengl.ps1
45+
46+
# note: if you need dependencies from conda, considering using
47+
# setup-miniconda: https://github.com/conda-incubator/setup-miniconda
48+
# and
49+
# tox-conda: https://github.com/tox-dev/tox-conda
50+
- name: Install dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
python -m pip install setuptools tox tox-gh-actions
54+
55+
# this runs the platform-specific tests declared in tox.ini
56+
- name: Test with tox
57+
uses: GabrielBB/xvfb-action@v1
58+
with:
59+
run: python -m tox
60+
env:
61+
PLATFORM: ${{ matrix.platform }}
62+
63+
- name: Coverage
64+
uses: codecov/codecov-action@v2
65+
66+
deploy:
67+
# this will run when you have tagged a commit, starting with "v*"
68+
# and requires that you have put your twine API key in your
69+
# github secrets (see readme for details)
70+
needs: [test]
71+
runs-on: ubuntu-latest
72+
if: contains(github.ref, 'tags')
73+
steps:
74+
- uses: actions/checkout@v2
75+
- name: Set up Python
76+
uses: actions/setup-python@v2
77+
with:
78+
python-version: "3.x"
79+
- name: Install dependencies
80+
run: |
81+
python -m pip install --upgrade pip
82+
pip install -U setuptools setuptools_scm wheel twine build
83+
- name: Build and publish
84+
env:
85+
TWINE_USERNAME: __token__
86+
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
87+
run: |
88+
git tag
89+
python -m build .
90+
twine upload dist/*
91+

.gitignore

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
.napari_cache
48+
49+
# Translations
50+
*.mo
51+
*.pot
52+
53+
# Django stuff:
54+
*.log
55+
local_settings.py
56+
57+
# Flask instance folder
58+
instance/
59+
60+
# Sphinx documentation
61+
docs/_build/
62+
63+
# MkDocs documentation
64+
/site/
65+
66+
# PyBuilder
67+
target/
68+
69+
# Pycharm and VSCode
70+
.idea/
71+
venv/
72+
.vscode/
73+
74+
# IPython Notebook
75+
.ipynb_checkpoints
76+
77+
# pyenv
78+
.python-version
79+
80+
# OS
81+
.DS_Store
82+
83+
# written by setuptools_scm
84+
**/_version.py
85+

.napari/DESCRIPTION.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
2+
3+
<!-- This file is designed to provide you with a starting template for documenting
4+
the functionality of your plugin. Its content will be rendered on your plugin's
5+
napari hub page.
6+
7+
The sections below are given as a guide for the flow of information only, and
8+
are in no way prescriptive. You should feel free to merge, remove, add and
9+
rename sections at will to make this document work best for your plugin.
10+
11+
## Description
12+
13+
This should be a detailed description of the context of your plugin and its
14+
intended purpose.
15+
16+
If you have videos or screenshots of your plugin in action, you should include them
17+
here as well, to make them front and center for new users.
18+
19+
You should use absolute links to these assets, so that we can easily display them
20+
on the hub. The easiest way to include a video is to use a GIF, for example hosted
21+
on imgur. You can then reference this GIF as an image.
22+
23+
![Example GIF hosted on Imgur](https://i.imgur.com/A5phCX4.gif)
24+
25+
Note that GIFs larger than 5MB won't be rendered by GitHub - we will however,
26+
render them on the napari hub.
27+
28+
The other alternative, if you prefer to keep a video, is to use GitHub's video
29+
embedding feature.
30+
31+
1. Push your `DESCRIPTION.md` to GitHub on your repository (this can also be done
32+
as part of a Pull Request)
33+
2. Edit `.napari/DESCRIPTION.md` **on GitHub**.
34+
3. Drag and drop your video into its desired location. It will be uploaded and
35+
hosted on GitHub for you, but will not be placed in your repository.
36+
4. We will take the resolved link to the video and render it on the hub.
37+
38+
Here is an example of an mp4 video embedded this way.
39+
40+
https://user-images.githubusercontent.com/17995243/120088305-6c093380-c132-11eb-822d-620e81eb5f0e.mp4
41+
42+
## Intended Audience & Supported Data
43+
44+
This section should describe the target audience for this plugin (any knowledge,
45+
skills and experience required), as well as a description of the types of data
46+
supported by this plugin.
47+
48+
Try to make the data description as explicit as possible, so that users know the
49+
format your plugin expects. This applies both to reader plugins reading file formats
50+
and to function/dock widget plugins accepting layers and/or layer data.
51+
For example, if you know your plugin only works with 3D integer data in "tyx" order,
52+
make sure to mention this.
53+
54+
If you know of researchers, groups or labs using your plugin, or if it has been cited
55+
anywhere, feel free to also include this information here.
56+
57+
## Quickstart
58+
59+
This section should go through step-by-step examples of how your plugin should be used.
60+
Where your plugin provides multiple dock widgets or functions, you should split these
61+
out into separate subsections for easy browsing. Include screenshots and videos
62+
wherever possible to elucidate your descriptions.
63+
64+
Ideally, this section should start with minimal examples for those who just want a
65+
quick overview of the plugin's functionality, but you should definitely link out to
66+
more complex and in-depth tutorials highlighting any intricacies of your plugin, and
67+
more detailed documentation if you have it.
68+
69+
## Additional Install Steps (uncommon)
70+
We will be providing installation instructions on the hub, which will be sufficient
71+
for the majority of plugins. They will include instructions to pip install, and
72+
to install via napari itself.
73+
74+
Most plugins can be installed out-of-the-box by just specifying the package requirements
75+
over in `setup.cfg`. However, if your plugin has any more complex dependencies, or
76+
requires any additional preparation before (or after) installation, you should add
77+
this information here.
78+
79+
## Getting Help
80+
81+
This section should point users to your preferred support tools, whether this be raising
82+
an issue on GitHub, asking a question on image.sc, or using some other method of contact.
83+
If you distinguish between usage support and bug/feature support, you should state that
84+
here.
85+
86+
## How to Cite
87+
88+
Many plugins may be used in the course of published (or publishable) research, as well as
89+
during conference talks and other public facing events. If you'd like to be cited in
90+
a particular format, or have a DOI you'd like used, you should provide that information here. -->
91+
92+
The developer has not yet provided a napari-hub specific description.

.pre-commit-config.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.0.1
4+
hooks:
5+
- id: check-docstring-first
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/asottile/setup-cfg-fmt
9+
rev: v1.20.0
10+
hooks:
11+
- id: setup-cfg-fmt
12+
- repo: https://github.com/PyCQA/flake8
13+
rev: 4.0.1
14+
hooks:
15+
- id: flake8
16+
additional_dependencies: [flake8-typing-imports>=1.9.0]
17+
- repo: https://github.com/myint/autoflake
18+
rev: v1.4
19+
hooks:
20+
- id: autoflake
21+
args: ["--in-place", "--remove-all-unused-imports"]
22+
- repo: https://github.com/PyCQA/isort
23+
rev: 5.10.1
24+
hooks:
25+
- id: isort
26+
- repo: https://github.com/psf/black
27+
rev: 21.11b1
28+
hooks:
29+
- id: black
30+
- repo: https://github.com/asottile/pyupgrade
31+
rev: v2.29.1
32+
hooks:
33+
- id: pyupgrade
34+
args: [--py38-plus, --keep-runtime-typing]
35+
- repo: https://github.com/tlambert03/napari-plugin-checks
36+
rev: v0.2.0
37+
hooks:
38+
- id: napari-plugin-checks
39+
# https://mypy.readthedocs.io/en/stable/introduction.html
40+
# you may wish to add this as well!
41+
# - repo: https://github.com/pre-commit/mirrors-mypy
42+
# rev: v0.910-1
43+
# hooks:
44+
# - id: mypy

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Copyright (c) 2022, David Stansby
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
* Neither the name of napari-matplotlib nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include LICENSE
2+
include README.md
3+
4+
recursive-exclude * __pycache__
5+
recursive-exclude * *.py[co]

0 commit comments

Comments
 (0)