Skip to content

Commit b47779f

Browse files
feat(docs): added fast build mechanic with usage examples (#1202)
Co-authored-by: danceratopz <[email protected]>
1 parent 8397062 commit b47779f

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

docs/gen_test_case_reference.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import importlib
1010
import logging
1111
import sys
12+
from os import getenv
1213

1314
import pytest
1415
from click.testing import CliRunner
@@ -24,6 +25,19 @@
2425

2526
logger = logging.getLogger("mkdocs")
2627

28+
29+
# if docs are generated while FAST_DOCS is true, then use "tests/frontier" otherwise use "tests"
30+
# USAGE 1 (use fast mode):
31+
# export FAST_DOCS=true && uv run mkdocs serve
32+
# USAGE 2 (use fast mode + hide side-effect warnings):
33+
# export FAST_DOCS=true && uv run mkdocs serve 2>&1 | sed '/is not found among documentation files/d' # noqa: E501
34+
test_arg = "tests"
35+
fast_mode = getenv("FAST_DOCS")
36+
if fast_mode is not None:
37+
if fast_mode.lower() == "true":
38+
print("-" * 40, "\nWill generate docs using FAST_DOCS mode.\n" + "-" * 40)
39+
test_arg = "tests/frontier"
40+
2741
args = [
2842
"--override-ini",
2943
"filterwarnings=ignore::pytest.PytestAssertRewriteWarning", # suppress warnings due to reload
@@ -36,10 +50,7 @@
3650
"-m",
3751
"(not blockchain_test_engine) and (not eip_version_check)",
3852
"-s",
39-
"tests",
40-
# "tests/shanghai",
41-
# "tests/osaka/eip7692_eof_v1", # noqa: SC100
42-
# "tests/prague/eip2537_bls_12_381_precompiles", # noqa: SC100
53+
test_arg,
4354
]
4455

4556
runner = CliRunner()

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ commands = python -c "import src.cli.tox_helpers; src.cli.tox_helpers.markdownli
4242
description = Build documentation in strict mode (mkdocs)
4343
extras = docs
4444
setenv =
45-
SPEC_TESTS_AUTO_GENERATE_FILES = true
4645
GEN_TEST_DOC_VERSION = "tox"
4746
# Required for `cairosvg` so tox can find `libcairo-2`.
4847
# https://squidfunk.github.io/mkdocs-material/plugins/requirements/image-processing/?h=cairo#cairo-library-was-not-found

0 commit comments

Comments
 (0)