Skip to content

Commit

Permalink
fix nbs execution
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnv1 committed Sep 12, 2023
1 parent 6388a80 commit 41b867d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,26 @@ jobs:
matrix:
os: ['Ubuntu']
python-version: ['3.8', '3.10']
pytorch-version: ['2.0.0']
pytorch-version: ['2.0.1']

steps:
- uses: actions/checkout@v3

- name: Setup conda dependencies
uses: conda-incubator/setup-miniconda@v2
- name: Setup environment
uses: actions/setup-python@v4
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python-version }}

- name: Install pytorch
shell: bash
run: pip install torch==${{ matrix.pytorch-version }} torchvision --index-url https://download.pytorch.org/whl/cpu


- name: Install dependencies
shell: bash -l {0}
run: |
conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly -c pytorch
make setup
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Check deps
shell: bash -l {0}
Expand Down Expand Up @@ -76,7 +80,7 @@ jobs:
run: |
conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly -c pytorch
pip install -r requirements.txt
pip install -r requirements-dev.txt;
pip install -r requirements-dev.txt
- uses: quarto-dev/quarto-actions/setup@v2

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SOURCEDIR = nbs

DSTDIR = _nbs
.PHONY: purge generate execute sphinx build setup check-deps

purge:
Expand All @@ -8,11 +8,11 @@ purge:

generate:
@echo "\n\nGenerating all tutorials notebooks to '$(SOURCEDIR)'...\n"
jupyter nbconvert $(SOURCEDIR)/**.ipynb --to notebook --output-dir $(SOURCEDIR)
jupyter nbconvert $(SOURCEDIR)/**.ipynb --to notebook --output-dir $(DSTDIR)

execute:
@echo "\n\nExecuting all tutorials notebooks under '$(SOURCEDIR)'...\n"
jupyter nbconvert $(SOURCEDIR)/**.ipynb --execute --inplace
@echo "\n\nExecuting all tutorials notebooks under '$(DSTDIR)'...\n"
jupyter nbconvert $(DSTDIR)/**.ipynb --execute --inplace

build: purge generate render

Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
jupyter
nbconvert
pre-commit

0 comments on commit 41b867d

Please sign in to comment.