-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9614ce8
commit f0640d3
Showing
41 changed files
with
328 additions
and
253 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 |
---|---|---|
@@ -1,90 +1,95 @@ | ||
# 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 | ||
- npe2 | ||
tags: | ||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
pull_request: | ||
branches: | ||
- main | ||
- npe2 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: neuroinformatics-unit/actions/lint@v2 | ||
|
||
manifest: | ||
name: Check Manifest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: neuroinformatics-unit/actions/check_manifest@v2 | ||
|
||
test: | ||
name: ${{ matrix.platform }} py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.platform }} | ||
needs: [linting, manifest] | ||
name: ${{ matrix.os }} py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ['3.8', '3.9', '3.10'] | ||
# Run all supported Python versions on linux | ||
python-version: ["3.9", "3.10", "3.11"] | ||
os: [ubuntu-latest] | ||
# Include one windows and macos run | ||
include: | ||
- os: macos-latest | ||
python-version: "3.10" | ||
- os: windows-latest | ||
python-version: "3.10" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# these libraries enable testing on Qt on linux | ||
- uses: tlambert03/setup-qt-libs@v1 | ||
- uses: pyvista/setup-headless-display-action@v2 | ||
with: | ||
qt: true | ||
|
||
# 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 | ||
# cache atlases needed by the tests | ||
- name: Cache Atlases | ||
id: atlas-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | # ensure we don't cache any interrupted atlas download and extraction! | ||
~/.brainglobe/* | ||
!~/.brainglobe/atlas.tar.gz | ||
key: ${{ runner.os }}-cached-atlases | ||
enableCrossOsArchive: false # ~ and $HOME evaluate to different places across OSs! | ||
|
||
# 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 | ||
- if: ${{ steps.atlas-cache.outputs.cache-hit == 'true' }} | ||
name: List files in brainglobe data folder # good to be able to sanity check that user data is as expected | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install setuptools tox tox-gh-actions | ||
ls -af ~/.brainglobe/ | ||
# this runs the platform-specific tests declared in tox.ini | ||
- name: Test with tox | ||
uses: aganders3/headless-gui@v1 | ||
# Run tests | ||
- uses: neuroinformatics-unit/actions/test@v2 | ||
with: | ||
run: python -m tox | ||
env: | ||
PLATFORM: ${{ matrix.platform }} | ||
|
||
- name: Coverage | ||
uses: codecov/codecov-action@v3 | ||
python-version: ${{ matrix.python-version }} | ||
|
||
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) | ||
build_sdist_wheels: | ||
name: Build source distribution | ||
needs: [test] | ||
if: github.event_name == 'push' && github.ref_type == 'tag' | ||
runs-on: ubuntu-latest | ||
if: contains(github.ref, 'tags') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
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 }} | ||
run: | | ||
git tag | ||
python -m build . | ||
twine upload dist/* | ||
- uses: neuroinformatics-unit/actions/build_sdist_wheels@v2 | ||
|
||
|
||
upload_all: | ||
name: Publish build distributions | ||
needs: [build_sdist_wheels] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TWINE_API_KEY }} |
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 |
---|---|---|
|
@@ -82,6 +82,3 @@ venv/ | |
|
||
# written by setuptools_scm | ||
**/_version.py | ||
|
||
# Other test files | ||
Logs/ |
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 |
---|---|---|
@@ -1,5 +1,15 @@ | ||
include LICENSE | ||
include README.md | ||
include .napari-hub/DESCRIPTION.md | ||
include .napari-hub/config.yml | ||
include brainglobe_registration/napari.yaml | ||
include brainglobe_registration/resources/brainglobe.png | ||
exclude .pre-commit-config.yaml | ||
|
||
recursive-include brainglobe_registration/parameters *.txt | ||
recursive-include brainglobe_registration/resources *.tif | ||
recursive-exclude imgs *.png | ||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
recursive-exclude docs * | ||
recursive-exclude tests * |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes
File renamed without changes.
File renamed without changes.
7 changes: 1 addition & 6 deletions
7
...obe_registration/utils/brainglobe_logo.py → ...obe_registration/utils/brainglobe_logo.py
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
7 changes: 4 additions & 3 deletions
7
src/brainglobe_registration/utils/utils.py → brainglobe_registration/utils/utils.py
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
File renamed without changes.
Oops, something went wrong.