-
Notifications
You must be signed in to change notification settings - Fork 34
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
Adam Li
authored and
Adam Li
committed
Jun 9, 2021
1 parent
9a70b3b
commit 903ca53
Showing
33 changed files
with
1,463 additions
and
855 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 |
---|---|---|
@@ -0,0 +1,173 @@ | ||
version: 2 | ||
jobs: | ||
build_docs: | ||
docker: | ||
- image: circleci/python:3.8.5-buster | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- source-cache-realtime | ||
- checkout | ||
- run: | ||
name: Complete checkout | ||
command: | | ||
if ! git remote -v | grep upstream; then | ||
git remote add upstream git://github.com/mne-tools/mne-connectivity.git | ||
fi | ||
git fetch upstream | ||
- save_cache: | ||
key: source-cache-realtime | ||
paths: | ||
- ".git" | ||
- run: | ||
name: Set BASH_ENV | ||
command: | | ||
set -e | ||
echo "set -e" >> $BASH_ENV | ||
echo "export OPENBLAS_NUM_THREADS=4" >> $BASH_ENV | ||
echo "export XDG_RUNTIME_DIR=/tmp/runtime-circleci" >> $BASH_ENV | ||
wget -q -O tools/get_minimal_commands.sh https://raw.githubusercontent.com/mne-tools/mne-python/main/tools/get_minimal_commands.sh | ||
source tools/get_minimal_commands.sh | ||
echo "source ${PWD}/tools/get_minimal_commands.sh" >> $BASH_ENV | ||
echo "export PATH=~/.local/bin/:$PATH" >> $BASH_ENV | ||
echo "BASH_ENV:" | ||
cat $BASH_ENV | ||
mkdir -p ~/mne_data | ||
- run: | ||
name: Merge with upstream | ||
command: | | ||
echo $(git log -1 --pretty=%B) | tee gitlog.txt | ||
echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt | ||
if [[ $(cat merge.txt) != "" ]]; then | ||
echo "Merging $(cat merge.txt)"; | ||
git pull --ff-only upstream "refs/pull/$(cat merge.txt)/merge"; | ||
fi | ||
- restore_cache: | ||
keys: | ||
- pip-cache | ||
|
||
- run: | ||
name: Get Python running | ||
command: | | ||
pip install --user --upgrade --progress-bar off pip numpy | ||
pip install --user --upgrade --progress-bar off -r requirements.txt | ||
pip install --user --upgrade --progress-bar off "sphinxcontrib-bibtex==2.0.0" "https://api.github.com/repos/mne-tools/mne-python/zipball/main" "https://api.github.com/repos/rtfd/sphinx_rtd_theme/zipball/master" "https://api.github.com/repos/sphinx-gallery/sphinx-gallery/zipball/master" memory_profiler | ||
- save_cache: | ||
key: pip-cache | ||
paths: | ||
- ~/.cache/pip | ||
|
||
# Look at what we have and fail early if there is some library conflict | ||
- run: | ||
name: Check installation | ||
command: | | ||
which python | ||
python -c "import mne; mne.sys_info()" | ||
LIBGL_DEBUG=verbose python -c "import matplotlib.pyplot as plt; plt.figure()" | ||
python -c "import mne; mne.set_config('MNE_LOGGING_LEVEL', 'info')" | ||
python -c "import mne; level = mne.get_config('MNE_LOGGING_LEVEL'); assert level.lower() == 'info', repr(level)" | ||
# Load our data | ||
- restore_cache: | ||
keys: | ||
- data-cache | ||
|
||
- run: | ||
name: Get data | ||
command: | | ||
python setup.py develop --user | ||
mkdir -p ~/mne_data | ||
python -c "import mne; print(mne.datasets.sample.data_path(update_path=True))"; | ||
# Build docs | ||
- run: | ||
name: make html | ||
command: | | ||
cd doc; | ||
make html; | ||
# Save the JUnit file | ||
- store_test_results: | ||
path: doc/_build/test-results | ||
- store_artifacts: | ||
path: doc/_build/test-results | ||
destination: test-results | ||
|
||
# Save the outputs | ||
- store_artifacts: | ||
path: doc/_build/html/ | ||
destination: dev | ||
- persist_to_workspace: | ||
root: doc/_build | ||
paths: | ||
- html | ||
|
||
# Keep these separate, maybe better in terms of size limitations (?) | ||
- save_cache: | ||
key: data-cache | ||
paths: | ||
- ~/.mne | ||
- ~/mne_data/MNE-sample-data | ||
|
||
deploy: | ||
docker: | ||
- image: circleci/python:3.6-jessie | ||
steps: | ||
- attach_workspace: | ||
at: /tmp/build | ||
- restore_cache: | ||
keys: | ||
- website-cache | ||
- run: | ||
name: Fetch docs | ||
command: | | ||
set -e | ||
mkdir -p ~/.ssh | ||
echo -e "Host *\nStrictHostKeyChecking no" > ~/.ssh/config | ||
chmod og= ~/.ssh/config | ||
if [ ! -d ~/mne-tools.github.io ]; then | ||
git clone git@github.com:/mne-tools/mne-tools.github.io.git ~/mne-tools.github.io --depth=1 | ||
fi | ||
- run: | ||
name: Deploy docs | ||
command: | | ||
set -e; | ||
if [ "${CIRCLE_BRANCH}" == "master" ]; then | ||
git config --global user.email "circle@mne.com"; | ||
git config --global user.name "Circle CI"; | ||
cd ~/mne-tools.github.io; | ||
git checkout master | ||
git remote -v | ||
git fetch origin | ||
git reset --hard origin/master | ||
git clean -xdf | ||
echo "Deploying dev docs for ${CIRCLE_BRANCH}."; | ||
rm -Rf mne-realtime; | ||
cp -a /tmp/build/html mne-realtime; | ||
git add -A; | ||
git commit -m "CircleCI update of mne-realtime docs (${CIRCLE_BUILD_NUM})."; | ||
git push origin master; | ||
else | ||
echo "No deployment (build: ${CIRCLE_BRANCH})."; | ||
fi | ||
- save_cache: | ||
key: website-cache | ||
paths: | ||
- ~/mne-tools.github.io | ||
|
||
workflows: | ||
version: 2 | ||
|
||
default: | ||
jobs: | ||
- build_docs | ||
- deploy: | ||
requires: | ||
- build_docs | ||
filters: | ||
branches: | ||
only: | ||
- master |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Configuration for coverage.py | ||
|
||
[run] | ||
branch = True | ||
source = mne_realtime | ||
include = */mne_realtime/* | ||
omit = | ||
*/setup.py | ||
|
||
[report] | ||
exclude_lines = | ||
pragma: no cover | ||
def __repr__ | ||
if self.debug: | ||
if settings.DEBUG | ||
raise AssertionError | ||
raise NotImplementedError | ||
if 0: | ||
if __name__ == .__main__.: | ||
if self.verbose: | ||
show_missing = True |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
on: [status] | ||
jobs: | ||
circleci_artifacts_redirector_job: | ||
runs-on: ubuntu-20.04 | ||
name: Run CircleCI artifacts redirector | ||
steps: | ||
- name: GitHub Action step | ||
uses: larsoner/circleci-artifacts-redirector-action@master | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
artifact-path: 0/dev/index.html | ||
circleci-jobs: build_docs |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: 'linux / pip' | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
job: | ||
name: 'py3.9' | ||
runs-on: ubuntu-20.04 | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
name: 'Setup python' | ||
- shell: bash -el {0} | ||
run: | | ||
wget -q -O tools/get_minimal_commands.sh https://raw.githubusercontent.com/mne-tools/mne-python/main/tools/get_minimal_commands.sh | ||
source ./tools/get_minimal_commands.sh | ||
name: 'Install neuromag2ft' | ||
- shell: bash -el {0} | ||
run: neuromag2ft --version | ||
name: 'Test neuromag2ft' | ||
- shell: bash -el {0} | ||
run: ./tools/pip_dependencies.sh | ||
name: 'Install MNE-Realtime' | ||
- shell: bash -el {0} | ||
run: mne sys_info | ||
name: Print config | ||
- shell: bash -el {0} | ||
run: python -c "import mne; print(mne.datasets.testing.data_path(verbose=True))" | ||
name: 'Get test data' | ||
- shell: bash -el {0} | ||
run: pytest mne_realtime | ||
name: 'Run tests' | ||
- uses: codecov/codecov-action@v1 | ||
if: success() | ||
name: 'Upload coverage to CodeCov' |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: 'macos / conda' | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
job: | ||
name: 'py3.6' | ||
runs-on: macos-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: '3.7' | ||
auto-update-conda: true | ||
environment-file: 'environment.yml' | ||
activate-environment: 'mne_realtime' | ||
name: 'Setup conda' | ||
- shell: bash -el {0} | ||
run: ./tools/pip_dependencies.sh | ||
name: 'Install MNE-Realtime' | ||
- shell: bash -el {0} | ||
run: mne sys_info | ||
name: Print config | ||
- shell: bash -el {0} | ||
run: python -c "import mne; print(mne.datasets.testing.data_path(verbose=True))" | ||
name: 'Get test data' | ||
- shell: bash -el {0} | ||
run: pytest mne_realtime | ||
name: 'Run tests' | ||
- uses: codecov/codecov-action@v1 | ||
if: success() | ||
name: 'Upload coverage to CodeCov' |
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 |
---|---|---|
|
@@ -6,6 +6,8 @@ __pycache__/ | |
# C extensions | ||
*.so | ||
|
||
.DS_Store | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
|
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,28 +1,21 @@ | ||
:orphan: | ||
|
||
################ | ||
mne-realtime API | ||
mne-connectivity API | ||
################ | ||
|
||
:py:mod:`mne_realtime`: | ||
:py:mod:`mne_connectivity`: | ||
|
||
.. automodule:: mne_realtime | ||
.. automodule:: mne_connectivity | ||
:no-members: | ||
:no-inherited-members: | ||
|
||
MNE-Realtime | ||
============ | ||
MNE-Connectivity | ||
================ | ||
|
||
.. currentmodule:: mne_realtime | ||
.. currentmodule:: mne_connectivity | ||
|
||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
FieldTripClient | ||
LSLClient | ||
MockLSLStream | ||
MockRtClient | ||
RtEpochs | ||
RtClient | ||
StimServer | ||
StimClient |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.. _Adam Li: https://github.com/adam2392 |
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
Oops, something went wrong.