Skip to content

Commit e713fe0

Browse files
committed
Fix doc building with version from versioneer.
1 parent d98f261 commit e713fe0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,17 @@
5757
# |version| and |release|, also used in various other places throughout the
5858
# built documents.
5959
#
60+
61+
# We need this hokey-pokey because versioneer needs the current
62+
# directory to be the root of the project to work.
63+
_curpath = os.getcwd()
64+
os.chdir(os.path.dirname(os.path.dirname(__file__)))
6065
# The full version, including alpha/beta/rc tags.
6166
release = versioneer.get_version()
6267
# The short X.Y version.
6368
version = '.'.join(release.split('.')[:2])
69+
os.chdir(_curpath)
70+
del _curpath
6471

6572
# The language for content autogenerated by Sphinx. Refer to documentation
6673
# for a list of supported languages.

0 commit comments

Comments
 (0)