Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 21 additions & 38 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,73 @@
# 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:
branches:
- main
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-dev[0-9]+
pull_request:
branches:
- main
- main
workflow_dispatch:

jobs:
test:
name: ${{ matrix.platform }} py${{ matrix.python-version }}
runs-on: ${{ matrix.platform }}

strategy:
matrix:
# platform: [ubuntu-latest, windows-latest, macos-latest]
platform: [ubuntu-latest]
python-version: [3.8, 3.9, "3.10"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.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'
run: |
git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
# note: if you need dependencies from conda, considering using
# setup-miniconda: https://github.com/conda-incubator/setup-miniconda
# and
# tox-conda: https://github.com/tox-dev/tox-conda
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools tox tox-gh-actions
# this runs the platform-specific tests declared in tox.ini
python -m pip install tox tox-gh-actions

- name: Test with tox
uses: GabrielBB/xvfb-action@v1
with:
run: python -m tox
env:
PLATFORM: ${{ matrix.platform }}

- name: Coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4

deploy:
# this will run when you have tagged a commit, starting with "v*"
# and requires that you have put your twine API key in your
# github secrets (see readme for details)
needs: [test]
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies

- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install -U setuptools setuptools_scm wheel twine
- name: Build and publish
pip install build twine

- name: Build package
run: python -m build

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
run: |
git tag
python setup.py sdist bdist_wheel
twine upload dist/*
run: twine upload dist/*
48 changes: 14 additions & 34 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ __pycache__/

# C extensions
*.so
*.pyd

# Distribution / packaging
.Python
env/
venv/
build/
develop-eggs/
dist/
develop-eggs/
downloads/
eggs/
.eggs/
Expand All @@ -24,63 +26,41 @@ var/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
# Unit test / coverage
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
.mypy_cache/
.ruff_cache/
nosetests.xml
coverage.xml
*,cover
.hypothesis/
.napari_cache

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask instance folder
instance/

# Sphinx documentation
# Documentation
docs/_build/
site/

# MkDocs documentation
/site/

# PyBuilder
target/

# Pycharm and VSCode
# IDE
.idea/
venv/
.vscode/

# IPython Notebook
.ipynb_checkpoints
# Jupyter
.ipynb_checkpoints/

# pyenv
.python-version

# OS
.DS_Store

# written by setuptools_scm
**/_version.py

scratch/
# Misc
scratch/
47 changes: 29 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.6.0
hooks:
- id: check-docstring-first
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.0
hooks:
- id: setup-cfg-fmt
- id: check-yaml

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.7.0]
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: ["--in-place", "--remove-all-unused-imports"]
additional_dependencies:
- flake8-typing-imports==1.16.0

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/asottile/pyupgrade
rev: v2.29.1
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py37-plus, --keep-runtime-typing]
args: [--py38-plus, --keep-runtime-typing]

- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- --remove-unused-variables
exclude: ^src/napari_basicpy/_version\.py$

- repo: https://github.com/tlambert03/napari-plugin-checks
rev: v0.2.0
rev: v0.3.0
hooks:
- id: napari-plugin-checks

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
rev: v1.11.2
hooks:
- id: mypy
additional_dependencies: []
exclude: ^src/napari_basicpy/_version\.py$
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ include LICENSE
include README.md
include requirements.txt

recursive-include src *.yaml

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
recursive-exclude * *.py[co]
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# napari-basicpy

[![License](https://img.shields.io/pypi/l/napari-basicpy.svg?color=green)](https://github.com/tdmorello/napari-basicpy/raw/main/LICENSE)
[![License](https://img.shields.io/pypi/l/napari-basicpy.svg?color=green)](https://github.com/peng-lab/napari-basicpy/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/napari-basicpy.svg?color=green)](https://pypi.org/project/napari-basicpy)
[![Python Version](https://img.shields.io/pypi/pyversions/napari-basicpy.svg?color=green)](https://python.org)
[![tests](https://github.com/tdmorello/napari-basicpy/workflows/tests/badge.svg)](https://github.com/tdmorello/napari-basicpy/actions)
[![codecov](https://codecov.io/gh/tdmorello/napari-basicpy/branch/main/graph/badge.svg)](https://codecov.io/gh/tdmorello/napari-basicpy)
[![tests](https://github.com/peng-lab/napari-basicpy/workflows/tests/badge.svg)](https://github.com/peng-lab/napari-basicpy/actions)
[![codecov](https://codecov.io/ghpeng-lab/napari-basicpy/branch/main/graph/badge.svg)](https://codecov.io/gh/peng-lab/napari-basicpy)
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-basicpy)](https://napari-hub.org/plugins/napari-basicpy)

BaSiCPy illumination correction for napari
Expand All @@ -27,17 +27,19 @@ https://napari.org/plugins/stable/index.html

## Installation

**Important note** M1/M2 mac and Windows users may need to install the `jax` and `jaxlib` following the instruction [here](https://github.com/peng-lab/BaSiCPy#installation).

You can install `napari-basicpy` via [pip]:

pip install napari-basicpy

### Compatibility

`napari-basicpy` (>=1.0.0) requires **BaSiCPy ≥ 2.0**.

If you need compatibility with **BaSiCPy < 2.0**, please use an earlier plugin version:

To install latest development version :

pip install git+https://github.com/tdmorello/napari-basicpy.git
pip install git+https://github.com/peng-lab/napari-basicpy.git

## Contributing

Expand All @@ -64,7 +66,7 @@ If you encounter any problems, please [file an issue] along with a detailed desc
[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin

[file an issue]: https://github.com/tdmorello/napari-basicpy/issues
[file an issue]: https://github.com/peng-lab/napari-basicpy/issues

[napari]: https://github.com/napari/napari
[tox]: https://tox.readthedocs.io/en/latest/
Expand Down
Loading