Skip to content

Commit de0d24f

Browse files
authored
Add CI/CD pipeline, fix all notebooks (#71)
* update deps * add backoff when downloading assets * add Makefile * add link search test file * add urlextract dependency * run .py and .ipynb tests in make * add github workflow * remove an old notebook * don't run .ipynb tests on exercise notebooks * skip existing files when downloading * use max workers in makefile * mirdotcom.py changes * don't run tests on `adtlib.ipynb` * rename `kmeans_instrument_classification` to make clear that it is an exercise * pin more recent `mir_eval` version, add `soundfile` dep * fix all notebooks * run tests weekly * retry tests * Migrate to `JupyterBook` (#73) * Implement retry mechanism in download functions * Hardcode assets file paths * initial commit * add requirements.in * add postBuild * make package installable * update all `mirdotcom.init()` calls * add binder badge * try fix install * update all binder links * remove badges, update colab references * fix line break * add jupyter-book requirement * try refactor * update all headings * fix test paths * update cross-references * add initial jupyter-book build * try fix * remove musicinformationretrieval.com URLs and "Back to index" * update config to fix thebe + binder * update all notebooks * actually set working directory * replace references to "workshop" with "website" * fix sheet music representations links * fix midi conversion table * remove function names as section titles * axis labels * remove hardcoded ../../assets, replace with `mirdotcom.get_audio` * add beginner tutorial * move "people who use this site" section * add build target to makefile * pin dependencies, minor fixes * add note about .ipynb * optimize imports * remove "hide-cell" * fix titles * add more unittests for notebooks * make notebooks pass tests * add black formatting + deps: run `make fix` * run black on files
1 parent 9ebce90 commit de0d24f

237 files changed

Lines changed: 16008 additions & 13412 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy_book.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: deploy-book
2+
3+
on:
4+
push:
5+
branches:
6+
- gh-pages
7+
8+
env:
9+
BASE_URL: /${{ github.event.repository.name }}
10+
11+
concurrency:
12+
group: "pages"
13+
cancel-in-progress: false
14+
15+
jobs:
16+
deploy-book:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
pages: write
20+
id-token: write
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Setup Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.10'
28+
cache: pip
29+
30+
- name: Install dependencies
31+
run: |
32+
make install
33+
34+
- name: Build the book
35+
run: |
36+
source venv/bin/activate
37+
jupyter-book build mirdotcom
38+
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: "mirdotcom/_build/html"
43+
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test notebooks
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * 0'
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.10'
17+
- name: install & run nbmake
18+
run: |
19+
make install
20+
make test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ coverage.xml
5858

5959
# Sphinx documentation
6060
docs/_build/
61-
61+
venv/
62+
mirdotcom/_build

Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.PHONY: run install build fix
2+
3+
4+
run: venv/bin/jupyter-lab
5+
venv/bin/jupyter-lab README.md
6+
7+
install: venv/bin/jupyter-lab
8+
venv/bin/pip install -e .
9+
10+
test: venv/bin/jupyter-lab
11+
echo "Running .py tests..."
12+
venv/bin/pytest -n=auto --ignore-glob='*.ipynb' --reruns 3 --reruns-delay 5 tests
13+
echo "Running .ipynb tests..."
14+
venv/bin/pytest --nbmake -n=auto --ignore-glob='*.py' --ignore-glob='*exercise*.ipynb' --ignore-glob='*adtlib*.ipynb' --reruns 3 --reruns-delay 5 mirdotcom
15+
16+
venv/:
17+
python3 -m venv venv
18+
venv/bin/pip install --upgrade pip
19+
20+
venv/bin/jupyter-lab: venv/
21+
venv/bin/pip install -r requirements.txt
22+
touch venv/bin/jupyter-lab
23+
24+
build:
25+
jupyter-book build mirdotcom
26+
27+
fix:
28+
black mirdotcom/content --target-version=py310

README.md

Lines changed: 59 additions & 80 deletions
Large diffs are not rendered by default.

content/10_decomposition/nmf.ipynb

Lines changed: 0 additions & 588 deletions
This file was deleted.

content/10_decomposition/pca.ipynb

Lines changed: 0 additions & 359 deletions
This file was deleted.

content/1_introduction/about.ipynb

Lines changed: 0 additions & 113 deletions
This file was deleted.

content/1_introduction/basic_mir.ipynb

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)