Skip to content

Commit

Permalink
Merge pull request #510 from NeuroTechX/develop
Browse files Browse the repository at this point in the history
Stable version 1.0.0
  • Loading branch information
sylvchev authored Oct 23, 2023
2 parents 2a0b97f + 0f8b864 commit bb31be3
Show file tree
Hide file tree
Showing 157 changed files with 9,611 additions and 3,509 deletions.
92 changes: 17 additions & 75 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Create local data folder
run: |
Expand Down Expand Up @@ -44,10 +44,10 @@ jobs:
- name: Install dependencies
if: steps.cached-dataset-docs.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --with docs,deeplearning
run: poetry install --no-interaction --no-root --with docs --extras deeplearning

- name: Install library
run: poetry install --no-interaction --with docs,deeplearning
run: poetry install --no-interaction --with docs --extras deeplearning

- name: Build docs
run: |
Expand All @@ -69,7 +69,7 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Create local data folder
run: |
Expand All @@ -85,23 +85,12 @@ jobs:
docs/build
- name: Checkout moabb.github.io
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: "NeuroTechX/moabb.github.io"
path: moabb-ghio
token: ${{ secrets.MOABB_GHIO }}

- name: Deploy on moabb.neurotechx.com
run: |
git config --global user.email "ci@neurotechx.com"
git config --global user.name "Github Actions"
cd ~/work/moabb/moabb/moabb-ghio
rm -Rf docs
cp -a ~/work/moabb/moabb/docs/build/html ./docs
git add -A
git commit -m "GH Actions update of docs ($GITHUB_RUN_ID - $GITHUB_RUN_NUMBER)"
git push origin master
deploy_gh_pages:
if: ${{ github.ref == 'refs/heads/develop' }}
needs: build_docs
Expand All @@ -112,7 +101,7 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Create local data folder
run: |
Expand All @@ -128,11 +117,21 @@ jobs:
docs/build
- name: Checkout gh pages
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: gh-pages
path: moabb-ghpages

- name: Deploy Neurotechx Subpage
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: NeuroTechX/moabb.github.io
destination_dir: docs/
publish_branch: master
publish_dir: ./docs/build/html
cname: moabb.neurotechx.com/

- name: Deploy on gh-pages
run: |
git config --global user.email "ci@neurotechx.com"
Expand All @@ -143,60 +142,3 @@ jobs:
git add -A
git commit -m "GH Actions update of GH pages ($GITHUB_RUN_ID - $GITHUB_RUN_NUMBER)"
git push origin gh-pages
- name: Deploy to moabb.neurotechx.com/
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop'}}
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: NeuroTechX/moabb.github.io
destination_dir: docs/
publish_branch: master
publish_dir: ./docs/build/html
cname: moabb.neurotechx.com/

# Previous test with moabb GH pages, official docs point to moabb.github.io
###########################################################################
# Since we want the URL to be neurotechx.github.io/docs/ the html output needs to be put in a ./docs subfolder of the publish_dir
# - name: Move docs into site folder
# run: |
# mkdir site
# mv docs/build/html site/docs

# - name: Deploy on moabb gh-pages
# uses: peaceiris/actions-gh-pages@v3
# if: github.ref == 'refs/heads/master'
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: site

# Using checkout and push actions, not working
##############################################
# - name: Install SSH key
# uses: shimataro/ssh-key-action@v2
# with:
# key: ${{ secrets.MOABB_DOCS_SSH }}
# known_hosts: ${{ secrets.KNOWN_HOST_GH }}

# - name: Checkout moabb.github.io
# uses: actions/checkout@v2
# with:
# repository: "NeuroTechX/moabb.github.io"
# path: moabb-ghio
# fetch-depth: 0
# persist-credentials: false

# - name: Add html files
# run: |
# cd ~/work/moabb/moabb/moabb-ghio
# rm -Rf docs
# cp -a ~/work/moabb/moabb/docs/build/html ./docs
# git config --global user.email "ci@neurotechx.com"
# git config --global user.name "Github Actions"
# git commit -m "GH Actions update of docs ($GITHUB_RUN_ID - $GITHUB_RUN_NUMBER)" -a

