-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
76 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: codspeed-benchmarks | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
# Run on pull requests | ||
pull_request: | ||
# `workflow_dispatch` allows CodSpeed to trigger backtest | ||
# performance analysis in order to generate initial data. | ||
workflow_dispatch: | ||
|
||
jobs: | ||
benchmarks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Setup Graphviz | ||
uses: ts-graphviz/setup-graphviz@v1 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install hatch | ||
hatch env create | ||
- name: Run benchmarks | ||
uses: CodSpeedHQ/action@v1 | ||
with: | ||
token: ${{ secrets.CODSPEED_TOKEN }} | ||
run: "pytest benchmarks/ --codspeed" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
|
||
import mknodes as mk | ||
|
||
|
||
@pytest.mark.benchmark() | ||
def test_build_duration(benchmark): | ||
theme = mk.MaterialTheme() | ||
from mknodes.manual import root | ||
|
||
proj = mk.Project(theme=theme) | ||
root.build(proj) | ||
for node in proj.root.descendants: | ||
if not isinstance(node, mk.MkPage): | ||
continue | ||
node.to_markdown() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
from __future__ import annotations | ||
|
||
import mknodes as mk | ||
|
||
from mknodes.treelib import noderesolver | ||
|
||
|
||
def test_resolver(mknodes_project): | ||
def test_resolver(): | ||
resolver = noderesolver.MkNodeResolver() | ||
result = resolver.glob("*/*/MkAdm*", mknodes_project._root) | ||
root = mk.MkNav() | ||
sub = root.add_nav("SubNav") | ||
page = sub.add_page("Test") | ||
page += mk.MkAdmonition("Test") | ||
result = resolver.glob("*/*/MkAdm*", root) | ||
assert result | ||
|
||
|
||
def resolving_files(mknodes_project): | ||
mknodes_project.all_files() |