the big merge
[nepi.git] / setup.py
index ef584b0..235743d 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,8 @@
 from distutils.core import setup
 import sys
 
+PY2 = sys.version_info[0] == 2
+
 with open('VERSION') as f:
     version_tag = f.read().strip()
 with open("COPYING") as f:
@@ -12,6 +14,22 @@ with open("README") as f:
 
 data_files = [ ('/etc/nepi', [ 'VERSION', 'COPYING', 'README' ] ) ]
 
+### requirements - used by pip install
+required_modules = [ ]
+   # we are now using six for a portable code
+required_modules.append('six')
+   # ipaddr in py2 used to be a separate lib
+   # within recent py3, it is now in standard library but named ipaddress
+if PY2:
+    required_modules.append('ipaddr')
+   # this is required regardless of the python version
+required_modules.append('networkx')
+   # refrain from mentioning these ones that are not exactly crucial
+   # and that have additional, non-python, dependencies
+   # that can easily break the whole install
+#required_modules.append('matplotlib')
+#required_modules.append('pygraphviz')
+
 setup(
     name             = "nepi",
     version          = version_tag,
@@ -53,13 +71,5 @@ setup(
         "nepi.resources.linux" : [ "scripts/*.py" ],
         "nepi.resources.linux.ns3" : [ "dependencies/*.tar.gz" ]
     },
-    install_requires = [
-        "ipaddr",
-        "networkx",
-        # refrain from mentioning these ones that are not exactly crucial
-        # and that have additional, non-python, dependencies
-        # that can easily break the whole install
-        # "matplotlib",
-        # "pygraphviz",
-        ]
+    install_requires = required_modules,
 )