Skip to content

Fix sphinx configuration - #164

Merged
hgomersall merged 2 commits into
pyFFTW:masterfrom
jakirkham:fix_sphinx_conf
Apr 20, 2017
Merged

hgomersall merged 2 commits into
pyFFTW:masterfrom
jakirkham:fix_sphinx_conf

Conversation

@jakirkham

Copy link
Copy Markdown
Member

Fixes a couple of things with the configuration file that came up while trying to get ReadTheDocs working.

First it stops adding the current working directory to the path. This ends up resulting in some confusion for Sphinx (with or without ReadTheDocs) in terms of where to import things from. By dropping this path manipulation, Sphinx simply tries to import pyfftw the standard way. So if it was installed in site-packages, this will import it from there. Also it works just as well with development installs. Regardless it ensures it is importing only the fully built pyfftw and not the unbuilt source, which causes problems.

Second it gets the version information from pyfftw.version, which should exist in the fully built pyfftw instead of resorting to using the setup.py file. Importing the latter could have all sorts of weird, unintended side effects. The same problems are not true of pyfftw.version. Thus it works just as well and is cleaner.

This was referenced Apr 4, 2017
Seems like this is confusing Sphinx in terms of where to look for the
Python sources. So if we simply drop this manipulation, this should no
longer cause a problem.
Relying on the `setup.py` file to get the version information doesn't
seem like a good idea. It also requires `pyfftw` to be built in source
to build the docs, which really shouldn't be a requirement. Given
`pyfftw.version` will have this information and should be created in
source or out-of-source builds, use that instead to extract the version
information.
Comment thread conf.py
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('.'))
#sys.path.insert(0, os.path.abspath('.'))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't like this, we can add a guard that checks the READTHEDOCS environment variable.

@jakirkham

Copy link
Copy Markdown
Member Author

Please let me know your thoughts on this, @hgomersall.

@hgomersall
hgomersall merged commit 30cbee4 into pyFFTW:master Apr 20, 2017
@jakirkham
jakirkham deleted the fix_sphinx_conf branch April 20, 2017 13:33
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.

2 participants