Skip to content

Commit

Permalink
Merge remote-tracking branch 'gallantlab/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
pcklink committed Nov 23, 2023
2 parents f4fe3b0 + 45772ed commit 6243aa7
Show file tree
Hide file tree
Showing 75 changed files with 1,147 additions and 979 deletions.
33 changes: 33 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# For more configuration details:
# https://docs.codecov.io/docs/codecov-yaml

# Check if this file is valid by running in bash:
# curl -X POST --data-binary @.codecov.yml https://codecov.io/validate

# Coverage configuration
# ----------------------
coverage:
status:
project:
default:
threshold: 1% # complain if change in codecoverage is greater than 1%
patch: false
range: 70..90 # First number represents red, and second represents green
# (default is 70..100)
round: down # up, down, or nearest
precision: 2 # Number of decimal places, between 0 and 5


# Ignoring Paths
# --------------
# which folders/files to ignore
# ignore:
# - */tests/.*
# - setup.py

# Pull request comments:
# ----------------------
# Diff is the Coverage Diff of the pull request.
# Files are the files impacted by the pull request
comment: false
# layout: diff, files # accepted in any order: reach, diff, flags, and/or files
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
45 changes: 45 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build docs

on:
push:
pull_request:

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y inkscape
pip install --upgrade pip
pip install wheel numpy "cython<3.0" pillow
pip install -q ipython Sphinx sphinx-gallery numpydoc
pip install -e . --no-build-isolation
python -c 'import cortex; print(cortex.__full_version__)'
- name: Build documents
run: |
cd docs && make html && cd ..
touch docs/_build/html/.nojekyll
- name: Publish to gh-pages if tagged
if: startsWith(github.ref, 'refs/tags')
uses: JamesIves/github-pages-deploy-action@v4.4.3
with:
branch: gh-pages
folder: docs/_build/html
22 changes: 22 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
50 changes: 50 additions & 0 deletions .github/workflows/install_from_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Install from wheel

on:
push:
branches:
- main
pull_request:

jobs:
install-from-wheel:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
max-parallel: 5

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y inkscape
pip install --upgrade pip
pip install wheel numpy "cython<3.0"
- name: Create the wheel
run: python setup.py bdist_wheel

- name: Install from the wheel
run: |
pip install $(ls dist/*.whl) --no-build-isolation
- name: Test installation of the filestore
run: |
# change directory to avoid conflict with cortex directory
cd ..
python -c 'import cortex; print(cortex.db.filestore)'
python -c 'from cortex.webgl.view import cmapdir; print(cmapdir)'
28 changes: 28 additions & 0 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and publish to PyPI if tagged
on: push
jobs:
build-n-publish:
name: Build and publish to PyPI if tagged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
- name: Build a source tarball
run: >-
python -m
build
--sdist
--outdir dist/
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Run tests

on:
push:
branches:
- main
pull_request:

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10"]
max-parallel: 5

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y inkscape
pip install --upgrade pip
pip install wheel numpy "cython<3.0"
# force using latest nibabel
pip install -U nibabel
pip install -e . --no-build-isolation
python -c 'import cortex; print(cortex.__full_version__)'
- name: Test with pytest
run: |
pip install -q pytest pytest-cov codecov
pytest --cov=./
- name: Run codecov
run: |
codecov
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ lib64
# NOTE: the filestore really should never be in the git repo... Needs work.
filestore/db/*/cache
filestore/db/*/surface-info
filestore

# Installer logs
pip-log.txt
Expand All @@ -42,15 +43,22 @@ nosetests.xml
.project
.pydevproject

# OS X bullshit
# OS X
.DS_store

# vim temp files
*~

# vscode
# vscode and other IDEs
.vscode
.idea

*.nfs*

.ipynb_checkpoints/

# docs build
docs/_build
docs/auto_examples
docs/generated
docs/colormaps.rst
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 6243aa7

Please sign in to comment.