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
{{ message }}
Repository navigation
docs do not build on py3.7 due to small change in python handling of -m #11838
I do not quite understand how that -m issue affects this. I always thought examples are run through sphinx gallery, which would os.chdir to the directory of the example file. In that case importing from the cwd should work fine, no?
previously when using -m the string '' was first in the path which means the cwd of the process is always in the path (even if you change directories)
we, via sphinx-gallery, rely on this when we exec the example code to have the local imports work
the fix in cpython to the security concern is that the 'cwd' is resolved as the directory you are launching from and that absolute path is put into sys.path. This in turn breaks our imports
I think the fix is to in our sphinx conf add if '' not in sys.path: sys.path.append('') (or something to that effect) or to move this logic to sphinx gallery (and have it explicitly add / remove the cwd directory as it moves around the examples).
From a quick look at it, I'd suggest consolidating all unit examples that import basic_units into a single one together with basic_units itself; having each "this specific plotting method supports units" example in a separate file doesn't seem to be that helpful(?)
Activity
ImportanceOfBeingErnest commentedon Aug 10, 2018
I do not quite understand how that
-missue affects this. I always thought examples are run through sphinx gallery, which wouldos.chdirto the directory of the example file. In that case importing from the cwd should work fine, no?tacaswell commentedon Aug 10, 2018
Sorry my notes from last night were not super clear.
matplotlib/doc/Makefile
Line 6 in cff3da2
-mthe string''was first in the path which means the cwd of the process is always in the path (even if you change directories)execthe example code to have the local imports worksys.path. This in turn breaks our importsex
I think the fix is to in our sphinx conf add
if '' not in sys.path: sys.path.append('')(or something to that effect) or to move this logic to sphinx gallery (and have it explicitly add / remove the cwd directory as it moves around the examples).ImportanceOfBeingErnest commentedon Aug 10, 2018
There is already a similar hack present in
conf.pymatplotlib/doc/conf.py
Line 22 in f4ae5d1
so that might be the best option for now.
anntzer commentedon Aug 10, 2018
From a quick look at it, I'd suggest consolidating all unit examples that import basic_units into a single one together with basic_units itself; having each "this specific plotting method supports units" example in a separate file doesn't seem to be that helpful(?)
BLD: pragmatic fix for building basic_unit example on py37