Skip to content

Commit

Permalink
Merge branch 'main' into support_multiscale
Browse files Browse the repository at this point in the history
  • Loading branch information
psobolewskiPhD committed Jan 10, 2025
2 parents 7feee03 + 1d53966 commit a697c85
Show file tree
Hide file tree
Showing 17 changed files with 316 additions and 216 deletions.
102 changes: 47 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@ 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@v3
- uses: actions/checkout@v4
- run: pipx run check-manifest

test:
Expand All @@ -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@v3
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
- 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@v3
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@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/*'
14 changes: 5 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@ ci:

repos:
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.2
rev: v0.23
hooks:
- id: validate-pyproject

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.261
rev: v0.8.6
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: [--fix, --unsafe-fixes]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.14.1
hooks:
- id: mypy
files: "^src/"
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ omero napari view Image:1

## installation

Requires python 3.7 - 3.10.
While this package supports anything above python 3.9,
In practice, python support is limited by `omero-py` and `zeroc-ice`,
compatibility, which is limited to python <=3.10 at the time of writing.

### from conda

It's easiest to install `omero-py` from conda, so the recommended procedure
is to install everything from conda, using the `conda-forge` channel

```python
```sh
conda install -c conda-forge napari-omero
```

Expand All @@ -100,7 +102,7 @@ conda install -c conda-forge napari-omero
`omero-py`

```sh
conda create -n omero -c conda-forge python=3.9 omero-py
conda create -n omero -c conda-forge python=3.10 omero-py
conda activate omero
pip install napari-omero[all] # the [all] here is the same as `napari[all]`
```
Expand Down Expand Up @@ -132,19 +134,19 @@ git clone https://github.com/tlambert03/napari-omero.git
# change into the new directory
cd napari-omero
# create conda environment
conda env create -f environment.yml
conda env create -n napari-omero python=3.10 omero-py
# activate the new env
conda activate napari-omero

# install in editable mode
pip install -e .
# install in editable mode with dev dependencies
pip install -e ".[dev]" # quotes are needed on zsh
```

To maintain good code quality, this repo uses
[flake8](https://gitlab.com/pycqa/flake8),
[mypy](https://github.com/python/mypy), and
[black](https://github.com/psf/black). To enforce code quality when you commit
code, you can install pre-commit
[ruff](https://github.com/astral-sh/ruff),
[mypy](https://github.com/python/mypy).

To enforce code quality when you commit code, you can install pre-commit

```bash
# install pre-commit which will run code checks prior to commits
Expand All @@ -156,3 +158,12 @@ Moore](https://github.com/will-moore).

The napari reader plugin and GUI browser was created by [Talley
Lambert](https://github.com/tlambert03/)

## release

To psuh a release to PyPI, one of the maintainers needs to do, for example:
```sh
git tag -a v0.2.0 -m v0.2.0
git push upstream --follow-tags
```
Then, the workflow should handle everything!
Loading

0 comments on commit a697c85

Please sign in to comment.