Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
tests/data/jffs2.bin.gz filter=lfs diff=lfs merge=lfs -text
tests/data/jffs2.zlib.bin.gz filter=lfs diff=lfs merge=lfs -text
tests/data/router.bin.gz filter=lfs diff=lfs merge=lfs -text
tests/_data/* filter=lfs diff=lfs merge=lfs -text
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ select = [
ignore = ["E203", "B904", "UP024", "ANN002", "ANN003", "ANN204", "ANN401", "SIM105", "TRY003"]

[tool.ruff.lint.per-file-ignores]
"tests/docs/**" = ["INP001"]
"tests/_docs/**" = ["INP001"]

[tool.ruff.lint.isort]
known-first-party = ["dissect.jffs"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions tests/_docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -jauto -w $(BUILDDIR)/warnings.log --fail-on-warning
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: clean help Makefile

clean: Makefile
rm -rf api
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
42 changes: 42 additions & 0 deletions tests/_docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
project = "dissect.jffs"

extensions = [
"autoapi.extension",
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.doctest",
"sphinx.ext.napoleon",
"sphinx_argparse_cli",
]

exclude_patterns = []

html_theme = "furo"

autoapi_type = "python"
autoapi_dirs = ["../../dissect/"]
autoapi_ignore = ["*tests*", "*.tox*", "*venv*", "*examples*"]
autoapi_python_use_implicit_namespaces = True
autoapi_add_toctree_entry = False
autoapi_root = "api"
autoapi_options = [
"members",
"undoc-members",
"show-inheritance",
"show-module-summary",
"special-members",
"imported-members",
]
autoapi_keep_files = True
autoapi_template_dir = "_templates/autoapi"

autodoc_typehints = "signature"
autodoc_member_order = "groupwise"

autosectionlabel_prefix_document = True

suppress_warnings = [
# https://github.com/readthedocs/sphinx-autoapi/issues/285
"autoapi.python_import_resolution",
"ref.python",
]
8 changes: 8 additions & 0 deletions tests/_docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
API Reference
=============

.. toctree::
:maxdepth: 1
:glob:

/api/*/*/index
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ def gzip_file(filename: str) -> Iterator[BinaryIO]:

@pytest.fixture
def jffs2_bin() -> Iterator[BinaryIO]:
yield from gzip_file("data/jffs2.bin.gz")
yield from gzip_file("_data/jffs2.bin.gz")


@pytest.fixture
def jffs2_zlib() -> Iterator[BinaryIO]:
yield from gzip_file("data/jffs2.zlib.bin.gz")
yield from gzip_file("_data/jffs2.zlib.bin.gz")


@pytest.fixture
def jffs2_router() -> Iterator[BinaryIO]:
yield from gzip_file("data/router.bin.gz")
yield from gzip_file("_data/router.bin.gz")
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ deps =
sphinx-design
furo
commands =
make -C tests/docs clean
make -C tests/docs html
make -C tests/_docs clean
make -C tests/_docs html

[testenv:docs-linkcheck]
allowlist_externals = make
deps = {[testenv:docs-build]deps}
commands =
make -C tests/docs clean
make -C tests/docs linkcheck
make -C tests/_docs clean
make -C tests/_docs linkcheck
Loading