Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Bump GitHub Actions versions #31

Merged
merged 6 commits into from
Apr 22, 2024
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
93 changes: 46 additions & 47 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
name: 'build-test-publish'
name: "build-test-publish"

on:
[push, pull_request]

environment:
name: pypi
url: https://pypi.org/p/<your-pypi-project-name>
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
on: [push, pull_request]

jobs:
build_wheel:
name: Build Python wheels
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: "Build pure Python wheels"
run: |
python -m pip wheel -w dist -e src/

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheel
path: ./dist/itk_dreg-*.whl
Expand All @@ -33,51 +26,57 @@ jobs:
needs:
- build_wheel
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Update pip
run: |
python -m pip install --upgrade pip
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Update pip
run: |
python -m pip install --upgrade pip

- name: "Install Dependencies"
shell: bash
run: |
python -m pip install flit
cd src
flit install --deps develop
- name: "Install Dependencies"
shell: bash
run: |
python -m pip install flit
cd src
flit install --deps develop

- name: Download Python Wheel Artifact
uses: actions/download-artifact@v3
with:
name: wheel
- name: Download Python Wheel Artifact
uses: actions/download-artifact@v4
with:
name: wheel

- name: "Install itk_dreg from Wheel Artifact"
run: |
wheel_name_full=`(find . -name "itk_dreg-*.whl")`
python -m pip uninstall -y itk_dreg
python -m pip install ${wheel_name_full}
- name: "Install itk_dreg from Wheel Artifact"
run: |
wheel_name_full=`(find . -name "itk_dreg-*.whl")`
python -m pip uninstall -y itk_dreg
python -m pip install ${wheel_name_full}

- name: "Run Tests"
shell: bash
run: |
pytest ./test -vvv -s -k "not localcluster and not serialize_pairwise_result"
- name: "Run Tests"
shell: bash
run: |
pytest ./test -vvv -s -k "not localcluster and not serialize_pairwise_result"

publish:
needs:
- build_wheel
- pytest
runs-on: ubuntu-22.04
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
environment:
name: pypi
url: https://pypi.org/p/itk-dreg
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- name: Download Python Wheel Artifact
uses: actions/download-artifact@v3
with:
name: wheel
path: dist
- name: Download Python Wheel Artifact
uses: actions/download-artifact@v4
with:
name: wheel
path: dist

- name: "Publish Python wheel to the Python Package Index"
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
skip_existing: true
- name: "Publish Python wheel to the Python Package Index"
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
skip_existing: true
21 changes: 10 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
name: 'lint'
name: "lint"

on:
[push, pull_request]
on: [push, pull_request]

jobs:
ruff-check:
name: "Lint with Ruff"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
with:
src: "./src"
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
src: "./src"

black-autoformat:
name: "Lint with Black"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
src: "./src"
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
src: "./src"
56 changes: 0 additions & 56 deletions .github/workflows/make-docs.yml

This file was deleted.

57 changes: 28 additions & 29 deletions .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: 'test-notebooks'
name: "test-notebooks"

on:
[push, pull_request]
on: [push, pull_request]

env:
aind-ccf-alignment-experiments-tag: 756e846d08b07fcffbc3c387216a59a9fa563fd6
Expand All @@ -11,32 +10,32 @@ jobs:
name: "Test Jupyter Notebooks with PyTest"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Update pip
run: |
python -m pip install --upgrade pip
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Update pip
run: |
python -m pip install --upgrade pip
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1

- name: "Install Dependencies Not Available on PyPI"
shell: bash
run: |
git clone https://github.com/AllenNeuralDynamics/aind-ccf-alignment-experiments.git
pushd aind-ccf-alignment-experiments
git checkout ${{ env.aind-ccf-alignment-experiments-tag }}
python -m pip install .
- name: "Install Dependencies Not Available on PyPI"
shell: bash
run: |
git clone https://github.com/AllenNeuralDynamics/aind-ccf-alignment-experiments.git
pushd aind-ccf-alignment-experiments
git checkout ${{ env.aind-ccf-alignment-experiments-tag }}
python -m pip install .

- name: "Install Dependencies with Flit"
shell: bash
run: |
python -m pip install flit
pushd src
flit install --extras all
- name: "Install Dependencies with Flit"
shell: bash
run: |
python -m pip install flit
pushd src
flit install --extras all

- name: "Run Tests"
shell: bash
run: |
pytest --nbmake --nbmake-timeout=30000 examples/*.ipynb -vvv -s -k "not LightsheetRegistration.ipynb"
- name: "Run Tests"
shell: bash
run: |
pytest --nbmake --nbmake-timeout=30000 examples/*.ipynb -vvv -s -k "not LightsheetRegistration.ipynb"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ examples/mydask.png
data/
_build/
tmp/
docs/apidocs/
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Binary file added docs/_static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/_static/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

from datetime import date
import os

project = 'itk-dreg'
copyright = f'{date.today().year}, NumFOCUS'
author = 'Insight Software Consortium'

extensions = [
'sphinx.ext.autosummary',
'autodoc2',
'myst_parser',
'sphinx.ext.intersphinx',
'sphinx_copybutton',
'sphinxext.opengraph',
'sphinx_design',
]

myst_enable_extensions = ["colon_fence", "fieldlist"]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

autodoc2_packages = [
{
"path": "../src/itk_dreg",
"exclude_files": [],
},
]
autodoc2_render_plugin = "myst"

intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"itkwasm": ("https://itkwasm.readthedocs.io/en/latest/", None),
}

html_theme = 'furo'
html_static_path = ['_static']
html_logo = "_static/logo.svg"
html_favicon = "_static/favicon.png"
html_title = f"{project}"
html_baseurl = os.environ.get("SPHINX_BASE_URL", "")

# Furo options
html_theme_options = {
"top_of_page_button": "edit",
"source_repository": "https://github.com/InsightSoftwareConsortium/itk-dreg",
"source_branch": "main",
"source_directory": "docs",
}
Loading
Loading