Skip to content

Commit

Permalink
improve callgraph
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Jul 13, 2024
1 parent 4b2a54a commit 44702b7
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 346 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ jobs:
with:
pixi-version: v0.25.0
cache: true
environments: build docs
environments: build docs test test-oldest
- run: pixi run dist
- run: pixi run test
- run: pixi run docs-lite
- run: pixi run docs
- uses: actions/upload-pages-artifact@v3
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
ROOT = HERE.parent
PYPROJ = ROOT / "pyproject.toml"
PIXI = ROOT / "pixi.toml"
REPORTS = ROOT / "build/reports"

if os.getenv(RTD) == "True":
# provide a fake root doc
Expand Down Expand Up @@ -51,6 +52,7 @@ def _run_pixi(*_args: Any) -> None:
)

intersphinx_mapping = {k: (v, None) for k, v in _intersphinx_mapping.items()}
REPORTS.mkdir(parents=True, exist_ok=True)


# RTD will inject more config below here
530 changes: 192 additions & 338 deletions pixi.lock

Large diffs are not rendered by default.

28 changes: 24 additions & 4 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,14 @@ pytest
--no-cov-on-fail
--cov-fail-under=100
"""
inputs = ["pyproject.toml", "tests/**/*.py", "dist/*.whl"]
inputs = [
"build/pip-freeze-whl/test.txt",
"pyproject.toml",
"tests/**/*.py",
"dist/*.whl",
"examples/files",
"!**/.ipynb_checkpoints",
]
outputs = ["build/reports/test/{pytest.html,htmlcov/status.json}"]
depends-on = ["pip-test"]

Expand All @@ -235,7 +242,14 @@ JUPYTER_PLATFORM_DIRS=1 pytest
--html=build/reports/test-oldest/pytest.html
--self-contained-html
"""
inputs = ["tests/**/*.py", "dist/*.whl", "pyproject.toml"]
inputs = [
"tests/**/*.py",
"dist/*.whl",
"pyproject.toml",
"examples/files",
"!**/.ipynb_checkpoints",
"build/pip-freeze-whl/test-oldest.txt",
]
outputs = ["build/reports/test-oldest/pytest.html"]
depends-on = ["pip-test-oldest", "dist-py"]

Expand Down Expand Up @@ -346,7 +360,11 @@ autosectionlabel_prefix_document = true
myst_heading_anchors = 3
suppress_warnings = ["autosectionlabel.*"]
templates_path = ["_templates"]
html_static_path = ["../build/docs-app", "_static"]
html_static_path = [
"../build/docs-app",
"../build/reports",
"_static",
]
html_theme = "pydata_sphinx_theme"
html_css_files = ["theme.css"]
release = "{{ ppt.project.version }}"
Expand Down Expand Up @@ -384,9 +402,11 @@ pyinstrument = ">=4.4.0"
[feature.deps-run-oldest.dependencies]
ipywidgets = "7.*"
jupyterlab = "3.5.*"
jupyter_server = "1.*"
pip = "*"
pyinstrument = "4.4.0"
python = "3.8.*"
nbconvert = "6.4.*"

[feature.deps-lab.dependencies]
jupyterlab = ">=4.0.0,<4.3"
Expand Down Expand Up @@ -416,7 +436,7 @@ actionlint-with-all = "*"
pytest = ">=8,<9"
pytest-cov = "*"
pytest-html = "*"
nbconvert = "*"
nbconvert-core = "*"

[feature.deps-docs.dependencies]
ipywidgets = "*"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ignore = [

[tool.ruff.lint.per-file-ignores]
"*.ipynb" = ["T201", "ANN201", "D103", "ANN001", "PLR2004", "ERA001", "PLE1142", "F811"]
"tests/**/*.py" = ["S101", "SLF001", "PLR2004", "T201"]
"tests/**/*.py" = ["S101", "SLF001", "PLR2004", "T201", "T203"]

[tool.ruff.lint.isort]
known-first-party = ["ipyprofiler"]
Expand Down
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import os
import pprint
from pathlib import Path
from typing import TYPE_CHECKING

Expand Down Expand Up @@ -37,7 +38,13 @@ def a_notebook_exporter() -> Generator[nbconvert.NotebookExporter, None, None]:
}
old_values = {os.environ[k]: v for k, v in env_patch.items() if k in os.environ}
os.environ.update(env_patch)

from ipywidgets import __version__ as v_widgets
from nbconvert import NotebookExporter
from nbconvert import __version__ as v_nbconvert

versions = {"nbconvert": v_nbconvert, "ipywidgets": v_widgets}
pprint.pprint({"versions": versions})
from nbconvert.preprocessors import ExecutePreprocessor

nbe = NotebookExporter()
Expand Down
8 changes: 6 additions & 2 deletions tests/test_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
def test_a_notebook(
a_notebook: nbformat.NotebookNode, a_notebook_exporter: nbconvert.NotebookExporter
) -> NoReturn:
"""Verify notebooks run without error."""
(body, resources) = a_notebook_exporter.from_filename(str(a_notebook))
"""Verify notebooks run without error.
These are run in a default, un-instrumented kernel, so are _not_ included in
coverage results.
"""
body = a_notebook_exporter.from_filename(str(a_notebook))[0]

assert '"output_type": "error"' not in body

0 comments on commit 44702b7

Please sign in to comment.