X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=setup.py;h=a252096674ff852151fb15d281bb3bd6aa4fa828;hb=ddb5d7e50ffef50b41186199de2a9b6b21850bf8;hp=c4311b495732d848978293401dab754f4590cb8b;hpb=7137010b13dcede2f6efcff0be902e1676b40144;p=nepi.git diff --git a/setup.py b/setup.py index c4311b49..a2520966 100755 --- a/setup.py +++ b/setup.py @@ -1,16 +1,40 @@ #!/usr/bin/env python from distutils.core import setup + +# python2 or python3 ? import sys +PY2 = sys.version_info[0] == 2 + +# read version +# while cleaning up version.py might just not be there +try: + from nepi.util.version import version_tag +except: + version_tag = 'cleaningup' -with open('VERSION') as f: - version_tag = f.read().strip() +### NOTE: these 2 files are made available at install-time in MANIFEST.in +# read licence info with open("COPYING") as f: license = f.read() -with open("README") as f: +with open("README.md") as f: long_description = f.read() -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", @@ -23,8 +47,6 @@ setup( download_url = "http://build.onelab.eu/nepi/nepi-{v}.tar.gz".format(v=version_tag), url = "http://nepi.inria.fr/", platforms = "Linux, OSX", - data_files = data_files, - package_dir = {"": "src"}, packages = [ "nepi", "nepi.execution", @@ -53,10 +75,5 @@ setup( "nepi.resources.linux" : [ "scripts/*.py" ], "nepi.resources.linux.ns3" : [ "dependencies/*.tar.gz" ] }, - install_requires = [ - "ipaddr", - "networkx", - "pygraphviz", - "matplotlib", - ] + install_requires = required_modules, )