Skip to content

Commit 6323ea8

Browse files
committed
suppress non-pickleable functions warning
1 parent 12c7aa1 commit 6323ea8

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

cmake_modules/trike/README.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,19 @@ The macro will now be referencable as ``ASSERT(condition...)`` (Lookup of
133133
be unchanged. In order to be recognized, the explicit directive must be the
134134
first line of the ``///``, and there must be no space in the prefix ``///..``
135135

136+
Alternatively, you might want to hide a
137+
`CRTP <https://en.cppreference.com/w/cpp/language/crtp>`_
138+
base class from documentation:
139+
140+
.. code-block:: c++
141+
142+
///.. cpp:class:: template <typename T> Stream<T>
143+
template <typename T>
144+
class Stream<T> : impl::StreamMixin<T>
145+
146+
... that base class doesn't appear in the explicit directive, so sphinx will
147+
never know about it.
148+
136149
Configuration
137150
-------------
138151

cmake_modules/trike/trike/__init__.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -649,27 +649,27 @@ def run(self) -> list[Node]:
649649

650650
def setup(app: Sphinx) -> ExtensionMetadata:
651651
app.add_config_value(
652-
"trike_files",
653-
[],
654-
"env",
655-
types=[list[Path]],
652+
name="trike_files",
656653
description="All C++ sources which will be scanned for ///",
654+
default=[],
655+
rebuild="env",
656+
types=[list[Path]],
657657
)
658658

659659
app.add_config_value(
660-
"trike_clang_args",
661-
[],
662-
"env",
663-
types=[list[str], Mapping[Path, str]],
660+
name="trike_clang_args",
664661
description="Arguments which will be passed to clang (or per-file mapping)",
662+
default=[],
663+
rebuild="env",
664+
types=[list[str], Mapping[Path, str]],
665665
)
666666

667-
# FIXME an unpickleable value causes the environment to *never* be reloadable
668667
app.add_config_value(
669-
"trike_get_uri",
670-
None,
671-
"env",
668+
name="trike_get_uri",
672669
description="A mapping from scanned C++ source to uri",
670+
default=None,
671+
rebuild="",
672+
# really this should be rebuild="env", but functions are not pickleable
673673
)
674674

675675
app.connect("builder-inited", _builder_inited)

sphinx_configuration/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"sphinx": ("https://www.sphinx-doc.org/en/master/usage/%s", None),
7373
}
7474

75-
# TODO get trike files from cmake
7675
trike_files = [
7776
*maud.cache.CMAKE_SOURCE_DIR.glob("*.cxx"),
7877
*maud.cache.CMAKE_SOURCE_DIR.glob("cmake_modules/*.cxx"),

0 commit comments

Comments
 (0)