Fix docs pipeline, make docs tests easier to run locally and on different OSes (#1554)

* update docs pipeline to use poe task runner

* move npm dependency into package.json file instead of hardcoding into pipeline

* replace nix-specific call with python version (for windows compat)

* update commands to use python for win compat

* update lock file

* change deps to take out xq and use xmltodict instead

* move script tasks from pyproject into new tasks.py

* run linting on new tasks.py file

* fix typo

* clean up pyproject to make valid toml

* update docs with correct task runner command

* use npx in case node_modules/.bin isn't in the path

* Run pa11y-ci in cross-platform manner (works on Windows)

* Add node_modules to .gitignore

* clean up poe alias

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
Jonathan Wren 2022-08-21 13:47:25 -07:00 committed by GitHub
parent 33607acbb6
commit 671f403602
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 2397 additions and 300 deletions

View file

@ -53,9 +53,10 @@ pytest = ">=6.2"
pytest-bdd = ">=4.0.1,<6.0"
pytest-clarity = "*"
pytest-xdist = ">=2.5.0"
requests = "*"
toml = ">=0.10"
tox = "*"
yq = "*"
xmltodict = "*"
[tool.poetry.scripts]
jrnl = 'jrnl.cli:cli'
@ -70,7 +71,7 @@ format-check = [
]
style-check = [
{cmd = "pflake8 --version"},
{cmd = "pflake8 jrnl tests"},
{cmd = "pflake8 jrnl tests tasks.py"},
]
sort-run = [
{cmd = "isort ."},
@ -79,11 +80,22 @@ sort-check = [
{cmd = "isort --version"},
{cmd = "isort --check ."},
]
# docs-check = ?
docs-check.default_item_type = "script"
docs-check.sequence = [
"tasks:delete_files(['sitemap.xml', 'config.json'])",
"tasks:generate_sitemap",
"tasks:output_file('sitemap.xml')",
"tasks:generate_pa11y_config_from_sitemap",
"tasks:output_file('config.json')",
"tasks:run_shell('npx pa11y-ci -c config.json')",
"tasks:delete_files(['sitemap.xml', 'config.json'])",
]
docs-run = [
{cmd = "mkdocs serve"},
]
test-run =[
test-run = [
{cmd = "tox -q -e py --"},
]