Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turn on nitpicking for Sphinx docs build #654

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stan-dot
Copy link
Contributor

just seeing how will the CI react...

@stan-dot stan-dot added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 18, 2024
@stan-dot stan-dot self-assigned this Nov 18, 2024
@stan-dot stan-dot linked an issue Nov 18, 2024 that may be closed by this pull request
@stan-dot stan-dot changed the title turn on nitpicking turn on nitpicking for Sphinx docs build Nov 18, 2024
@stan-dot
Copy link
Contributor Author

errors here are of this class:

/home/runner/work/ophyd-async/ophyd-async/src/ophyd_async/core/_status.py:docstring of ophyd_async.core._status.AsyncStatus:1: WARNING: py:class reference target not found: _asyncio.Task

@stan-dot
Copy link
Contributor Author

deps:

pip freeze | grep sphinx
pydata-sphinx-theme==0.16.0
sphinx-autobuild==2024.10.3
sphinx-copybutton==0.5.2
sphinx_design==0.6.1
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-mermaid==1.0.0
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0

@stan-dot
Copy link
Contributor Author

note: we could ignore the class type warning?

# A list of (type, target) tuples (by default empty) that should be ignored when
# generating warnings in "nitpicky mode". Note that type should include the
# domain name if present. Example entries would be ('py:func', 'int') or
# ('envvar', 'LD_LIBRARY_PATH').
nitpick_ignore = [
    # builtins
    ("py:class", "NoneType"),
    ("py:class", "'str'"),
    ("py:class", "'float'"),
    ("py:class", "'int'"),
    ("py:class", "'bool'"),
    ("py:class", "'object'"),
    ("py:class", "'id'"),
    # typing
    ("py:class", "typing_extensions.Literal"),
]

@stan-dot
Copy link
Contributor Author

signal backend has this, not sure if related:

DTypeScalar_co = TypeVar("DTypeScalar_co", covariant=True, bound=np.generic)
Array1D = np.ndarray[tuple[int], np.dtype[DTypeScalar_co]]
Primitive = bool | int | float | str
# NOTE: if you change this union then update the docs to match
SignalDatatype = (
    Primitive
    | Array1D[np.bool_]
    | Array1D[np.int8]
    | Array1D[np.uint8]
    | Array1D[np.int16]
    | Array1D[np.uint16]
    | Array1D[np.int32]
    | Array1D[np.uint32]
    | Array1D[np.int64]
    | Array1D[np.uint64]
    | Array1D[np.float32]
    | Array1D[np.float64]
    | np.ndarray
    | StrictEnum
    | Sequence[str]
    | Sequence[StrictEnum]
    | Table
)
# TODO: These typevars will not be needed when we drop python 3.11
# as you can do MyConverter[SignalType: SignalTypeUnion]:
# rather than MyConverter(Generic[SignalType])
PrimitiveT = TypeVar("PrimitiveT", bound=Primitive)
SignalDatatypeT = TypeVar("SignalDatatypeT", bound=SignalDatatype)
SignalDatatypeV = TypeVar("SignalDatatypeV", bound=SignalDatatype)
EnumT = TypeVar("EnumT", bound=StrictEnum)
TableT = TypeVar("TableT", bound=Table)

@stan-dot
Copy link
Contributor Author

stan-dot commented Nov 18, 2024

manually deleted the generated directory to run again

...

I see lots of obj reference target not found [IMPORTPATH]

such as:

/workspaces/ophyd-async/src/ophyd_async/epics/adkinetix/_kinetix.py:docstring of ophyd_async.epics.adkinetix._kinetix.KinetixDetector:1:<autosummary>:1: WARNING: py:obj reference target not found: ophyd_async.epics.adkinetix.KinetixController

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable Sphinx nitpick
1 participant