Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JSCU-CNI committed Feb 17, 2025
1 parent c229db6 commit a224120
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/_data/** filter=lfs diff=lfs merge=lfs -text
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ dist/
*.pyc
__pycache__/
.pytest_cache/
tests/docs/api
tests/docs/build
tests/_docs/api
tests/_docs/build
.tox/
2 changes: 2 additions & 0 deletions dissect/cim/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ def key(self) -> InstanceKey:


class InstanceKey(dict):
"""InstanceKey"""

def __getattr__(self, key: str) -> Any:
return self[key]

Expand Down
3 changes: 3 additions & 0 deletions tests/_data/INDEX.BTR.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/_data/MAPPING1.MAP.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/_data/MAPPING2.MAP.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/_data/MAPPING3.MAP.gz
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/_data/OBJECTS.DATA.gz
Git LFS file not shown
2 changes: 1 addition & 1 deletion tests/docs/Makefile → tests/_docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -jauto
SPHINXOPTS ?= -jauto -w $(BUILDDIR)/warnings.log --fail-on-warning
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = build
Expand Down
7 changes: 7 additions & 0 deletions tests/docs/conf.py → tests/_docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
project = "dissect.cim"

extensions = [
"autoapi.extension",
"sphinx.ext.autodoc",
Expand Down Expand Up @@ -32,3 +34,8 @@
autodoc_member_order = "groupwise"

autosectionlabel_prefix_document = True

suppress_warnings = [
# https://github.com/readthedocs/sphinx-autoapi/issues/285
"autoapi.python_import_resolution",
]
File renamed without changes.
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 open_file_gz(name: str, mode: str = "rb") -> Iterator[gzip.GzipFile]:

@pytest.fixture
def index_bin() -> Iterator[BinaryIO]:
yield from open_file_gz("data/INDEX.BTR.gz")
yield from open_file_gz("_data/INDEX.BTR.gz")


@pytest.fixture
def objects_bin() -> Iterator[BinaryIO]:
yield from open_file_gz("data/OBJECTS.DATA.gz")
yield from open_file_gz("_data/OBJECTS.DATA.gz")


@pytest.fixture
def mappings_bin() -> Iterator[list[BinaryIO]]:
yield from zip(*[open_file_gz(f"data/MAPPING{i}.MAP.gz") for i in range(1, 4)])
yield from zip(*[open_file_gz(f"_data/MAPPING{i}.MAP.gz") for i in range(1, 4)])
Binary file removed tests/data/INDEX.BTR.gz
Binary file not shown.
Binary file removed tests/data/MAPPING1.MAP.gz
Binary file not shown.
Binary file removed tests/data/MAPPING2.MAP.gz
Binary file not shown.
Binary file removed tests/data/MAPPING3.MAP.gz
Binary file not shown.
Binary file removed tests/data/OBJECTS.DATA.gz
Binary file not shown.
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,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

0 comments on commit a224120

Please sign in to comment.