1. biolab
  2. Untitled project
  3. orange

Commits

mitar  committed f22adc7

Use current version in documentation.

  • Participants
  • Parent commits 2a23b57
  • Branches default

Comments (0)

Files changed (7)

File docs/development/rst/conf.py

View file
 
 import sys, os
 
+import imp
+module_setup = imp.load_source('module_setup', os.path.join(os.path.dirname(__file__), '..', '..', '..', 'setup.py'))
+VERSION = module_setup.VERSION
+
 # If extensions (or modules to document with autodoc) are in another directory,
 # 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.append(os.path.abspath('../../../'))
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../')))
 import Orange
 
 # -- General configuration -----------------------------------------------------
 # built documents.
 #
 # The short X.Y version.
-version = '2.5'
+version = VERSION
 # The full version, including alpha/beta/rc tags.
-release = '2.5 beta'
+release = VERSION
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

File docs/extend-widgets/rst/conf.py

View file
 
 import sys, os
 
+import imp
+module_setup = imp.load_source('module_setup', os.path.join(os.path.dirname(__file__), '..', '..', '..', 'setup.py'))
+VERSION = module_setup.VERSION
+
 # If extensions (or modules to document with autodoc) are in another directory,
 # 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.append(os.path.abspath('../../../'))
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../')))
 import Orange
 
 # -- General configuration -----------------------------------------------------
 # built documents.
 #
 # The short X.Y version.
-version = '2.5'
+version = VERSION
 # The full version, including alpha/beta/rc tags.
-release = '2.5 beta'
+release = VERSION
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

File docs/first-steps/rst/conf.py

View file
 
 import sys, os
 
+import imp
+module_setup = imp.load_source('module_setup', os.path.join(os.path.dirname(__file__), '..', '..', '..', 'setup.py'))
+VERSION = module_setup.VERSION
+
 # If extensions (or modules to document with autodoc) are in another directory,
 # 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.append(os.path.abspath('.'))
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../')))
+import Orange
 
 # -- General configuration -----------------------------------------------------
 
 # built documents.
 #
 # The short X.Y version.
-version = '2.5'
+version = VERSION
 # The full version, including alpha/beta/rc tags.
-release = '2.5 beta'
+release = VERSION
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

File docs/reference/rst/conf.py

View file
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys, os, os.path
+import sys, os
 
 #rewrite formatargs function with different defaults
 sys.path.insert(0, os.path.dirname(__file__))
 sphinx.ext.autodoc.inspect = myinspect
 numpydoc.docscrape.inspect = myinspect
 
+import imp
+module_setup = imp.load_source('module_setup', os.path.join(os.path.dirname(__file__), '..', '..', '..', 'setup.py'))
+VERSION = module_setup.VERSION
+
 #disable deprecation decorators for the documentation
 os.environ["orange_no_deprecated_members"] = "1"
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # 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.append(os.path.abspath('../../../orange'))
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../')))
+import Orange
 
 # -- General configuration -----------------------------------------------------
 
 # built documents.
 #
 # The short X.Y version.
-version = '2.5'
+version = VERSION
 # The full version, including alpha/beta/rc tags.
-release = '2.5 beta'
+release = VERSION
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

File docs/tutorial/rst/conf.py

View file
 
 import sys, os
 
+import imp
+module_setup = imp.load_source('module_setup', os.path.join(os.path.dirname(__file__), '..', '..', '..', 'setup.py'))
+VERSION = module_setup.VERSION
+
 # If extensions (or modules to document with autodoc) are in another directory,
 # 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.append(os.path.abspath('.'))
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../')))
+import Orange
 
 # -- General configuration -----------------------------------------------------
 
 # built documents.
 #
 # The short X.Y version.
-version = '2.5'
+version = VERSION
 # The full version, including alpha/beta/rc tags.
-release = '2.5 beta'
+release = VERSION
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

File docs/widgets/rst/conf.py

View file
 
 import sys, os
 
+import imp
+module_setup = imp.load_source('module_setup', os.path.join(os.path.dirname(__file__), '..', '..', '..', 'setup.py'))
+VERSION = module_setup.VERSION
+
 # If extensions (or modules to document with autodoc) are in another directory,
 # 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.append(os.path.abspath('.'))
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../')))
+import Orange
 
 # -- General configuration -----------------------------------------------------
 
 # built documents.
 #
 # The short X.Y version.
-version = '2.5'
+version = VERSION
 # The full version, including alpha/beta/rc tags.
-release = '2.5 beta'
+release = VERSION
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

File setup.py

View file
 #!usr/bin/env python
 
-import distribute_setup
-distribute_setup.use_setuptools()
+try:
+    import distribute_setup
+    distribute_setup.use_setuptools()
+except ImportError:
+    # For documentation we load setup.py to get version
+    # so it does not matter if importing fails
+    pass
 
 import glob, os, sys, types
 from distutils import log
 # Fails without PyQt4.
 import imp
 try:
-    orangeqt_setup = imp.load_source('orangeqt_setup', 'source/orangeqt/setup.py')
+    orangeqt_setup = imp.load_source('orangeqt_setup', os.path.join(os.path.dirname(__file__), 'source/orangeqt/setup.py'))
     build_pyqt_ext = orangeqt_setup.build_pyqt_ext
 except ImportError:
     orangeqt_setup = None