Skip to content

Commit

Permalink
Merge branch 'main' into add_feature_histograms
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby committed Aug 25, 2023
2 parents 210a35a + 3a8261a commit bff4529
Show file tree
Hide file tree
Showing 75 changed files with 1,746 additions and 499 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build docs

on:

pull_request:
branches:
- main
push:
branches:
- main
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build-docs:
name: Build & Upload Artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: "3.10"

- uses: tlambert03/setup-qt-libs@v1

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[docs]"
sudo apt install graphviz --yes
- name: Build Docs
uses: aganders3/headless-gui@v1
with:
run: make html
working-directory: ./docs

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: docs
path: docs/_build

upload-docs:
name: Upload docs to GitHub pages
runs-on: ubuntu-latest
needs: build-docs
if: contains(github.ref, 'tags')
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: docs

- name: Push to GitHub pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: html
ssh-key: ${{ secrets.DEPLOY_KEY }}
repository-name: napari-matplotlib/napari-matplotlib.github.io
4 changes: 2 additions & 2 deletions .github/workflows/napari_hub_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: napari hub Preview Page Builder
uses: chanzuckerberg/[email protected].5
uses: chanzuckerberg/[email protected]
with:
hub-ref: main
40 changes: 28 additions & 12 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# 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:
Expand All @@ -13,14 +10,16 @@ on:
branches:
- main
workflow_dispatch:
merge_group:

jobs:
test:
name: ${{ matrix.platform }} py${{ matrix.python-version }}
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10']

steps:
Expand Down Expand Up @@ -50,8 +49,22 @@ jobs:
- name: Test with tox
run: python -m tox

- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.platform }} py${{ matrix.python-version }}
path: reports/
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

- name: Coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
# Don't run coverage on merge queue CI to avoid duplicating reports
# to codecov. See https://github.com/matplotlib/napari-matplotlib/issues/155
if: github.event_name != 'merge_group'
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

deploy:
# this will run when you have tagged a commit, starting with "v*"
Expand All @@ -60,21 +73,24 @@ jobs:
needs: [test]
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
environment: pypi-deploy
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
- name: Install build
run: |
python -m pip install --upgrade pip
pip install -U setuptools setuptools_scm wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
python -m pip install --upgrade build
- name: Build package
run: |
git tag
python -m build .
twine upload dist/*
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
report/
.coverage
.coverage.*
.cache
Expand Down Expand Up @@ -84,3 +85,6 @@ venv/

# written by setuptools_scm
**/_version.py

# Generated by test runs
reports
92 changes: 0 additions & 92 deletions .napari/DESCRIPTION.md

This file was deleted.

8 changes: 8 additions & 0 deletions .napari/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
labels:
ontology: EDAM-BIOIMAGING:alpha06
terms:
- 2D Image
- 3D Image
- Plotting
- Slice rendering
- Scientific visualisation
45 changes: 17 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.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.1
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports>=1.9.0]
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: ["--in-place", "--remove-all-unused-imports"]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.0
hooks:
- id: pyupgrade
args: [--py38-plus, --keep-runtime-typing]

- 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.5.1
hooks:
- id: mypy
args: ["--disallow-incomplete-defs", "--ignore-missing-imports"]
additional_dependencies: [numpy, matplotlib]

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.285'
hooks:
- id: ruff

ci:
autofix_prs: false
15 changes: 15 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2

python:
install:
- method: pip
path: .
extra_requirements:
- docs

build:
os: ubuntu-22.04
tools:
python: "3.10"
apt_packages:
- xvfb
12 changes: 0 additions & 12 deletions CHANGELOG.rst

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include LICENSE
include README.md
recursive-include * *.mplstyle

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Expand Down
Loading

0 comments on commit bff4529

Please sign in to comment.