From 8abc6eaf204f7552dad18021b0506df063900fd5 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Tue, 21 Nov 2023 19:01:05 -0800 Subject: [PATCH 01/33] build wheel and upload artifact --- .github/workflows/test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f3c378e..84afd0eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,6 +71,13 @@ jobs: continue-on-error: true run: | pytest --deselect tests/test_smoke.py + - 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 From 883774dc08c31415c4f0cde473bc1626a4745ef8 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Tue, 21 Nov 2023 19:02:52 -0800 Subject: [PATCH 02/33] xx --- test-environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/test-environment.yml b/test-environment.yml index edb30283..26787d2c 100644 --- a/test-environment.yml +++ b/test-environment.yml @@ -14,6 +14,7 @@ dependencies: - markdown-it-py[plugins,linkify] - python-slugify - html5lib + - build - nodejs - playwright - nbconvert From 63a99190f507820f4e8abf999c5c4898035b01c4 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Tue, 21 Nov 2023 19:40:12 -0800 Subject: [PATCH 03/33] activate on tags, separate release publish tasks --- .github/workflows/test.yml | 52 +++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84afd0eb..cadc89ec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,8 @@ name: pytest nbconvert-a11y, axe test exports, build docs. on: - - push + - push: + tags: + - "*" jobs: format: name: format @@ -81,6 +83,18 @@ jobs: - 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: + - uses: actions/download-artifact@v3 + with: + name: dist - name: Deploy main 🚀 uses: JamesIves/github-pages-deploy-action@v4 if: ${{ github.ref_name == 'main' }} @@ -94,3 +108,39 @@ jobs: 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] + strategy: + matrix: + python-version: + - "3.10" + runs-on: ubuntu-latest + steps: + - name: fetch contents + uses: actions/checkout@v2 + - uses: actions/download-artifact@v3 + with: + name: dist + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: pip + cache-dependency-path: pyproject.toml + - name: install nbconvert-a11y dependencies from pip + run: | + pip install pytest accessible-pygments html5lib markdown-it-py[linkify,plugins] nbconvert python-slugify + - name: install nbconvert-a11y dependencies from test pip + env: + PIP_INDEX_URL: https://test.pypi.org/simple/ + PIP_EXTRA_INDEX_URL: https://pypi.org/simple/ + run: | + pip install nbconvert-a11y + - name: test test release + run: | + pytest tests/test_smoke.py From adb51d8af879704aadfc4c29e152255852e3eb97 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Tue, 21 Nov 2023 19:40:51 -0800 Subject: [PATCH 04/33] fix trigger --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cadc89ec..d485df8a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,8 @@ name: pytest nbconvert-a11y, axe test exports, build docs. on: - - push: - tags: - - "*" + push: + tags: + - "*" jobs: format: name: format From a54db6e75794f58d31a5249b71054675385c4597 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Tue, 21 Nov 2023 19:43:55 -0800 Subject: [PATCH 05/33] revert triugger --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d485df8a..fbda469c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,6 @@ name: pytest nbconvert-a11y, axe test exports, build docs. on: - push: - tags: - - "*" + - push jobs: format: name: format From f5c73cde8a67554d2fc7744eb84cc18085c0b194 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Tue, 21 Nov 2023 19:49:13 -0800 Subject: [PATCH 06/33] use correwct artifact --- .github/workflows/test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fbda469c..4856da19 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -92,7 +92,7 @@ jobs: steps: - uses: actions/download-artifact@v3 with: - name: dist + name: site - name: Deploy main 🚀 uses: JamesIves/github-pages-deploy-action@v4 if: ${{ github.ref_name == 'main' }} @@ -110,10 +110,6 @@ jobs: name: draft release when tagged if: startsWith(github.ref, 'refs/tags/') needs: [test] - strategy: - matrix: - python-version: - - "3.10" runs-on: ubuntu-latest steps: - name: fetch contents From 3cd12b2605efcdd6c377b0f38d18c791e26c4bf3 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Tue, 21 Nov 2023 19:58:03 -0800 Subject: [PATCH 07/33] complete rename of package --- pyproject.toml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0101f97e..6a83e3a8 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ -# use the hatch build system for building and developing nbconvert_html5 +# use the hatch build system for building and developing nbconvert_a11y # it helps us manage virtual environments and build tasks [build-system] build-backend = "hatchling.build" @@ -11,7 +11,7 @@ requires = [ [tool.hatch.build.targets.wheel] [project] -name = "nbconvert-html5" +name = "nbconvert-a11y" description = "nbconvert templates using modern standards" readme = "README.md" url = "https://github.com/Iota-School/notebooks-for-all" @@ -36,7 +36,6 @@ classifiers = [ dependencies = [ "accessible-pygments", "html5lib", - "IPython", "markdown-it-py[linkify,plugins]", "nbconvert", "python-slugify", @@ -85,22 +84,22 @@ build = "mkdocs build -v" serve = "mkdocs serve -v" [project.entry-points."nbconvert.exporters"] -a11y = "nbconvert_html5.form_exporter:A11yExporter" -html5_test = "nbconvert_html5.exporters:Html5Test" +a11y = "nbconvert_a11y.form_exporter:A11yExporter" +html5_test = "nbconvert_a11y.exporters:Html5Test" [project.entry-points.pytest11] -a11y = "nbconvert_html5.form_exporter:A11yExporter" -axe = "nbconvert_html5.pytest_axe" +a11y = "nbconvert_a11y.form_exporter:A11yExporter" +axe = "nbconvert_a11y.pytest_axe" [tool.hatch.build.targets.wheel.shared-data] -"nbconvert_html5/templates" = "share/jupyter/nbconvert/templates" +"nbconvert_a11y/templates" = "share/jupyter/nbconvert/templates" # versioning is automatically synced using scm tools [tool.setuptools_scm] -write_to = "nbconvert_html5/_version.py" +write_to = "nbconvert_a11y/_version.py" [tool.hatch.build.hooks.vcs] -version-file = "nbconvert_html5/_version.py" +version-file = "nbconvert_a11y/_version.py" [tool.hatch.version] source = "vcs" From 59c31db0e9f7f9dc9ce882e9c8c4a5dec5128423 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Tue, 21 Nov 2023 20:04:25 -0800 Subject: [PATCH 08/33] increment cache --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4856da19..83abc3fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,7 @@ jobs: uses: actions/cache@v2 env: # Increase this value to reset cache if etc/example-environment.yml has not changed - CACHE_NUMBER: 0 + CACHE_NUMBER: 1 with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ From 7e204245ca6d92c817d737c7d906e9127fc1d955 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Tue, 21 Nov 2023 20:22:48 -0800 Subject: [PATCH 09/33] specify download artifact path --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83abc3fc..b1d71064 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -93,6 +93,7 @@ jobs: - uses: actions/download-artifact@v3 with: name: site + path: dist - name: Deploy main 🚀 uses: JamesIves/github-pages-deploy-action@v4 if: ${{ github.ref_name == 'main' }} @@ -117,6 +118,7 @@ jobs: - uses: actions/download-artifact@v3 with: name: dist + path: dist - name: Publish package distributions to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From d0f1cb1ed80a0090f1cf8507808cbf7dd2db33c9 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 11:00:25 -0800 Subject: [PATCH 10/33] split installation jobs in ci --- .github/workflows/test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1d71064..7682a7d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,12 +54,15 @@ jobs: with: environment-file: test-environment.yml cache-environment: true - - name: init playwright nbconvert-a11y + - name: init plawright run: | playwright install --with-deps chromium + - name: init node + run: | npm install vnu-jar axe-core + - name: init dev module + run: | pip install -e. - doit copy - name: smoke test run: | # the smoke generate html assets that are used in the accessibility testing. From cbcbcedbeee2da8db43b6676a0e0a235ea02f814 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 11:04:51 -0800 Subject: [PATCH 11/33] add old dep --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 6a83e3a8..0efae27b 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ classifiers = [ dependencies = [ "accessible-pygments", "html5lib", + "IPython", "markdown-it-py[linkify,plugins]", "nbconvert", "python-slugify", From 353f6ffa2deaa4f2ccd08f4455894248666c8a3c Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 11:50:40 -0800 Subject: [PATCH 12/33] rename package --- .gitignore | 10 +++++----- DEVELOPER.md | 2 +- dodo.py | 10 +++++----- mkdocs.yml | 4 ++-- {nbconvert_html5 => nbconvert_a11y}/__init__.py | 2 +- {nbconvert_html5 => nbconvert_a11y}/__main__.py | 0 {nbconvert_html5 => nbconvert_a11y}/_selectors.py | 0 {nbconvert_html5 => nbconvert_a11y}/audit.py | 0 {nbconvert_html5 => nbconvert_a11y}/exporters.py | 0 {nbconvert_html5 => nbconvert_a11y}/form_exporter.py | 0 {nbconvert_html5 => nbconvert_a11y}/pytest_axe.py | 2 +- .../templates/a11y/activity-log.html.j2 | 0 .../templates/a11y/audit.j2.html | 0 .../templates/a11y/expanded.html.j2 | 0 .../templates/a11y/help.html.j2 | 0 .../templates/a11y/settings.html.j2 | 0 .../templates/a11y/settings.js | 0 .../templates/a11y/style.css | 0 .../templates/a11y/table.html.j2 | 0 .../templates/a11y/visibility.html.j2 | 0 .../templates/semantic-forms/README.md | 0 .../templates/semantic-forms/aside-dl.html.j2 | 0 .../templates/semantic-forms/base.html.j2 | 0 .../templates/semantic-forms/cell.html.j2 | 0 .../templates/semantic-forms/conf.json | 0 .../templates/semantic-forms/displays.j2.html | 0 .../templates/semantic-forms/feed.html.j2 | 0 .../templates/semantic-forms/forms.html.j2 | 0 .../templates/semantic-forms/index.html.j2 | 0 .../templates/semantic-forms/main.html.j2 | 0 .../templates/semantic-forms/ol.html.j2 | 0 .../templates/semantic-forms/schema-dl.html.j2 | 0 .../templates/semantic-forms/sections.html.j2 | 0 .../templates/semantic-forms/smol.html.j2 | 0 .../templates/semantic-forms/static/script.js | 0 .../templates/semantic-forms/static/style.css | 0 .../templates/semantic-forms/style.css | 0 .../templates/semantic-forms/ul.html.j2 | 0 tests/configurations/default.py | 2 +- tests/nbconvert_html5.md | 2 +- tests/templates/experiments.md.j2 | 10 +++++----- tests/test_a11y.py | 2 +- tests/test_nbconvert_html5.py | 2 +- tests/test_smoke.py | 4 ++-- 44 files changed, 26 insertions(+), 26 deletions(-) rename {nbconvert_html5 => nbconvert_a11y}/__init__.py (87%) rename {nbconvert_html5 => nbconvert_a11y}/__main__.py (100%) rename {nbconvert_html5 => nbconvert_a11y}/_selectors.py (100%) rename {nbconvert_html5 => nbconvert_a11y}/audit.py (100%) rename {nbconvert_html5 => nbconvert_a11y}/exporters.py (100%) rename {nbconvert_html5 => nbconvert_a11y}/form_exporter.py (100%) rename {nbconvert_html5 => nbconvert_a11y}/pytest_axe.py (98%) rename {nbconvert_html5 => nbconvert_a11y}/templates/a11y/activity-log.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/a11y/audit.j2.html (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/a11y/expanded.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/a11y/help.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/a11y/settings.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/a11y/settings.js (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/a11y/style.css (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/a11y/table.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/a11y/visibility.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/README.md (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/aside-dl.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/base.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/cell.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/conf.json (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/displays.j2.html (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/feed.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/forms.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/index.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/main.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/ol.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/schema-dl.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/sections.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/smol.html.j2 (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/static/script.js (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/static/style.css (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/style.css (100%) rename {nbconvert_html5 => nbconvert_a11y}/templates/semantic-forms/ul.html.j2 (100%) diff --git a/.gitignore b/.gitignore index ab6d2b38..1a6f1b33 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,19 @@ docs site tests/exports -nbconvert_html5/templates/a11y/light-code.css -nbconvert_html5/templates/a11y/dark-code.css +nbconvert_a11y/templates/a11y/light-code.css +nbconvert_a11y/templates/a11y/dark-code.css *~ *# .#* *.pyc .python-version -nbconvert_html5.egg-info +nbconvert_a11y.egg-info node_modules __pycache__ .doit.db.* -nbconvert_html5/_version.py +nbconvert_a11y/_version.py tests/outputs/*.html build/* tests/out.html @@ -21,4 +21,4 @@ tests/out.html docs/**/*.html docs/**/*.json settings.json -nbconvert_html5/templates/a11y/axe.js +nbconvert_a11y/templates/a11y/axe.js diff --git a/DEVELOPER.md b/DEVELOPER.md index cba27065..a15c0e79 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -1,4 +1,4 @@ -# developing and using the `nbconvert_html5` python module +# developing and using the `nbconvert_a11y` python module this project digs hooks into `nbconvert` to modify the accessible experience for static jupyter notebooks. diff --git a/dodo.py b/dodo.py index 2b20e92f..e8292970 100644 --- a/dodo.py +++ b/dodo.py @@ -16,7 +16,7 @@ HTML = EXPORTS / "html" AUDITS = EXPORTS / "audits" REPORTS = EXPORTS / "reports" -TEMPLATES = Path("nbconvert_html5/templates/a11y") +TEMPLATES = Path("nbconvert_a11y/templates/a11y") def do(cmd, *args): @@ -180,7 +180,7 @@ def readme(target, ext, title): # ) # if audit: -# from nbconvert_html5.audit import main +# from nbconvert_a11y.audit import main # audits = [x["audit"] for x in configs] # yield dict( @@ -305,7 +305,7 @@ def readme(target): body += f"* [{t.name}]({t.relative_to(target)})\n" (target / "README.md").write_text(body) - from nbconvert_html5.audit import audit_one + from nbconvert_a11y.audit import audit_one targets = [] for x in Path(html_dir).rglob("*.html"): @@ -365,7 +365,7 @@ def task_report(): # ] # ) # def task_audit(dir, folder="audit"): -# from nbconvert_html5.audit import audit_one +# from nbconvert_a11y.audit import audit_one # for x in Path(dir).rglob("*.html"): # a = x.parent / folder / x.name # yield dict( @@ -413,7 +413,7 @@ def task_report(): # rel_targets = [x.parent / "data" / ("axe-" + x.name + ".json") for x in rel] # if audit: -# from nbconvert_html5.audit import main +# from nbconvert_a11y.audit import main # yield dict( # name=f"audit", diff --git a/mkdocs.yml b/mkdocs.yml index c4bf0bf4..ec0b5caa 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -63,8 +63,8 @@ nav: - exports/reports/experiment.md - exports/reports/notebooks.md - exports/reports/configs.md - - nbconvert_html5 module: - - nbconvert_html5.md + - nbconvert_a11y module: + - nbconvert_a11y.md - Notebooks for all media: media.md hooks: diff --git a/nbconvert_html5/__init__.py b/nbconvert_a11y/__init__.py similarity index 87% rename from nbconvert_html5/__init__.py rename to nbconvert_a11y/__init__.py index 6bbf8842..ce5ff108 100644 --- a/nbconvert_html5/__init__.py +++ b/nbconvert_a11y/__init__.py @@ -8,6 +8,6 @@ we found that nbconvert's configuration system was valuable for recording the state of manual testing sessions. -we called this library `nbconvert_html5` because we hope discover html5 patterns +we called this library `nbconvert_a11y` because we hope discover html5 patterns that offer a POUR notebook reading experience for assistive tech. """ diff --git a/nbconvert_html5/__main__.py b/nbconvert_a11y/__main__.py similarity index 100% rename from nbconvert_html5/__main__.py rename to nbconvert_a11y/__main__.py diff --git a/nbconvert_html5/_selectors.py b/nbconvert_a11y/_selectors.py similarity index 100% rename from nbconvert_html5/_selectors.py rename to nbconvert_a11y/_selectors.py diff --git a/nbconvert_html5/audit.py b/nbconvert_a11y/audit.py similarity index 100% rename from nbconvert_html5/audit.py rename to nbconvert_a11y/audit.py diff --git a/nbconvert_html5/exporters.py b/nbconvert_a11y/exporters.py similarity index 100% rename from nbconvert_html5/exporters.py rename to nbconvert_a11y/exporters.py diff --git a/nbconvert_html5/form_exporter.py b/nbconvert_a11y/form_exporter.py similarity index 100% rename from nbconvert_html5/form_exporter.py rename to nbconvert_a11y/form_exporter.py diff --git a/nbconvert_html5/pytest_axe.py b/nbconvert_a11y/pytest_axe.py similarity index 98% rename from nbconvert_html5/pytest_axe.py rename to nbconvert_a11y/pytest_axe.py index 4d217f69..84c65cd4 100644 --- a/nbconvert_html5/pytest_axe.py +++ b/nbconvert_a11y/pytest_axe.py @@ -12,7 +12,7 @@ from attr import dataclass from pytest import fixture, mark, param -NBCONVERT_HTML5_DYNAMIC_TEST = "NBCONVERT_HTML5_DYNAMIC_TEST" +nbconvert_a11y_DYNAMIC_TEST = "nbconvert_a11y_DYNAMIC_TEST" axe_config_aa = { "runOnly": ["act", "best-practice", "experimental", "wcag21a", "wcag21aa", "wcag22aa"], diff --git a/nbconvert_html5/templates/a11y/activity-log.html.j2 b/nbconvert_a11y/templates/a11y/activity-log.html.j2 similarity index 100% rename from nbconvert_html5/templates/a11y/activity-log.html.j2 rename to nbconvert_a11y/templates/a11y/activity-log.html.j2 diff --git a/nbconvert_html5/templates/a11y/audit.j2.html b/nbconvert_a11y/templates/a11y/audit.j2.html similarity index 100% rename from nbconvert_html5/templates/a11y/audit.j2.html rename to nbconvert_a11y/templates/a11y/audit.j2.html diff --git a/nbconvert_html5/templates/a11y/expanded.html.j2 b/nbconvert_a11y/templates/a11y/expanded.html.j2 similarity index 100% rename from nbconvert_html5/templates/a11y/expanded.html.j2 rename to nbconvert_a11y/templates/a11y/expanded.html.j2 diff --git a/nbconvert_html5/templates/a11y/help.html.j2 b/nbconvert_a11y/templates/a11y/help.html.j2 similarity index 100% rename from nbconvert_html5/templates/a11y/help.html.j2 rename to nbconvert_a11y/templates/a11y/help.html.j2 diff --git a/nbconvert_html5/templates/a11y/settings.html.j2 b/nbconvert_a11y/templates/a11y/settings.html.j2 similarity index 100% rename from nbconvert_html5/templates/a11y/settings.html.j2 rename to nbconvert_a11y/templates/a11y/settings.html.j2 diff --git a/nbconvert_html5/templates/a11y/settings.js b/nbconvert_a11y/templates/a11y/settings.js similarity index 100% rename from nbconvert_html5/templates/a11y/settings.js rename to nbconvert_a11y/templates/a11y/settings.js diff --git a/nbconvert_html5/templates/a11y/style.css b/nbconvert_a11y/templates/a11y/style.css similarity index 100% rename from nbconvert_html5/templates/a11y/style.css rename to nbconvert_a11y/templates/a11y/style.css diff --git a/nbconvert_html5/templates/a11y/table.html.j2 b/nbconvert_a11y/templates/a11y/table.html.j2 similarity index 100% rename from nbconvert_html5/templates/a11y/table.html.j2 rename to nbconvert_a11y/templates/a11y/table.html.j2 diff --git a/nbconvert_html5/templates/a11y/visibility.html.j2 b/nbconvert_a11y/templates/a11y/visibility.html.j2 similarity index 100% rename from nbconvert_html5/templates/a11y/visibility.html.j2 rename to nbconvert_a11y/templates/a11y/visibility.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/README.md b/nbconvert_a11y/templates/semantic-forms/README.md similarity index 100% rename from nbconvert_html5/templates/semantic-forms/README.md rename to nbconvert_a11y/templates/semantic-forms/README.md diff --git a/nbconvert_html5/templates/semantic-forms/aside-dl.html.j2 b/nbconvert_a11y/templates/semantic-forms/aside-dl.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/aside-dl.html.j2 rename to nbconvert_a11y/templates/semantic-forms/aside-dl.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/base.html.j2 b/nbconvert_a11y/templates/semantic-forms/base.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/base.html.j2 rename to nbconvert_a11y/templates/semantic-forms/base.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/cell.html.j2 b/nbconvert_a11y/templates/semantic-forms/cell.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/cell.html.j2 rename to nbconvert_a11y/templates/semantic-forms/cell.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/conf.json b/nbconvert_a11y/templates/semantic-forms/conf.json similarity index 100% rename from nbconvert_html5/templates/semantic-forms/conf.json rename to nbconvert_a11y/templates/semantic-forms/conf.json diff --git a/nbconvert_html5/templates/semantic-forms/displays.j2.html b/nbconvert_a11y/templates/semantic-forms/displays.j2.html similarity index 100% rename from nbconvert_html5/templates/semantic-forms/displays.j2.html rename to nbconvert_a11y/templates/semantic-forms/displays.j2.html diff --git a/nbconvert_html5/templates/semantic-forms/feed.html.j2 b/nbconvert_a11y/templates/semantic-forms/feed.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/feed.html.j2 rename to nbconvert_a11y/templates/semantic-forms/feed.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/forms.html.j2 b/nbconvert_a11y/templates/semantic-forms/forms.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/forms.html.j2 rename to nbconvert_a11y/templates/semantic-forms/forms.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/index.html.j2 b/nbconvert_a11y/templates/semantic-forms/index.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/index.html.j2 rename to nbconvert_a11y/templates/semantic-forms/index.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/main.html.j2 b/nbconvert_a11y/templates/semantic-forms/main.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/main.html.j2 rename to nbconvert_a11y/templates/semantic-forms/main.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/ol.html.j2 b/nbconvert_a11y/templates/semantic-forms/ol.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/ol.html.j2 rename to nbconvert_a11y/templates/semantic-forms/ol.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/schema-dl.html.j2 b/nbconvert_a11y/templates/semantic-forms/schema-dl.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/schema-dl.html.j2 rename to nbconvert_a11y/templates/semantic-forms/schema-dl.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/sections.html.j2 b/nbconvert_a11y/templates/semantic-forms/sections.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/sections.html.j2 rename to nbconvert_a11y/templates/semantic-forms/sections.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/smol.html.j2 b/nbconvert_a11y/templates/semantic-forms/smol.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/smol.html.j2 rename to nbconvert_a11y/templates/semantic-forms/smol.html.j2 diff --git a/nbconvert_html5/templates/semantic-forms/static/script.js b/nbconvert_a11y/templates/semantic-forms/static/script.js similarity index 100% rename from nbconvert_html5/templates/semantic-forms/static/script.js rename to nbconvert_a11y/templates/semantic-forms/static/script.js diff --git a/nbconvert_html5/templates/semantic-forms/static/style.css b/nbconvert_a11y/templates/semantic-forms/static/style.css similarity index 100% rename from nbconvert_html5/templates/semantic-forms/static/style.css rename to nbconvert_a11y/templates/semantic-forms/static/style.css diff --git a/nbconvert_html5/templates/semantic-forms/style.css b/nbconvert_a11y/templates/semantic-forms/style.css similarity index 100% rename from nbconvert_html5/templates/semantic-forms/style.css rename to nbconvert_a11y/templates/semantic-forms/style.css diff --git a/nbconvert_html5/templates/semantic-forms/ul.html.j2 b/nbconvert_a11y/templates/semantic-forms/ul.html.j2 similarity index 100% rename from nbconvert_html5/templates/semantic-forms/ul.html.j2 rename to nbconvert_a11y/templates/semantic-forms/ul.html.j2 diff --git a/tests/configurations/default.py b/tests/configurations/default.py index d0fdcdef..5236e6b3 100644 --- a/tests/configurations/default.py +++ b/tests/configurations/default.py @@ -1,4 +1,4 @@ -"""the default settings we recommend with the `nbconvert_html5` project.""" +"""the default settings we recommend with the `nbconvert_a11y` project.""" c.NbConvertApp.export_format = "html5_test" c.CSSHTMLHeaderPreprocessor.style = "default" diff --git a/tests/nbconvert_html5.md b/tests/nbconvert_html5.md index 30a344ac..55de53d6 100644 --- a/tests/nbconvert_html5.md +++ b/tests/nbconvert_html5.md @@ -1 +1 @@ ---8<-- "nbconvert_html5/templates/semantic-forms/README.md" \ No newline at end of file +--8<-- "nbconvert_a11y/templates/semantic-forms/README.md" \ No newline at end of file diff --git a/tests/templates/experiments.md.j2 b/tests/templates/experiments.md.j2 index 03c10bd3..07fd8055 100644 --- a/tests/templates/experiments.md.j2 +++ b/tests/templates/experiments.md.j2 @@ -1,18 +1,18 @@ # experiment contents in these experiments, our inputs are are pairs of configuration files and reference notebooks. -our inputs are passed to `nbconvert` to export an html version of the pair. `nbconvert` consumes the configuration files and passes the values to our `nbconvert_html5` project that applies mediations. +our inputs are passed to `nbconvert` to export an html version of the pair. `nbconvert` consumes the configuration files and passes the values to our `nbconvert_a11y` project that applies mediations. ```mermaid flowchart LR py[.py]--configuration-->nbconvert nb[.ipynb notebook]--content-->nbconvert - nbconvert--nbconvert_html5-->html + nbconvert--nbconvert_a11y-->html html-->manual[manual\ntest] - manual--->nbconvert_html5 - html--axe-->auto[automated\ntesting]--->nbconvert_html5 - nbconvert_html5--->nbconvert + manual--->nbconvert_a11y + html--axe-->auto[automated\ntesting]--->nbconvert_a11y + nbconvert_a11y--->nbconvert ``` configuration files diff --git a/tests/test_a11y.py b/tests/test_a11y.py index 8d18e2fc..0650471e 100644 --- a/tests/test_a11y.py +++ b/tests/test_a11y.py @@ -3,7 +3,7 @@ from pytest import fixture, mark, param -from nbconvert_html5.pytest_axe import inject_axe, run_axe_test +from nbconvert_a11y.pytest_axe import inject_axe, run_axe_test from tests.test_smoke import CONFIGURATIONS, NOTEBOOKS, get_target_html NEEDS_WORK = "state needs work" diff --git a/tests/test_nbconvert_html5.py b/tests/test_nbconvert_html5.py index a7d650c5..ec929a9e 100644 --- a/tests/test_nbconvert_html5.py +++ b/tests/test_nbconvert_html5.py @@ -7,7 +7,7 @@ from nbconvert import get_export_names, get_exporter from pytest import fixture, mark -from nbconvert_html5.form_exporter import get_soup +from nbconvert_a11y.form_exporter import get_soup EXPORTER = "a11y" HERE = Path(__file__).parent diff --git a/tests/test_smoke.py b/tests/test_smoke.py index 246576cd..64ea01ba 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -15,9 +15,9 @@ import nbconvert.nbconvertapp from pytest import mark, param -import nbconvert_html5 +import nbconvert_a11y -TEMPLATES = Path(nbconvert_html5.__file__).parent / "templates/a11y" +TEMPLATES = Path(nbconvert_a11y.__file__).parent / "templates/a11y" SKIP_BASELINE = "baseline tests skipped locally" LOGGER = getLogger(__name__) HERE = Path(__file__).parent From 07cefa8df8ac350344379cd3f019fb6b9d1f8aca Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 11:52:35 -0800 Subject: [PATCH 13/33] bootstrap css --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7682a7d5..3abf0188 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,9 +57,10 @@ jobs: - name: init plawright run: | playwright install --with-deps chromium - - name: init node + - name: init node & files run: | npm install vnu-jar axe-core + doit copy - name: init dev module run: | pip install -e. From 7456e2eae74e0c7a112ef14f355efc8d38768199 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 11:54:47 -0800 Subject: [PATCH 14/33] reuse correct artifact --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3abf0188..d09afdf7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,7 +97,7 @@ jobs: - uses: actions/download-artifact@v3 with: name: site - path: dist + path: site - name: Deploy main 🚀 uses: JamesIves/github-pages-deploy-action@v4 if: ${{ github.ref_name == 'main' }} From 1486368c08cb2242608f45b2e04595026b3f8dfe Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 12:01:20 -0800 Subject: [PATCH 15/33] add checkout to pages --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d09afdf7..dcf5774f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,6 +94,7 @@ jobs: needs: [test] runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 with: name: site From 3a7a1f44869d0cfcdbce235e1c52a53756364aac Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 12:02:21 -0800 Subject: [PATCH 16/33] update checkout --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dcf5774f..1c398eb2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,7 +94,8 @@ jobs: needs: [test] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: checkout repo + uses: actions/checkout@v3 - uses: actions/download-artifact@v3 with: name: site @@ -119,7 +120,7 @@ jobs: runs-on: ubuntu-latest steps: - name: fetch contents - uses: actions/checkout@v2 + uses: actions/checkout@v3 - uses: actions/download-artifact@v3 with: name: dist From ef868f5a16e21c163e296bd6c2d5450596a4f104 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 12:02:49 -0800 Subject: [PATCH 17/33] add permissions to python release --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c398eb2..972c38bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -118,6 +118,8 @@ jobs: if: startsWith(github.ref, 'refs/tags/') needs: [test] runs-on: ubuntu-latest + permissions: + id-token: write steps: - name: fetch contents uses: actions/checkout@v3 From 1fb888405cf0ca0ffa9e9e7d4b29c1b021ec97d5 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 12:28:36 -0800 Subject: [PATCH 18/33] use hatch for publishing --- .github/workflows/test.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 972c38bd..82db798b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -127,16 +127,18 @@ jobs: with: name: dist path: dist - - name: Publish package distributions to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - uses: actions/setup-python@v4 with: python-version: "3.11" cache: pip cache-dependency-path: pyproject.toml - - name: install nbconvert-a11y dependencies from pip + - name: install hatch + run: | + pip install hatch pytest accessible-pygments html5lib markdown-it-py[linkify,plugins] nbconvert python-slugify + - name: Publish package distributions to TestPyPI + run: | + hatch publish -r test --user __token__ --auth ${{secrets.HATCH_TEST_INDEX_AUTH}} + - name: install test release deps run: | pip install pytest accessible-pygments html5lib markdown-it-py[linkify,plugins] nbconvert python-slugify - name: install nbconvert-a11y dependencies from test pip From 5360832cd6a584e34233142e99fef1a74d6feded Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 12:37:54 -0800 Subject: [PATCH 19/33] dial in test release --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 82db798b..45c958c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -134,13 +134,10 @@ jobs: cache-dependency-path: pyproject.toml - name: install hatch run: | - pip install hatch pytest accessible-pygments html5lib markdown-it-py[linkify,plugins] nbconvert python-slugify + pip install hatch pytest - name: Publish package distributions to TestPyPI run: | hatch publish -r test --user __token__ --auth ${{secrets.HATCH_TEST_INDEX_AUTH}} - - name: install test release deps - run: | - pip install pytest accessible-pygments html5lib markdown-it-py[linkify,plugins] nbconvert python-slugify - name: install nbconvert-a11y dependencies from test pip env: PIP_INDEX_URL: https://test.pypi.org/simple/ From 162499fea83ec0e694a04f6ec9f28440beaa5537 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 12:39:12 -0800 Subject: [PATCH 20/33] rm ipython dep --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0efae27b..6a83e3a8 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,6 @@ classifiers = [ dependencies = [ "accessible-pygments", "html5lib", - "IPython", "markdown-it-py[linkify,plugins]", "nbconvert", "python-slugify", From b22768b082d148dfe3399689bf9f2a6778a9129b Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 12:39:58 -0800 Subject: [PATCH 21/33] drop 3.7 --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6a83e3a8..fdb55884 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ name = "nbconvert-a11y" description = "nbconvert templates using modern standards" readme = "README.md" url = "https://github.com/Iota-School/notebooks-for-all" -requires-python = ">=3.7" +requires-python = ">=3.8" license = "BSD-3-Clause" keywords = [ ] @@ -26,7 +26,6 @@ classifiers = [ "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", From 7640c6d190cf90e32a5f7a2bb452dfd5d01a08f3 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 12:41:26 -0800 Subject: [PATCH 22/33] add exception dependency --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index fdb55884..a99170a7 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ dependencies = [ "markdown-it-py[linkify,plugins]", "nbconvert", "python-slugify", + "exceptiongroup; python_version < '3.12'" ] dynamic = [ "version", From 90907904b099755263a00a2f024a18ea54f92062 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 12:42:06 -0800 Subject: [PATCH 23/33] change project url in config --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a99170a7..08565f24 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ requires = [ name = "nbconvert-a11y" description = "nbconvert templates using modern standards" readme = "README.md" -url = "https://github.com/Iota-School/notebooks-for-all" +url = "https://github.com/deathbeds/nbconvert-a11y" requires-python = ">=3.8" license = "BSD-3-Clause" keywords = [ From 4e7068c097131cc7b9185af54a24b01dff14ee02 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 13:42:54 -0800 Subject: [PATCH 24/33] move xdist and report params to ci --- .github/workflows/test.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 45c958c6..c5cbf142 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,7 +74,7 @@ jobs: # always build the docs to see what the new versions look like. continue-on-error: true run: | - pytest --deselect tests/test_smoke.py + 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 diff --git a/pyproject.toml b/pyproject.toml index 08565f24..37bd1bc3 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,7 +110,7 @@ run = "pytest" [tool.pytest.ini_options] minversion = "6.0" -addopts = "-vvv -pno:importnb -n auto --self-contained-html --html=tests/exports/pytest/report.html" +addopts = "-vvv -pno:importnb" testpaths = ["tests", "test_playwright.py"] norecursedirs = ["tests/exports", "tests/notebooks", "*checkpoints"] From 2b6bf8ca526b7aa77c9ef3f47dc7370741687f26 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 13:55:51 -0800 Subject: [PATCH 25/33] use twine for release --- .github/workflows/test.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c5cbf142..7190e5e2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,7 +74,8 @@ jobs: # 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 + 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 @@ -132,18 +133,19 @@ jobs: python-version: "3.11" cache: pip cache-dependency-path: pyproject.toml - - name: install hatch + - name: install twine and pytest run: | - pip install hatch pytest + pip install twine pytest - name: Publish package distributions to TestPyPI run: | - hatch publish -r test --user __token__ --auth ${{secrets.HATCH_TEST_INDEX_AUTH}} + twine upload --repository testpypi \ + --user __token__ --password ${{secrets.HATCH_TEST_INDEX_AUTH}} - name: install nbconvert-a11y dependencies from test pip - env: - PIP_INDEX_URL: https://test.pypi.org/simple/ - PIP_EXTRA_INDEX_URL: https://pypi.org/simple/ run: | - pip install nbconvert-a11y + 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 From 839902baca6fc1dc01df52189882e5845be12e35 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 13:59:11 -0800 Subject: [PATCH 26/33] draft a github release on sucess --- .github/workflows/test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7190e5e2..cf1a6c17 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -121,6 +121,7 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write + contents: write steps: - name: fetch contents uses: actions/checkout@v3 @@ -149,3 +150,7 @@ jobs: - 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 \ No newline at end of file From 857eea9004fa0d0a369b34626fb59caa7e11c9c7 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 14:00:20 -0800 Subject: [PATCH 27/33] bad yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf1a6c17..f54ce182 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -152,5 +152,5 @@ jobs: pytest tests/test_smoke.py - uses: ncipollo/release-action@v1 with: - artifacts: "dist/.* + artifacts: "dist/.*" draft: true # does not trigger a created event \ No newline at end of file From 24abb38548bc92709cfa2e9796345f893a77fb51 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Wed, 22 Nov 2023 14:15:37 -0800 Subject: [PATCH 28/33] distribution folder for twine --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f54ce182..fbff16ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -140,7 +140,8 @@ jobs: - name: Publish package distributions to TestPyPI run: | twine upload --repository testpypi \ - --user __token__ --password ${{secrets.HATCH_TEST_INDEX_AUTH}} + --user __token__ --password ${{secrets.HATCH_TEST_INDEX_AUTH}} \ + dist/* - name: install nbconvert-a11y dependencies from test pip run: | pip install \ From 02a160515d0db46ca1f4422cc359e7b35ad60a8a Mon Sep 17 00:00:00 2001 From: tonyfast Date: Thu, 23 Nov 2023 11:28:46 -0800 Subject: [PATCH 29/33] use jupyter paths --- tests/test_smoke.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_smoke.py b/tests/test_smoke.py index 64ea01ba..fd152b5b 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -16,8 +16,9 @@ from pytest import mark, param import nbconvert_a11y +import jupyter_core.paths -TEMPLATES = Path(nbconvert_a11y.__file__).parent / "templates/a11y" +TEMPLATES = Path(jupyter_core.paths.jupyter_data_dir()) / "nbconvert/templates/a11y" SKIP_BASELINE = "baseline tests skipped locally" LOGGER = getLogger(__name__) HERE = Path(__file__).parent From c01e5ceebd1b766347e7b4153d55fedc298b83a4 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Thu, 23 Nov 2023 13:05:05 -0800 Subject: [PATCH 30/33] change how smoke creates static assets --- tests/test_smoke.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_smoke.py b/tests/test_smoke.py index fd152b5b..53e64629 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -65,7 +65,7 @@ def get_target_html(config, notebook): ) -assets = mark.parametrize("assets", [TEMPLATES / "settings.js", TEMPLATES / "style.css"]) +assets = mark.parametrize("asset", ["settings.js", "style.css"]) @configs @@ -75,14 +75,14 @@ def test_config_loading(config): @assets -def test_static_assets(assets): +def test_static_assets(asset): """This is a bad test. it won't fail, but needs to run to collect testing assets.""" - target = HTML / assets.name - try: - assert target.exists(), f"{assets.name} doesn't exist." - except AssertionError: - copyfile(assets, target) - assert target.exists(), f"{assets.name} couldn't be created" + target = HTML / asset + for path in map(Path, jupyter_core.paths.jupyter_path("nbconvert", "templates", "a11y", asset)): + if path.exists(): + copyfile(path, target) + break + assert target.exists(), f"{asset} couldn't be created" @configs From 46113f4bc9035c4e591d3c4821a95af6bd28b100 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Thu, 23 Nov 2023 13:30:29 -0800 Subject: [PATCH 31/33] create directory on smoke test --- tests/test_smoke.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_smoke.py b/tests/test_smoke.py index 53e64629..e2793d76 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -78,6 +78,7 @@ def test_config_loading(config): def test_static_assets(asset): """This is a bad test. it won't fail, but needs to run to collect testing assets.""" target = HTML / asset + target.parent.mkdir(exist_ok=True, parents=True) for path in map(Path, jupyter_core.paths.jupyter_path("nbconvert", "templates", "a11y", asset)): if path.exists(): copyfile(path, target) From f47b5301cedfdf390adf335ee287ae367c79d12c Mon Sep 17 00:00:00 2001 From: tonyfast Date: Thu, 23 Nov 2023 14:08:28 -0800 Subject: [PATCH 32/33] add release to pypi workflow --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..178db632 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: release the package to pypi +on: + release: + types: + - created +jobs: + release: + name: draft release when tagged + 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" + - name: install twine and pytest + run: | + pip install twine pytest + - name: Publish package distributions to TestPyPI + run: | + twine upload --user __token__ --password ${{secrets.HATCH_PYPI_AUTH}} dist/* + - name: install nbconvert-a11y dependencies from test pip + run: | + pip install nbconvert-a11y + - name: test test release + run: | + pytest tests/test_smoke.py \ No newline at end of file From eb02417a6378d7514fc3d419bc1417b43184b1a5 Mon Sep 17 00:00:00 2001 From: tonyfast Date: Thu, 23 Nov 2023 14:23:07 -0800 Subject: [PATCH 33/33] remove old variable --- tests/test_smoke.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_smoke.py b/tests/test_smoke.py index e2793d76..6fa54213 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -18,7 +18,6 @@ import nbconvert_a11y import jupyter_core.paths -TEMPLATES = Path(jupyter_core.paths.jupyter_data_dir()) / "nbconvert/templates/a11y" SKIP_BASELINE = "baseline tests skipped locally" LOGGER = getLogger(__name__) HERE = Path(__file__).parent