-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update pyproject * update pyproject and linting * update readme * update tests * remove tox * install backend * Update pyproject.toml Co-authored-by: Peter Sobolewski <[email protected]> * change deploy * Update .github/workflows/ci.yml Co-authored-by: Peter Sobolewski <[email protected]> * add more explicit deps * bump setup mini * small cleanup * use miniforge * Update .github/workflows/ci.yml to use conda not mamba * Update README.md Co-authored-by: Peter Sobolewski <[email protected]> --------- Co-authored-by: Peter Sobolewski <[email protected]>
- Loading branch information
1 parent
91ee213
commit 5ec1a5b
Showing
17 changed files
with
159 additions
and
194 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 |
---|---|---|
|
@@ -2,19 +2,18 @@ name: CI | |
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
branches: [main] | ||
tags: ["v*"] # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
pull_request: | ||
branches: | ||
- main | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-manifest: | ||
# check-manifest is a tool that checks that all files in version control are | ||
# included in the sdist (unless explicitly excluded) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -29,72 +28,65 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.8", "3.9", "3.10"] | ||
backend: [pyqt5] | ||
include: | ||
- platform: ubuntu-latest | ||
python-version: 3.7 | ||
backend: pyqt5 | ||
platform: [ubuntu-latest, macos-13, macos-latest, windows-latest] | ||
python-version: ["3.9", "3.10"] | ||
backend: [PyQt5] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniconda-version: "latest" | ||
channels: conda-forge | ||
channel-priority: strict | ||
miniforge-version: "latest" | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: tlambert03/setup-qt-libs@v1 | ||
|
||
- 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 | ||
- uses: pyvista/setup-headless-display-action@v3 | ||
with: | ||
qt: true | ||
|
||
- name: Install dependencies | ||
run: | | ||
conda install omero-py | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade setuptools tox tox-conda tox-gh-actions | ||
python -m pip install .[test] | ||
python -m pip install ${{ matrix.backend }} | ||
- name: Test with tox | ||
uses: aganders3/[email protected] | ||
with: | ||
shell: bash -el {0} | ||
run: python -m tox | ||
env: | ||
PLATFORM: ${{ matrix.platform }} | ||
PYTHON: ${{ matrix.python-version }} | ||
PYVISTA_OFF_SCREEN: True | ||
BACKEND: ${{ matrix.backend }} | ||
- name: Test | ||
run: pytest --color=yes --cov=napari_omero --cov-report=xml | ||
|
||
- name: Codecov | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v5 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
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 | ||
needs: [test] | ||
if: github.repository == 'tlambert03/napari-omero' && contains(github.ref, 'tags') | ||
if: success() && startsWith(github.ref, 'refs/tags/') && github.repository == 'tlambert03/napari-omero' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 🐍 Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U build twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.pypi_password }} | ||
|
||
- name: 👷 Build | ||
run: | | ||
git tag | ||
python -m pip install build | ||
python -m build | ||
twine check dist/* | ||
twine upload dist/* | ||
- name: 🚢 Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
- uses: softprops/action-gh-release@v2 | ||
with: | ||
generate_release_notes: true | ||
files: './dist/*' |
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 |
---|---|---|
|
@@ -7,23 +7,26 @@ build-backend = "hatchling.build" | |
source = "vcs" | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/napari_omero", "src/omero/plugins"] | ||
only-include = ["src"] | ||
sources = ["src"] | ||
|
||
# https://peps.python.org/pep-0621/ | ||
[project] | ||
name = "napari-omero" | ||
dynamic = ["version"] | ||
description = "napari/OMERO interoperability" | ||
readme = "README.md" | ||
requires-python = ">=3.7" | ||
requires-python = ">=3.9" | ||
license = { text = "GPL-2.0-or-later" } | ||
authors = [ | ||
{ name = "Talley Lambert", email = "[email protected]" }, | ||
{ name = "Will Moore" }, | ||
{ name = "Will Moore", email = "[email protected]" }, | ||
{ name = "Johannes Soltwedel", email = "[email protected]" }, | ||
{ name = "Peter Sobolewski" }, | ||
] | ||
keywords = ["OMERO.CLI", "plugin", "napari", "napari-plugin"] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Development Status :: 4 - Beta", | ||
"Environment :: X11 Applications :: Qt", | ||
"Framework :: napari", | ||
"Intended Audience :: Developers", | ||
|
@@ -33,48 +36,49 @@ classifiers = [ | |
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Topic :: Scientific/Engineering :: Bio-Informatics", | ||
"Topic :: Scientific/Engineering :: Information Analysis", | ||
"Topic :: Scientific/Engineering :: Visualization", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Utilities", | ||
# "License :: OSI Approved :: BSD License", | ||
# "Typing :: Typed", | ||
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", | ||
"Typing :: Typed", | ||
] | ||
# add your package dependencies here | ||
dependencies = [ | ||
"napari>=0.4.13", | ||
"omero-py", | ||
"omero-rois", | ||
"importlib-metadata; python_version < '3.8'", | ||
# these come with napari ... | ||
# but are directly imported here as well so are included explicitly | ||
"qtpy>=1.10.0", | ||
"dask[array]>=2021.10.0", | ||
"vispy>=0.14.1,<0.15", | ||
"superqt>=0.6.7", | ||
] | ||
|
||
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies | ||
# "extras" (e.g. for `pip install .[test]`) | ||
[project.optional-dependencies] | ||
all = ["napari[all]"] | ||
# add dependencies used for testing here | ||
test = [ | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-qt", | ||
"pytest-regressions", | ||
"pywin32; sys_platform == 'win32'", | ||
] | ||
# add anything else you like to have in your dev environment here | ||
dev = [ | ||
"black", | ||
"napari-omero[all, test]", | ||
"ipython", | ||
"mypy", | ||
"pdbpp", # https://github.com/pdbpp/pdbpp | ||
"rich", # https://github.com/Textualize/rich | ||
"pdbpp", | ||
"pre-commit", | ||
"rich", | ||
"ruff", | ||
] | ||
|
||
|
@@ -91,34 +95,46 @@ napari-omero = "napari_omero.__main__:main" | |
[project.entry-points."napari.manifest"] | ||
napari-omero = "napari_omero:napari.yaml" | ||
|
||
# https://beta.ruff.rs/docs/rules/ | ||
# https://docs.astral.sh/ruff | ||
[tool.ruff] | ||
line-length = 88 | ||
target-version = "py37" | ||
target-version = "py39" | ||
src = ["src"] | ||
|
||
# https://docs.astral.sh/ruff/rules | ||
[tool.ruff.lint] | ||
pydocstyle = { convention = "numpy" } | ||
select = [ | ||
"E", # style errors | ||
"W", # style warnings | ||
"F", # flakes | ||
"D", # pydocstyle | ||
"D417", # Missing argument descriptions in Docstrings | ||
"I", # isort | ||
"UP", # pyupgrade | ||
"C4", # flake8-comprehensions | ||
"B", # flake8-bugbear | ||
"A001", # flake8-builtins | ||
"RUF", # ruff-specific rules | ||
"TC", # flake8-type-checking | ||
"TID", # flake8-tidy-imports | ||
] | ||
ignore = [ | ||
"D100", # Missing docstring in public module | ||
"D107", # Missing docstring in __init__ | ||
"D203", # 1 blank line required before class docstring | ||
"D212", # Multi-line docstring summary should start at the first line | ||
"D213", # Multi-line docstring summary should start at the second line | ||
"D401", # First line should be in imperative mood | ||
"D413", # Missing blank line after last section | ||
"D416", # Section name should end with a colon | ||
"D100", # Missing docstring in public module | ||
"D101", # Missing docstring in public class | ||
"D102", # Missing docstring in public method | ||
"D103", # Missing docstring in public function | ||
"D104", # Missing docstring in public package | ||
] | ||
|
||
[tool.ruff.per-file-ignores] | ||
[tool.ruff.lint.per-file-ignores] | ||
"tests/*.py" = ["D", "S"] | ||
"setup.py" = ["D"] | ||
|
||
# https://docs.astral.sh/ruff/formatter/ | ||
[tool.ruff.format] | ||
docstring-code-format = true | ||
skip-magic-trailing-comma = false # default is false | ||
|
||
# https://mypy.readthedocs.io/en/stable/config_file.html | ||
[tool.mypy] | ||
|
@@ -134,7 +150,7 @@ pretty = true | |
|
||
# https://docs.pytest.org/en/6.2.x/customize.html | ||
[tool.pytest.ini_options] | ||
minversion = "6.0" | ||
minversion = "7.0" | ||
testpaths = ["tests"] | ||
filterwarnings = [ | ||
"error", | ||
|
@@ -155,6 +171,7 @@ exclude_lines = [ | |
"except ImportError", | ||
"\\.\\.\\.", | ||
"raise NotImplementedError()", | ||
"pass", | ||
] | ||
[tool.coverage.run] | ||
source = ["src"] | ||
|
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.