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

Commit

Permalink
docs: FIX mock on python-2. for RTD
Browse files Browse the repository at this point in the history
- Print package-versions.
- FIX Changes sub-titles.
  • Loading branch information
ankostis committed Jan 19, 2015
1 parent 345ec63 commit afb50c7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Changelog
=========

v0.0.9-alpha.3 (1-Dec-2014)
~~~~~~~~~~~~~~~~~~~~~~~~~~~
---------------------------
This is practically the 1st public releases, reworked in many parts, much better documented,
continuously tested and build using TravisCI, with on-the-fly generated diagrams as metrics,
BUT the arithmetic results produced are still identical to v0.0.7, so that the test-cases and
Expand Down Expand Up @@ -89,7 +89,7 @@ Noteworthy or *incompatilble* changes


v0.0.9-alpha.1 (1-Oct-2014)
~~~~~~~~~~~~~~~~~~~~~~~~~~~
---------------------------
* Backported also to Python-2.7.
* model, core: Discriminate between :term:`Test mass` from :term:`Unladen mass`
(optionally auto-calced by ``driver_mass`` = 75(kg)).
Expand Down
40 changes: 38 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,40 @@
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")
try:
import mock
print("mock: %s, %s" % (mock.__version__, mock.__file__))
except ImportError:
print("no mock")


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

Expand Down Expand Up @@ -44,7 +77,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
1 change: 1 addition & 0 deletions requirements/readthedocs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ six
jsonschema >= 2.4
numpy
pandas
mock
matplotlib

0 comments on commit afb50c7

Please sign in to comment.