# - name: Push
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.MOABB_GHIO }}
# repository: "NeuroTechX/moabb.github.io"
76 changes: 76 additions & 0 deletions .github/workflows/test-braindecode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Test-braindecode

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
test:
name: dev ${{ matrix.os }}, py-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
python-version: ["3.8"]
defaults:
run:
shell: bash
steps:
- name: Checkout MOABB
uses: actions/checkout@v4

- name: Checkout Braindecode
uses: actions/checkout@v4
with:
repository: braindecode/braindecode
path: braindecode

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Create/Restore MNE Data Cache
id: cache-mne_data
uses: actions/cache@v3
with:
path: ~/mne_data
key: ${{ runner.os }}-mne

- name: Load cached venv
if: runner.os != 'Windows'
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key:
testvenv-${{ matrix.os }}-py${{matrix.python-version}}-${{
hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: |
(runner.os != 'Windows') &&
(steps.cached-poetry-dependencies.outputs.cache-hit != 'true')
run: poetry install --no-interaction --no-root

- name: Install library
run: poetry install --no-interaction

- name: Install and test braindecode
run: |
source $VENV
poetry run pip install torch
cd braindecode
poetry run pip install -e .[tests]
poetry run pytest test/
# poetry run pip install -U https://api.github.com/repos/braindecode/braindecode/zipball/master
6 changes: 3 additions & 3 deletions .github/workflows/test-devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -46,11 +46,11 @@ jobs:
if: |
(runner.os != 'Windows') &&
(steps.cached-poetry-dependencies.outputs.cache-hit != 'true')
run: poetry install --no-interaction --no-root --with deeplearning
run: poetry install --no-interaction --no-root --extras deeplearning

- name: Install library (Linux/OSX)
if: ${{ runner.os != 'Windows' }}
run: poetry install --no-interaction --with deeplearning
run: poetry install --no-interaction --extras deeplearning

- name: Install library (Windows)
if: ${{ runner.os == 'Windows' }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -46,11 +46,11 @@ jobs:
if: |
(runner.os != 'Windows') &&
(steps.cached-poetry-dependencies.outputs.cache-hit != 'true')
run: poetry install --no-interaction --no-root --with deeplearning
run: poetry install --no-interaction --no-root --extras deeplearning

- name: Install library (Linux/OSX)
if: ${{ runner.os != 'Windows' }}
run: poetry install --no-interaction --with deeplearning
run: poetry install --no-interaction --extras deeplearning

- name: Install library (Windows)
if: ${{ runner.os == 'Windows' }}
Expand Down
69 changes: 60 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,90 @@ ci:
autoupdate_branch: "develop"
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: quarterly
skip: []
skip: [ ]
submodules: false

exclude: ".*svg"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-json
- id: check-executables-have-shebangs
- id: check-toml
- id: check-docstring-first
- id: check-added-large-files
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: mixed-line-ending
- id: end-of-file-fixer
- id: check-case-conflict
- id: forbid-new-submodules
- id: pretty-format-json
args: [ "--autofix", "--no-sort-keys", "--indent=4" ]


- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.9.1
hooks:
- id: black
language_version: python3.8
args: [ --line-length=90, --target-version=py38 ]

- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.3.0]
exclude: ^.github/

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear]
additional_dependencies: [
'flake8-blind-except',
'flake8-docstrings',
'flake8-bugbear',
'flake8-comprehensions',
'flake8-docstrings',
'flake8-implicit-str-concat',
'pydocstyle>=5.0.0',
]
exclude: ^docs/ | ^setup\.py$ |

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
hooks:
- id: prettier
args: [--print-width=90, --prose-wrap=always]
- id: ruff
args: [ --fix, --exit-non-zero-on-fix, --ignore, E501 ]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args:
- --ignore-words-list=additionals,alle,alot,bund,currenty,datas,farenheit,falsy,fo,haa,hass,iif,incomfort,ines,ist,nam,nd,pres,pullrequests,resset,rime,ser,serie,te,technik,ue,unsecure,withing,zar
- --skip="./.*,*.csv,*.json,*.ambr"
- --quiet-level=2
exclude_types: [ csv, json, svg ]
exclude: ^tests/|generated/

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
hooks:
- id: yamllint
exclude: >
(?x)^(
.pre-commit-config.yaml*|
.github/workflows/.*|
)$
Loading

0 comments on commit bb31be3

Please sign in to comment.