Closed
Description
I want pdoc3
to skip everything in my project's the tests
directory, but even after reading #99 I am unable to get it to do so. Steps taken:
-
Create new directory
mwe
andcd
into it. -
Create
./main.py
with:
"""Main program."""
def main(): pass
-
Create
./tests
directory. -
Create
./tests/test.py
with:
"""Test code."""
def test(): pass
- Run
pdoc --force --html .
to generate docs:
$ tree --charset unicode html
html
`-- mwe
|-- index.html
|-- main.html
`--
63A9
tests
|-- index.html
`-- test.html
- Add an file
./tests/__init__.py
, re-runpdoc --force --html .
, get error message:
/Users/gvwilson/miniforge3/lib/python3.9/site-packages/pdoc/__init__.py:239: UserWarning: Couldn't read PEP-224 variable docstrings from <Module 'mwe.tests'>: could not get source code
warn("Couldn't read PEP-224 variable docstrings from {!r}: {}".format(doc_obj, exc))
- Add this to
./tests/__init__.py
__pdoc__ = {
'tests': False
}
produces a different error message:
/Users/gvwilson/miniforge3/lib/python3.9/site-packages/pdoc/__init__.py:706: UserWarning: __pdoc__-overriden key 'tests' does not exist in module 'mwe.tests'
warn('__pdoc__-overriden key {!r} does not exist '
- Creating an
__init__.py
file in the project's root directory with this content produces the same error message:
__pdoc__ = {
'tests': False
}
- Modify
./__init__.py
to containmwe.tests
as shown below also produces this error message:
__pdoc__ = {
'mwe.tests': False
}
I'd be grateful for the correct incantation (or if one doesn't exist, I'd be happy to PR a --ignore dir [dir]
option).
Metadata
Metadata
Assignees
Labels
No labels