Example #1
0
## Definition of useful functions
def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()


## Check problems with the setuptools
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

if sys.argv[-1] == 'setup.py':
    print("To install, run 'python setup.py install'")
    print()

version = release.write_versionfile()

packages = [
    'cooperativegames',
    'cooperativegames.measures',
    'cooperativegames.plotting_tools',
    'cooperativegames.tests',
]

docdirbase = 'share/doc/CooperativeGames-%s' % version
# add basic documentation
data = [(docdirbase, glob("*.txt"))]
# add examples
for d in ['advanced', 'algorithms']:
    dd = os.path.join(docdirbase, 'examples', d)
    pp = os.path.join('examples', d)
Example #2
0
    print()

if sys.version_info[:2] < (3, 5):
    error = """NetworkX 2.3+ requires Python 3.5 or later (%d.%d detected).
             
For Python 2.7, please install version 2.2 using:

$ pip install 'networkx==2.2'
""" % sys.version_info[:2]
    sys.stderr.write(error + "\n")
    sys.exit(1)

# Write the version information.
sys.path.insert(0, 'networkx')
import release
version = release.write_versionfile()
sys.path.pop(0)

packages = ["networkx",
            "networkx.algorithms",
            "networkx.algorithms.assortativity",
            "networkx.algorithms.bipartite",
            "networkx.algorithms.node_classification",
            "networkx.algorithms.centrality",
            "networkx.algorithms.community",
            "networkx.algorithms.components",
            "networkx.algorithms.connectivity",
            "networkx.algorithms.coloring",
            "networkx.algorithms.flow",
            "networkx.algorithms.traversal",
            "networkx.algorithms.isomorphism",