Skip to content

Commit

Permalink
clean up workflows
Browse files Browse the repository at this point in the history
update deps

update deps

update deps

fix docs build

fix docs build

remove pytest pin

update manifest

clean up docs
  • Loading branch information
blink1073 committed Apr 9, 2022
1 parent 36a11ee commit 80c35de
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 34 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/docs.yml
Expand Up @@ -26,40 +26,24 @@ jobs:
# pandoc is not up to date in the ubuntu repos, so we install directly
wget https://github.com/jgm/pandoc/releases/download/2.14.2/pandoc-2.14.2-1-amd64.deb && sudo dpkg -i pandoc-2.14.2-1-amd64.deb
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: Cache pip on Linux
uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install
run: pip install -v ".[all]"
- name: List installed packages
run: |
pip freeze
pip check
- name: Build HTML docs
env:
PYTHONWARNINGS: default
run: |
python setup.py build_sphinx -b html
cd docs
make html SPHINXOPTS="-W"
- name: Upload HTML
uses: actions/upload-artifact@v2
with:
name: html
path: build/sphinx/html
- name: Build PDF docs
env:
PYTHONWARNINGS: default
run: |
python -Wd setup.py build_sphinx -b latex
cd docs
make latexpdf
- name: Upload PDF
Expand All @@ -68,4 +52,6 @@ jobs:
name: pdf
path: docs/build/latex/nbconvert.pdf
- name: Check links
run: python setup.py build_sphinx -b linkcheck
run: |
cd docs
make linkcheck
69 changes: 65 additions & 4 deletions .github/workflows/tests.yml
Expand Up @@ -44,7 +44,6 @@ jobs:
run: |
pip install codecov --user
pip install -e ".[execute,serve,test]" --user
pip install check-manifest
python -m ipykernel.kernelspec --user
# many things installed in --users need this to be in $PATH
echo "/Users/runner/.local/bin" >> $GITHUB_PATH
Expand All @@ -54,9 +53,6 @@ jobs:
pip freeze
pip check
- name: Check Manifest
run: check-manifest --ignore "share/**"

- name: Run tests with coverage
if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(runner.os, 'Windows') }}
shell: bash
Expand All @@ -75,3 +71,68 @@ jobs:
- name: Code coverage
run: codecov

check_manifest:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Check Manifest
run: |
pip install check-manifest
check-manifest --ignore "share/**"
test_minimum_versions:
name: Test Minimum Versions
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
python_version: "3.7"
- name: Install miniumum versions
uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
- name: Run the unit tests
run: |
pytest -vv -W default || pytest -vv -W default --lf
test_prereleases:
name: Test Prereleases
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install the Python dependencies
run: |
pip install --pre -e ".[test]"
- name: List installed packages
run: |
pip freeze
pip check
- name: Run the tests
run: |
pytest -vv || pytest -vv --lf
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/make-sdist@v1

test_sdist:
runs-on: ubuntu-latest
needs: [make_sdist]
name: Install from SDist and Test
timeout-minutes: 20
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1
2 changes: 1 addition & 1 deletion MANIFEST.in
Expand Up @@ -21,7 +21,7 @@ exclude .prettierignore
graft examples

# docs subdirs we want to skip
prune docs/build
prune docs/_build
prune docs/gh-pages
prune docs/dist

Expand Down
14 changes: 14 additions & 0 deletions docs/autogen_config.py
Expand Up @@ -57,3 +57,17 @@
f.write(app.document_flag_help())
f.write(app.document_alias_help())
f.write(app.document_config_options())


# Workaround until https://github.com/jupyter/nbclient/pull/216 is released
with open(destination) as f:
data = f.read()

data = data.replace("`CellExecutionError`", "``CellExecutionError``")
data = data.replace("`cell`", "``cell``")
data = data.replace("`cell_index`", "``cell_index``")
data = data.replace("`cell_allows_errors`", "``cell_allows_errors``")
data = data.replace("`notebook`", "``notebook``")

with open(destination, "w") as f:
f.write(data)
2 changes: 1 addition & 1 deletion docs/environment.yml
Expand Up @@ -2,7 +2,7 @@ name: nbconvert_docs
channels:
- conda-forge
dependencies:
- python==3.7
- python==3.9
- pandoc
- nbformat
- jupyter_client
Expand Down
2 changes: 1 addition & 1 deletion docs/source/customizing.rst
Expand Up @@ -4,7 +4,7 @@ Creating Custom Templates for nbconvert
Selecting a template
--------------------

Most exporters in nbconvert are subclasses of `TemplateExporter`, and make use of
Most exporters in nbconvert are subclasses of ``TemplateExporter``, and make use of
jinja to render notebooks into the destination format.

Alternative nbconvert templates can be selected by name from the command line with the
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/exporters/base.py
Expand Up @@ -45,7 +45,7 @@ def export(exporter, nb, **kw):
method initializes its own instance of the class, it is ASSUMED that
the class type provided exposes a constructor (``__init__``) with the same
signature as the base Exporter class.
nb : `nbformat.NotebookNode`
nb : :class:`~nbformat.NotebookNode`
The notebook to export.
config : config (optional, keyword arg)
User configuration instance.
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/exporters/exporter.py
Expand Up @@ -127,7 +127,7 @@ def from_notebook_node(self, nb, resources=None, **kw):
Parameters
----------
nb : `nbformat.NotebookNode`
nb : :class:`~nbformat.NotebookNode`
Notebook node (dict-like with attr-access)
resources : dict
Additional resources that can be accessed read/write by
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/exporters/templateexporter.py
Expand Up @@ -375,7 +375,7 @@ def from_notebook_node(self, nb, resources=None, **kw):
Parameters
----------
nb : `nbformat.NotebookNode`
nb : :class:`~nbformat.NotebookNode`
Notebook node
resources : dict
Additional resources that can be accessed read/write by
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Expand Up @@ -241,12 +241,12 @@ def get_data_files():
"bleach",
"defusedxml",
"entrypoints>=0.2.2",
"jinja2>=2.4",
"jupyter_core",
"jinja2>=3.0",
"jupyter_core>=4.7",
"jupyterlab_pygments",
"MarkupSafe>=2.0",
"mistune>=0.8.1,<2",
"nbclient>=0.5.0,<0.6.0",
"nbclient>=0.5.0",
"nbformat>=4.4",
"packaging",
"pandocfilters>=1.4.1",
Expand All @@ -267,7 +267,7 @@ def get_data_files():
"pre-commit",
pyppeteer_req,
],
"serve": ["tornado>=4.0"],
"serve": ["tornado>=6.1"],
"webpdf": [pyppeteer_req],
"docs": [
"sphinx>=1.5.1",
Expand Down

0 comments on commit 80c35de

Please sign in to comment.