File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 5858 import pytato
5959 import pyopencl as cl
6060
61- if getattr (sys , "ARRAYCONTEXT_BUILDING_SPHINX_DOCS " , False ):
61+ if getattr (sys , "_BUILDING_SPHINX_DOCS " , False ):
6262 import pyopencl as cl # noqa: F811
6363
6464
Original file line number Diff line number Diff line change 2727 "https://jax.readthedocs.io/en/latest/" : None ,
2828}
2929
30+ # Some modules need to import things just so that sphinx can resolve symbols in
31+ # type annotations. Often, we do not want these imports (e.g. of PyOpenCL) when
32+ # in normal use (because they would introduce unintended side effects or hard
33+ # dependencies). This flag exists so that these imports only occur during doc
34+ # build. Since sphinx appears to resolve type hints lexically (as it should),
35+ # this needs to be cross-module (since, e.g. an inherited arraycontext
36+ # docstring can be read by sphinx when building meshmode, a dependent package),
37+ # this needs a setting of the same name across all packages involved, that's
38+ # why this name is as global-sounding as it is.
3039import sys
31- sys .ARRAYCONTEXT_BUILDING_SPHINX_DOCS = True
40+ sys ._BUILDING_SPHINX_DOCS = True
You can’t perform that action at this time.
0 commit comments