Python documentation generator
1. Introduce --without websupport Sphinx (build)requires sphinxcontrib-websupport but that (build)requires sphinx. This bcond can be used to bootstrap this. 2. Introduce --without tests The tests bring a lot of additional dependencies that make bootstrapping harder. This allows to build without tests. 3. Build the docs with self The documentation was built with 'python', thus importing sphinx from python2's sitelib. Sphinx was installed because of the above mentioned buildrequirement of sphinxcontrib-websupport. Now current sphinx from PWD is used, also python3 is used when available, otherwise python2. Never just python. |
||
---|---|---|
.gitignore | ||
default-sphinx-command.in | ||
fix-test_autodoc.patch | ||
python2-sphinx | ||
python3-sphinx | ||
python-sphinx.spec | ||
README.fedora | ||
sources | ||
xfail-test_latex_remote_images.patch | ||
zz-modules-python-sphinx.csh | ||
zz-modules-python-sphinx.sh |
Sphinx with autodoc is sensitive to whether it is run via Python2 or Python3 as it uses the Python version that it is invoked with to parse the source files for docstrings. Unfortunately, there's no logic to detect this within the sphinx commands and the standard Makefiles generated by sphinx-quickstart don't give the user any hint that it might be a problem. The Fedora package tries to mitigate this problem by allowing the user to switch between the Python2 and Python3 versions using environment-modules. To switch to the Python3 commands, use:: module swap python-sphinx/python3-sphinx To switch to the Python2 version, use:: module swap python-sphinx/python2-sphinx The default install uses the python2 version of the modules. If the system administrator wishes to change the default, edit the /etc/profile.d/zz-modules-python-sphinx.sh and /etc/profile.d/zz-modules-python-sphinx.csh files to specify a specific alternative to use. For instance, to make the python3 version the default, modify it like so:: @@ -1,2 +1,2 @@ # Add path to the default python-sphinx scripts on this version of Fedora -module load python-sphinx +module load python-sphinx/python3-sphinx