Closed kloczek closed 1 year ago
This might happen due to version collisions.
Have you tried running it in a virtualenv or a new Python installation?
As long as ponf.py contains
https://github.com/lark-parser/lark/blob/2de51ceaa542d4be322cba034ee29a2d887bfd19/docs/conf.py#L20-L22
sphinx is able to find lark-parser
code and as I'm running build in isolated env where is installed only what is needed by package build it does not need to run in venv as well.
Error messages are pointing exactly on code issue and some time ago with older spahinx and numpy documentation build usimg exactly the same procedure was wrking.
Can you try to reporoduce that issue using command which I'm using? 🤔
What is the command you're using?
Keep in mind the documentation gets built independently by readthedocs on every commit to master.
/usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Keep in mind the documentation gets built independently by readthedocs on every commit to master.
Issue is related o run such build in env with exact versions of modules .. which I forgot to add to this ticket. Here is list of modules installed in build env
Package Version
----------------------------- -----------------
alabaster 0.7.13
Babel 2.12.1
build 0.10.0
charset-normalizer 3.1.0
commonmark 0.9.1
distro 1.8.0
docutils 0.19
exceptiongroup 1.0.0
gpg 1.19.0
idna 3.4
imagesize 1.4.1
importlib-metadata 6.3.0
iniconfig 2.0.0
installer 0.7.0
Jinja2 3.1.2
libcomps 0.1.19
MarkupSafe 2.1.2
olefile 0.46
packaging 23.0
Pillow 9.5.0
pluggy 1.0.0
Pygments 2.15.0
pyproject_hooks 1.0.0
pytest 7.3.0
python-dateutil 2.8.2
pytz 2023.2
recommonmark 0.7.1
requests 2.28.2
setuptools 65.6.3
six 1.16.0
snowballstemmer 2.2.0
Sphinx 6.1.3
sphinxcontrib-applehelp 1.0.4
sphinxcontrib-devhelp 1.0.2.dev20230405
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1.dev20230405
sphinxcontrib-qthelp 1.0.3.dev20230405
sphinxcontrib-serializinghtml 1.1.5
tomli 2.0.1
urllib3 1.26.15
wheel 0.40.0
zipp 3.15.0
In that list of installed packages, sphinx-gallery
isn't listed at all, so that can't be the correct environment. I think that with /usr/bin/sphinx-build
instead of sphinx-build
you are calling out to the global python installation, not the local environment.
With installed sphinx-gallery
+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v7.0.1
WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English).
making output directory... done
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/sphinx/events.py", line 96, in emit
results.append(listener.handler(self.app, *args))
File "/usr/lib/python3.8/site-packages/sphinx_gallery/gen_gallery.py", line 1173, in fill_gallery_conf_defaults
new_sphinx_gallery_conf = _fill_gallery_conf_defaults(
File "/usr/lib/python3.8/site-packages/sphinx_gallery/gen_gallery.py", line 250, in _fill_gallery_conf_defaults
_import_matplotlib()
File "/usr/lib/python3.8/site-packages/sphinx_gallery/scrapers.py", line 39, in _import_matplotlib
matplotlib.use('agg')
AttributeError: module 'matplotlib' has no attribute 'use'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", line 280, in build_main
app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 253, in __init__
self.events.emit('config-inited', self.config)
File "/usr/lib/python3.8/site-packages/sphinx/events.py", line 107, in emit
raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <function fill_gallery_conf_defaults at 0x7f2ac83e9820> for event 'config-inited' threw an exception (exception: module 'matplotlib' has no attribute 'use')
Extension error (sphinx_gallery.gen_gallery):
Handler <function fill_gallery_conf_defaults at 0x7f2ac83e9820> for event 'config-inited' threw an exception (exception: module 'matplotlib' has no attribute 'use')`
Looks like it is some issue with building documentation