Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
rtd: Print package-versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ankostis committed Jan 19, 2015
1 parent 345ec63 commit dc8876e
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,35 @@
import re
import sys, os, io


print("python exec: %s"% sys.executable)
print("sys.path: %s"%sys.path)
try:
import numpy
print("numpy: %s, %s" % (numpy.__version__, numpy.__file__))
except ImportError:
print("no numpy")
try:
import scipy
print("scipy: %s, %s" % (scipy.__version__, scipy.__file__))
except ImportError:
print("no scipy")
try:
import pandas
print("pandas: %s, %s" % (pandas.__version__, pandas.__file__))
except ImportError:
print("no pandas")
try:
import matplotlib
print("matplotlib: %s, %s" % (matplotlib.__version__, matplotlib.__file__))
except ImportError:
print("no matplotlib")
try:
import IPython
print("ipython: %s, %s" % (IPython.__version__, IPython.__file__))
except ImportError:
print("no ipython")


projname = 'wltp'
mydir = os.path.dirname(__file__)

Expand Down Expand Up @@ -44,7 +72,10 @@ def read_project_version():
# Also tried but fails: http://blog.rtwilson.com/how-to-make-your-sphinx-documentation-compile-with-readthedocs-when-youre-using-numpy-and-scipy/
#
if on_rtd:
from unittest.mock import MagicMock
try:
from unittest.mock import MagicMock
except ImportError:
from mock import Mock as MagicMock

class Mock(MagicMock):
@classmethod
Expand Down

0 comments on commit dc8876e

Please sign in to comment.