You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously when we are handling issue #327 in PR #478, we attempted to use nitpicky mode in SPHINX_OPT (inside Makefile), but due to sphinx requiring all classes need to be exported, and at this moment (2022/08/03) we cannot find a way to specify a class to be unexported, we decided to open this ticket to remind us to allow -n to be activated at some point.
Solution
We used to add nitpick-ignore (regex) in docs/conf.py to ignore the warning, for warning would error by -W error on warning settings. The following is the nitpick configuration code snippet, hopefully it would be somewhat useful when we pick up the issue again.
classNitpickIgnore:
@staticmethoddefoptional() ->list[tuple[str, str]]:
""" Ignores parameter declarations that specify _optional_ usage. """return [
("py:class", "optional"),
]
@staticmethoddefstandard_library() ->list[tuple[str, str]]:
""" Ignores Python standard library references that Sphinx does not track. """return [
("py:class", "abc.ABC"),
]
@staticmethoddefunexported() ->list[tuple[str, str]]:
""" Ignores Pyteal internal unexported classes that Sphinx cannot track reference. """return [
("py:class", "pyteal.BlockField"),
("py:class", "pyteal.Base64Encoding"),
("py:class", "pyteal.VrfVerifyStandard"),
("py:class", "pyteal.JsonRefType"),
("py:class", "pyteal.OutputKwArgInfo"),
]
classNitpickIgnoreRegex:
@staticmethoddeftype_vars() ->list[tuple[str, str]]:
""" Regex ignores generic TypeVar definitions that Sphinx does not track. """return [
("py.obj", r".*\.T$"),
("py.obj", r".*\.T[0-9]+$"),
("py.class", r".*\.T_co$"),
("py.obj", r".*\.T_co$"),
("py.class", r".*\.T$"),
("py.class", r"^T$"),
("py.obj", r".*\.N$"),
("py.class", r".*\.N$"),
("py.class", r"^N$"),
]
@staticmethoddefstandard_library() ->list[tuple[str, str]]:
""" Regex ignores Python standard library references that Sphinx does not track. """return [
("py:class", r"contextlib\..*"),
("py:class", r"enum\..*"),
]
@staticmethoddefthird_party() ->list[tuple[str, str]]:
""" Regex ignores 3rd party references that Sphinx does not track. """return [
("py:class", r"algosdk\.abi\..*"),
]
nitpick_ignore= (
NitpickIgnore.optional()
+NitpickIgnore.standard_library()
+NitpickIgnore.unexported()
)
nitpick_ignore_regex= (
NitpickIgnoreRegex.standard_library()
+NitpickIgnoreRegex.third_party()
+NitpickIgnoreRegex.type_vars()
)
Dependencies
Higher sphinx version that allows one to specify a way to hide a class from exporting.
Urgency
Not quite?
The text was updated successfully, but these errors were encountered:
Problem
Previously when we are handling issue #327 in PR #478, we attempted to use nitpicky mode in
SPHINX_OPT
(insideMakefile
), but due to sphinx requiring all classes need to be exported, and at this moment (2022/08/03) we cannot find a way to specify a class to be unexported, we decided to open this ticket to remind us to allow-n
to be activated at some point.Solution
We used to add
nitpick-ignore (regex)
indocs/conf.py
to ignore the warning, for warning would error by-W
error on warning settings. The following is thenitpick
configuration code snippet, hopefully it would be somewhat useful when we pick up the issue again.Dependencies
Higher sphinx version that allows one to specify a way to hide a class from exporting.
Urgency
Not quite?
The text was updated successfully, but these errors were encountered: