Closed svx closed 7 years ago
Digging deeper
make html
Traceback (most recent call last):
File "/srv/Projects/test/sphinx/foo/bin/sphinx-build", line 7, in <module>
from sphinx import main
Steps to reproduce (Ubuntu 16.10):
virtualenv -p python2.7 foo
cd foo/
source bin/activate
pip install sphinx
bin/sphinx-quickstart
pip install git+https://github.com/plone/sphinx.themes.plone.git@ploneorg5_adjustmens#egg=sphinx.themes.plone
vim docs/conf.py
make html
If I 'just' do:
virtualenv -p python2.7 foo
cd foo/
source bin/activate
pip install sphinx
bin/sphinx-quickstart
make html
It works with the default alabaster theme, as soon as I install our theme via pip and adjust the conf.py, I get the error.
What's in your conf.py
?
I use the same conf.py as we use on docs.plone.org and also the same sphinx version.
The only difference to docs.plone.org is that I do not use buildout, but pip instead. Since I really only need the theme and one other sphinx extension I do not see the point of running buildout.
IMHO this should be possible with pip. :)
Same if I use buildout:
[buildout]
extensions =
mr.developer
allow-picked-versions = true
auto-checkout +=
sphinx.themes.plone
parts +=
sphinx-build
[sources]
sphinx.themes.plone = git https://github.com/plone/sphinx.themes.plone.git branch=ploneorg5_adjustmens
[sphinx-build]
recipe = zc.recipe.egg
eggs =
Sphinx
sphinx.themes.plone
[versions]
# use the same as the Plone release
zc.buildout = 2.4.3
setuptools = 18.3.1
Sphinx = 1.3.6
six = 1.10.0
Pygments = 2.1.3
Okay, if I pin all versions also for zc.buildout and setuptools, before I run buildout, I am getting somewhere with buildout.
Things to figure out:
This is working:
$ cat requirements.txt
zc.buildout == 2.4.3
setuptools == 18.3.1
Sphinx == 1.3.6
-e git+https://github.com/plone/sphinx.themes.plone@ploneorg5_adjustmens#egg=sphinx.themes.plone
Next step newer versions of:
Upgrading Sphinx to latest version works.
IMHO it is a problem with setuptools and zc.buildout
If I upgrade one of them, I get
$ make html
sphinx-build -b html -d _build/doctrees . _build/html
Traceback (most recent call last):
File "/srv/Projects/test/sphinx/pip-install/bin/sphinx-build", line 7, in <module>
from sphinx import main
ImportError: cannot import name main
Makefile:56: recipe for target 'html' failed
make: *** [html] Error 1
@svx it might is also a problem of order. As sphinx.theme.plone itself requires Sphinx to be installed before, a namespace clash occure after installation. A manual update or reinstall of Sphinx itself fixes the problem for the moment.
So there must be some problem with the namespace and package layout. But there we might need help from someone who has more insights into package and namespace layout.
@svx I think we do have a namespace clash, that make some problem, we do use sphinx as primary namespace, and Sphinx itself has the same but with upper case, which is in Python context ignored and threaten as lower case. We might could easyly fix that by renaming the package to sphinxtheme.plone, which will remove one dot, but also replace two whole namespaces with just one.
@loechel I am fine with everything :)
I say choose that one which is less work ? :)
@svx could we close this issue now?
I think it is fixed.
Install from GitHub via pip is not working
I try to install a certain branch from GitHub:
And I get:
If I try now
make html
I get:This is somehow not ideal :)