Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand exception groups #103

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
acf83c9
remove old meeting notes and user testing notes (#3)
tonyfast Nov 24, 2023
fdb2871
remove old code and templates, factor templates into some thing less …
tonyfast Nov 26, 2023
a9823be
patch pr msg
tonyfast Nov 27, 2023
83bdb9e
use more nbconvert machinery (#5)
tonyfast Nov 27, 2023
098637d
refactor css and settings into tigher components (#6)
tonyfast Nov 29, 2023
242413f
move most buttons and calls to action to the bottom of the document
tonyfast Nov 29, 2023
128cf8d
include cell_type in highlight
tonyfast Nov 29, 2023
44b9f62
add a place for site navigation
tonyfast Nov 29, 2023
cdff357
improve auditing (#8)
tonyfast Nov 30, 2023
b27d98b
add a first principle template for landmark based notebooks. (#9)
tonyfast Dec 3, 2023
91aef24
add more axe accessibility test constraints (#10)
tonyfast Dec 5, 2023
30562e7
increase utility of dialogs by allowing them to be block elements (#11)
tonyfast Dec 6, 2023
d9fbdda
fixes broken color theme and improves configuration (#13)
tonyfast Dec 7, 2023
6d34777
Clean up exporter to be in better shape for a release (#14)
tonyfast Dec 7, 2023
1efb904
remove errant import from test
tonyfast Dec 7, 2023
d10ccf0
integrate sa11y into the example (#15)
tonyfast Dec 7, 2023
0036967
make sa11y configurable
tonyfast Dec 7, 2023
f2bc000
Update README.md
tonyfast Dec 7, 2023
d49e741
add a xfail test for the sa11y violation with the intention to genera…
tonyfast Dec 8, 2023
3aeda4b
Revert "add a xfail test for the sa11y violation with the intention t…
tonyfast Dec 8, 2023
b153cc1
use the conda forge implementation on the vnu-validator (#17)
tonyfast Dec 10, 2023
4edd547
Test with VNU REST API (#19)
bollwyvl Dec 12, 2023
f7be77f
test sa11y as a third party with axe (#16)
tonyfast Dec 12, 2023
73bea0b
use star syntax for exception grou-ps
tonyfast Dec 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/test-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: test-nbconvert-a11y
channels:
- conda-forge
- microsoft
- nodefaults
dependencies:
# run
- accessible-pygments
- exceptiongroup
- html5lib
- nbconvert
- python-slugify
- mdit-py-plugins
- linkify-it-py >=1,<3
- markdown-it-py
# runtimes
- python =3.11
- openjdk
- nodejs =20
# build
- doit
- hatch
- hatch-vcs
- pip
- python-build
- yarn =3.6
# audit
- vnu-validator
# lint
- ruff
# deps
- beautifulsoup4
- ipywidgets
- matplotlib-base
- mkdocs-material
- mkdocstrings
- numpy
- playwright
- pytest
- pytest-html
- pytest-playwright
- pytest-sugar
- pytest-xdist
- requests-cache
# report
- scipy
- pandas
6 changes: 3 additions & 3 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
on:
pull_request:
types:
- opened
- opened

jobs:
comment:
Expand All @@ -15,4 +15,4 @@ jobs:
with:
message: |
A preview fo the exported examples will be rendered at
https://iota-school.github.io/notebooks-for-all/branch/${{ github.event.pull_request.head.ref }}/exports/html
https://${{ github.repository_owner }}.github.io/nbconvert-a11y/branch/${{ github.event.pull_request.head.ref }}/exports/html/lorenz-executed-a11y.html
326 changes: 169 additions & 157 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,157 +1,169 @@
name: pytest nbconvert-a11y, axe test exports, build docs.
on:
- push
jobs:
format:
name: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: install dev dependencies
run: python -m pip install --upgrade pip hatch
- name: run formatters
run: |
echo "~~~bash" > "${GITHUB_STEP_SUMMARY}"
hatch run format:code 2>&1 | tee --append "${GITHUB_STEP_SUMMARY}"
echo "~~~" >> "${GITHUB_STEP_SUMMARY}"
- name: print diff
run: |
echo "~~~diff" >> "${GITHUB_STEP_SUMMARY}"
git diff | tee --append "${GITHUB_STEP_SUMMARY}"
echo "~~~" >> "${GITHUB_STEP_SUMMARY}"
test:
name: test package and accessibility
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version:
- "3.10"
runs-on: ubuntu-latest
steps:
- name: fetch all history and tags
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 1
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('test-environment.yml') }}
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: test-environment.yml
cache-environment: true
- name: init plawright
run: |
playwright install --with-deps chromium
- name: init node & files
run: |
npm install vnu-jar axe-core
doit copy
- name: init dev module
run: |
pip install -e.
- name: smoke test
run: |
# the smoke generate html assets that are used in the accessibility testing.
# we run this script to generate assets and test the nbconvert-a11y module.
# failures here will stop any docs builds
pytest tests/test_smoke.py
- name: a11y tests
# always build the docs to see what the new versions look like.
continue-on-error: true
run: |
pytest --deselect tests/test_smoke.py \
-n auto --self-contained-html --html=tests/exports/pytest/report.html
- name: build wheel and sdist
run: |
python -m build
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- name: mkdocs
run: |
mkdocs build -v
- uses: actions/upload-artifact@v3
with:
name: site
path: site
publish:
name: publish the mkdocs build to github pages
needs: [test]
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: site
path: site
- name: Deploy main 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.ref_name == 'main' }}
with:
folder: site # The folder the action should deploy.
single-commit: true
- name: Deploy non-main 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.ref_name != 'main' }}
with:
folder: site # The folder the action should deploy.
single-commit: true
target-folder: branch/${{ github.ref_name }}
release:
name: draft release when tagged
if: startsWith(github.ref, 'refs/tags/')
needs: [test]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: fetch contents
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache-dependency-path: pyproject.toml
- name: install twine and pytest
run: |
pip install twine pytest
- name: Publish package distributions to TestPyPI
run: |
twine upload --repository testpypi \
--user __token__ --password ${{secrets.HATCH_TEST_INDEX_AUTH}} \
dist/*
- name: install nbconvert-a11y dependencies from test pip
run: |
pip install \
--index-url 'https://test.pypi.org/simple/' \
--extra-index-url 'https://pypi.org/simple/' \
nbconvert-a11y
- name: test test release
run: |
pytest tests/test_smoke.py
- uses: ncipollo/release-action@v1
with:
artifacts: "dist/.*"
draft: true # does not trigger a created event
name: pytest nbconvert-a11y, axe test exports, build docs.

on:
push:
branches: [main]
pull_request:
branches: ['*']
workflow_dispatch:

env:
# Increase this value to reset cache if environments have not changed
CACHE_NUMBER: 2
# squash some known warnings
JUPYTER_PLATFORM_DIRS: 1

jobs:
format:
name: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: install dev dependencies
run: python -m pip install --upgrade pip hatch
- name: run formatters
run: |
echo "~~~bash" > "${GITHUB_STEP_SUMMARY}"
hatch run format:code 2>&1 | tee --append "${GITHUB_STEP_SUMMARY}"
echo "~~~" >> "${GITHUB_STEP_SUMMARY}"
- name: print diff
run: |
echo "~~~diff" >> "${GITHUB_STEP_SUMMARY}"
git diff | tee --append "${GITHUB_STEP_SUMMARY}"
echo "~~~" >> "${GITHUB_STEP_SUMMARY}"

test:
name: test package and accessibility
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version:
- "3.10"
runs-on: ubuntu-latest
steps:
- name: fetch all history and tags
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: .github/test-environment.yml
- name: init plawright
run: |
playwright install --with-deps chromium
- name: init node & files
run: |
yarn
doit copy
- name: init dev module
run: |
python3 -m pip install -e . --no-deps --no-build-isolation --ignore-installed
- name: check pip env
run: |
python3 -m pip check
- name: smoke test
run: |
# the smoke generate html assets that are used in the accessibility testing.
# we run this script to generate assets and test the nbconvert-a11y module.
# failures here will stop any docs builds
pytest --color=yes tests/test_smoke.py
- name: build wheel and sdist
run: |
pyproject-build
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- name: mkdocs
run: |
mkdocs build -v
- uses: actions/upload-artifact@v3
with:
name: site
path: site
- name: a11y tests
# always build the docs to see what the new versions look like.
# continue-on-error: true
run: |
pytest \
--color=yes \
-n auto \
--deselect tests/test_smoke.py \
--self-contained-html \
--html=tests/exports/pytest/report.html

publish:
name: publish the mkdocs build to github pages
needs: [test]
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: site
path: site
- name: Deploy main 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.ref_name == 'main' }}
with:
folder: site # The folder the action should deploy.
single-commit: true
- name: Deploy non-main 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.ref_name != 'main' }}
with:
folder: site # The folder the action should deploy.
single-commit: true
target-folder: branch/${{ github.ref_name }}

release:
name: draft release when tagged
if: startsWith(github.ref, 'refs/tags/')
needs: [test]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: fetch contents
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache-dependency-path: pyproject.toml
- name: install twine and pytest
run: |
pip install twine pytest
- name: Publish package distributions to TestPyPI
run: |
twine upload --repository testpypi \
--user __token__ --password ${{secrets.HATCH_TEST_INDEX_AUTH}} \
dist/*
- name: install nbconvert-a11y dependencies from test pip
run: |
pip install \
--index-url 'https://test.pypi.org/simple/' \
--extra-index-url 'https://pypi.org/simple/' \
nbconvert-a11y
- name: test test release
run: |
pytest tests/test_smoke.py
- uses: ncipollo/release-action@v1
with:
artifacts: "dist/.*"
draft: true # does not trigger a created event
Loading
Loading