Skip to content

Conversation

@embray
Copy link
Member

@embray embray commented Jun 6, 2014

After updating to use astropy-helpers, it is no longer possible to do:

python setup.py develop
cd docs
make html

The result of this is:

(astropy)neptune$ make html
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.1.3

Exception occurred:
  File "/Users/aldcroft/git/astropy/docs/conf.py", line 33, in <module>
    from astropy_helpers.sphinx.conf import *
ImportError: No module named astropy_helpers.sphinx.conf

One patch that fixes this case is inserting the following into docs/conf.py:

import sys
import os
sys.path.append(os.path.join('..', 'astropy_helpers'))

@taldcroft taldcroft added this to the v0.4.0 milestone May 20, 2014
@embray
Copy link
Member

embray commented May 22, 2014

That's not always guaranteed to work. A better approach would be to do something with the ah_bootstrap script, which knows how to import astropy_helpers in all supported cases. But I'm not exactly sure yet how that would work. Something I need to look into. setup.py build_sphinx works.

@astrofrog
Copy link
Member

Readthedocs needs this to work, although as a plan B we can simply add astropy-helpers to the rtd-pip-requirements

@embray
Copy link
Member

embray commented May 23, 2014

That might be more straightforward for now.

@astrofrog
Copy link
Member

@embray - astropy-helpers added to pip requirements for RTD in a1bdf2d

@embray
Copy link
Member

embray commented Jun 6, 2014

Now that we've gone ahead and included astropy-helpers in the source distribution by default, it should be okay, for all intents and purposes, to do the sys.path insertion for now. One thing that probably won't cooperate with is the auto-update feature, but that's not really intended for developers who would want to build the docs anyways.

@embray
Copy link
Member

embray commented Jun 6, 2014

Another option would be to install astropy-helpers from the submodule using ./setup.py develop.

…side the docs/ directory without having explicitly installed astropy_helpers first. For general cases, such as building the docs on rtd, it remains preferable to simply install astropy_helpers first.
@embray
Copy link
Member

embray commented Jun 6, 2014

Went ahead and pushed the sys.path.insert workaround for now. This shouldn't affect anything else. astropy_helpers should still be listed as one of the docs build requirements. I'll look into a better solution in the future if needed.

@astrofrog
Copy link
Member

Works nicely for me. Travis failures are unrelated. Thanks @embray!

astrofrog added a commit that referenced this pull request Jun 7, 2014
astropy_helpers not found in "cd docs; make html"
@astrofrog astrofrog merged commit 67c5801 into astropy:master Jun 7, 2014
@embray embray deleted the issue-2532 branch June 9, 2014 17:15
saimn added a commit to saimn/astropy that referenced this pull request Jul 7, 2016
`make html` does not work on Python 3, and there should be only one way to
build the docs (`setup.py build_docs`) and avoid to confuse users:

    Exception occurred:
    File "conf.py", line 43, in <module>
	from astropy_helpers.sphinx.conf import *
    ImportError: No module named 'astropy_helpers.sphinx'

Ref astropy#4133, astropy#2532
@saimn saimn mentioned this pull request Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Affects-dev PRs and issues that do not impact an existing Astropy release Bug Docs installation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants