Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Commit 796840b

Browse files
Refactor: simplify scripts (#119)
* simplify CLI * drop CI/pep8 * fix vars * bash render * bash generate * bash test * prune Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 5dd7b1c commit 796840b

14 files changed

Lines changed: 210 additions & 275 deletions

File tree

.actions/assistant.py

Lines changed: 184 additions & 108 deletions
Large diffs are not rendered by default.

.actions/ipynb-generate.sh

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

.actions/ipynb-render.sh

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

.actions/ipynb-test.sh

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

.azure-pipelines/ipynb-publish.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,17 @@ jobs:
9090
9191
- bash: |
9292
while IFS= read -r line; do
93-
bash .actions/ipynb-generate.sh $line
93+
python .actions/assistant.py augment-script $line
9494
done <<< $(cat changed-folders.txt)
9595
condition: gt(variables['changed.folders'], 0)
9696
displayName: 'Generate notebook'
9797
9898
- bash: |
9999
# render the actual notebooks
100100
while IFS= read -r line; do
101-
bash .actions/ipynb-render.sh $line
101+
python .actions/assistant.py bash-render $line > .actions/_ipynb-render.sh
102+
cat .actions/_ipynb-render.sh
103+
bash .actions/_ipynb-render.sh
102104
done <<< $(cat changed-folders.txt)
103105
git status
104106
git commit -m "publish [GPU]: $(COMMIT_HASH)"

.azure-pipelines/ipynb-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ jobs:
7272

7373
- bash: |
7474
while IFS= read -r line; do
75-
bash .actions/ipynb-generate.sh $line
75+
python .actions/assistant.py augment-script $line
7676
done <<< $(cat changed-folders.txt)
7777
condition: gt(variables['changed.folders'], 0)
7878
displayName: 'Generate notebook'
7979
8080
- bash: |
8181
while IFS= read -r line; do
82-
bash .actions/ipynb-test.sh $line
82+
python .actions/assistant.py bash-test $line > .actions/_ipynb-test.sh
83+
cat .actions/_ipynb-test.sh
84+
bash .actions/_ipynb-test.sh
8385
done <<< $(cat changed-folders.txt)
8486
condition: and(succeeded(), gt(variables['changed.folders'], 0))
8587
displayName: 'PyTest notebook'

.github/workflows/ci_code-format.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,6 @@ on: # Trigger the workflow on push or pull request, but only for the main branc
1010
pull_request: {}
1111

1212
jobs:
13-
pep8-check-flake8:
14-
runs-on: ubuntu-20.04
15-
steps:
16-
- uses: actions/checkout@master
17-
- uses: actions/setup-python@v2
18-
with:
19-
python-version: 3.7
20-
- name: Install dependencies
21-
run: pip install flake8 && pip list
22-
shell: bash
23-
- name: PEP8
24-
run: |
25-
flake8 .
26-
2713
pre-commit-check:
2814
runs-on: ubuntu-latest
2915
steps:

.github/workflows/ci_docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ jobs:
6060
if: steps.changed.outputs.dirs != 0
6161
run: |
6262
while IFS= read -r line; do
63-
bash .actions/ipynb-generate.sh $line
64-
bash .actions/ipynb-render.sh $line
63+
python .actions/assistant.py augment-script $line
64+
python .actions/assistant.py bash-render $line > .actions/_ipynb-render.sh
65+
cat .actions/_ipynb-render.sh
66+
bash .actions/_ipynb-render.sh
6567
done <<< $(cat changed-folders.txt)
6668
env:
6769
DRY_RUN: 1

.github/workflows/ci_testing.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,16 @@ jobs:
7070
if: steps.changed.outputs.dirs != 0
7171
run: |
7272
while IFS= read -r line; do
73-
bash .actions/ipynb-generate.sh $line
73+
python .actions/assistant.py augment-script $line
7474
done <<< $(cat changed-folders.txt)
7575
shell: bash
7676

7777
- name: PyTest notebook
7878
if: success() && steps.changed.outputs.dirs != 0
7979
run: |
8080
while IFS= read -r line; do
81-
bash .actions/ipynb-test.sh $line
81+
python .actions/assistant.py bash-test $line > .actions/_ipynb-test.sh
82+
cat .actions/_ipynb-test.sh
83+
bash .actions/_ipynb-test.sh
8284
done <<< $(cat changed-folders.txt)
8385
shell: bash

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ repos:
6060
- mdformat-black
6161
- mdformat_frontmatter
6262

63-
# - repo: https://github.com/PyCQA/flake8
64-
# rev: 3.9.2
65-
# hooks:
66-
# - id: flake8
63+
- repo: https://github.com/PyCQA/flake8
64+
rev: 3.9.2
65+
hooks:
66+
- id: flake8

0 commit comments

Comments
 (0)