Skip to content

doc: Properly find the version #488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

doc: Properly find the version #488

wants to merge 1 commit into from

Conversation

jehane
Copy link

@jehane jehane commented Sep 29, 2016

The conf.py can't import nibabel if nibabel isn't installed, as is the
case when installing nibabel for the first time.

The conf.py can't import nibabel if nibabel isn't installed, as is the
case when installing nibabel for the first time.
@bochecha
Copy link

In case you wonder why @jehane sent a pull-request for my commit, that's because I wrote the patch to help them and then completely forgot to open this pull-request. 😄

@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.947% when pulling cef68ac on jehane:master into ec4567f on nipy:master.

@codecov-io
Copy link

codecov-io commented Sep 29, 2016

Current coverage is 93.97% (diff: 100%)

Merging #488 into master will not change coverage

@@             master       #488   diff @@
==========================================
  Files           166        166          
  Lines         21836      21836          
  Methods           0          0          
  Messages          0          0          
  Branches       2327       2327          
==========================================
  Hits          20520      20520          
  Misses          885        885          
  Partials        431        431          

Powered by Codecov. Last update ec4567f...cef68ac

@effigies
Copy link
Member

Looks reasonable.

👍 for merge.

@matthew-brett
Copy link
Member

The change is reasonable, but I believe the docs will not build correctly without an installation of nibabel. What do you get if you try and build the docs when nibabel is not installed?

@bochecha
Copy link

bochecha commented Sep 29, 2016

Seems to work just fine with this patch applied.

In a virtualenv, I did:

$ pip install -r doc-requirements.txt
...
$ make htmldoc
...
Build finished. The HTML pages are in ../build/html.
make[1]: Leaving directory '/home/mathieu/Workspace/nibabel/doc'

Then if I open $(pwd)/build/html/index.html in Firefox I get what looks like your documentation, with the user manual, API doc, etc.

@matthew-brett
Copy link
Member

I think in that case that import nibabel will also work because you are running from the nibabel root directory. But, if I do:

cd doc
make html

I get lots of errors like this in the doc build

/Users/mb312/dev_trees/nibabel/doc/source/neuro_radio_conventions.rst:83: WARNING: Exception occurred in plotting neuro_radio_conventions-2
 from /Users/mb312/dev_trees/nibabel/doc/source/neuro_radio_conventions.rst:
Traceback (most recent call last):
  File "/Users/mb312/.virtualenvs/test/lib/python2.7/site-packages/matplotlib/sphinxext/plot_directive.py", line 517, in run_code
    six.exec_(code, ns)
  File "/Users/mb312/.virtualenvs/test/lib/python2.7/site-packages/matplotlib/externals/six.py", line 672, in exec_
    exec("""exec _code_ in _globs_, _locs_""")
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <module>
ImportError: No module named nibabel

and the API part of the documentation lists the submodules, but the content is empty.

@matthew-brett
Copy link
Member

@bochecha - any comments here? For example, I wonder whether we just need a better error message if nibabel is not installed.

@bochecha
Copy link

bochecha commented Jan 12, 2017

I think in that case that import nibabel will also work because you are running from the nibabel root directory. But, if I do:

cd doc
make html

I think this is the root of the problem.

Indeed, make htmldoc works just fine without nibabel installed, and without this patch, since it sets PYTHONPATH correctly.

I think when we had the problem originally with @jehane was because we had cd doc && make html.

So maybe make htmldoc needs to be emphasized as the right way to build the docs.

For example, I wonder whether we just need a better error message if nibabel is not installed.

Perhaps that error message could just tell people to run make htmldoc from the root dir?

matthew-brett added a commit to matthew-brett/nibabel that referenced this pull request Jan 12, 2017
@matthew-brett
Copy link
Member

Thanks for analyzing the problem a bit more. How about #503 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants