Closed jackjansen closed 2 years ago
Readthedocs is passing, so I'm guessing this must have to do with the Sphinx version. It still uses the default Sphinx v1.8.6.
I was apparently using Sphinx 5.1.0 (which satisfies requirements_dev.txt
).
Pinning Sphinx==1.8.6
leads to a different error:
(.venv) jack@beignet:bleak$ make docs
rm -f docs/bleak.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ bleak
Traceback (most recent call last):
File "/Users/jack/src/jack-git/bleak/.venv/bin/sphinx-apidoc", line 5, in <module>
from sphinx.ext.apidoc import main
File "/Users/jack/src/jack-git/bleak/.venv/lib/python3.9/site-packages/sphinx/ext/apidoc.py", line 32, in <module>
from sphinx.cmd.quickstart import EXTENSIONS
File "/Users/jack/src/jack-git/bleak/.venv/lib/python3.9/site-packages/sphinx/cmd/quickstart.py", line 49, in <module>
from sphinx.util.template import SphinxRenderer
File "/Users/jack/src/jack-git/bleak/.venv/lib/python3.9/site-packages/sphinx/util/template.py", line 17, in <module>
from sphinx.jinja2glue import SphinxFileSystemLoader
File "/Users/jack/src/jack-git/bleak/.venv/lib/python3.9/site-packages/sphinx/jinja2glue.py", line 16, in <module>
from jinja2 import FileSystemLoader, BaseLoader, TemplateNotFound, \
ImportError: cannot import name 'contextfunction' from 'jinja2' (/Users/jack/src/jack-git/bleak/.venv/lib/python3.9/site-packages/jinja2/__init__.py)
make: *** [docs] Error 1
ImportError: cannot import name 'contextfunction' from 'jinja2'
https://stackoverflow.com/q/71634462/1976323
I guess the jinja2 version needs to be pinned as well.
The issue seems to be with the toplevel Makefile. And maybe only on MacOS: if I don't install the requirements.txt
and hence don't have pyobjc-framework-CoreBluetooth
the problem doesn't occur, at least: as long as I run READTHEDOCS=True make -C docs html
only.
But if I do have the corebluetooth module installed, and I run a toplevel make docs
I get some extra files in docs
such as bleak.backends.corebluetooth.rst
, and from that point on things start failing.
Hmm.... would it be the sphinx-apidoc -o docs/ bleak
that is the culprit?
Indeed, I think the sphinx-apidoc
is a leftover from the past. git blame
shows it as
^2e7bb43 (Henrik Blidh 2018-04-26 23:12:47 +0200 69) sphinx-apidoc -o docs/ bleak
but in 2020 docs/api.rst
was updated to include the relevant bits manually:
07d07a04 (Henrik Blidh 2020-09-14 15:31:39 +0200 21)
I've never used the top-level makefile, so I would be OK with just deleting the whole file.
These issues have been addressed in 78f15ee and 74c29ff.
bluetoothctl -v
) in case of Linux:Description
Trying to build the documentation. Actually because I want to try it on another branch I'm working on, where it failed, then I tried on develop, where it fails too.
What I Did
The output: