Explorar el Código

Add library version; update installation docs

Enis Afgan hace 10 años
padre
commit
98e6c808fb
Se han modificado 2 ficheros con 27 adiciones y 5 borrados
  1. 10 0
      cloudbridge/__init__.py
  2. 17 5
      docs/topics/install.rst

+ 10 - 0
cloudbridge/__init__.py

@@ -1,6 +1,16 @@
 import logging
 import sys
 
+# Current version of the library
+__version__ = '0.1.0'
+
+
+def get_version():
+    """
+    Returns a string with the current version of the library (e.g., "0.1.0")
+    """
+    return __version__
+
 
 def init_logging():
     """

+ 17 - 5
docs/topics/install.rst

@@ -1,21 +1,33 @@
 Installation
 ============
 
-**Latest release**::
+**Prerequisites**: CloudBridge runs on Python 2.7 and higher. Python 3 is recommended.
+
+Latest release
+--------------
+The latest release of cloudbridge can be installed from PyPI::
 
     pip install cloudbridge
 
-**Manual installation**::
+Manual installation
+-------------------
+The development version of the library can be installed from the
+`Github repo <https://github.com/gvlproject/cloudbridge>`_::
 
     $ git clone https://github.com/gvlproject/cloudbridge.git
     $ cd cloudbridge
     $ python setup.py install
 
-**Developer installation**::
+Developer installation
+----------------------
+To install additional libraries required by CloudBridge contributors, such as
+`tox <https://tox.readthedocs.org/en/latest/>`_, run the following command::
 
     pip install cloudbridge[dev]
 
-This will install additional libraries required by CloudBridge contributors, such as tox.
+----------
 
-**Prerequisites**: CloudBridge runs on Python 2.7 and higher. Python 3 is recommended.
+To check what version of the library you have installed, do the following::
 
+    import cloudbridge
+    cloudbridge.get_version()