diff options
author | ysitu <ysitu@users.noreply.github.com> | 2014-06-04 08:29:45 -0400 |
---|---|---|
committer | ysitu <ysitu@users.noreply.github.com> | 2014-06-04 08:29:45 -0400 |
commit | e6dd47220a99ec8bc227f08cee02ed59d1f0cc2c (patch) | |
tree | 240a525b5946dda4cce574d83a9ad287809be220 | |
parent | 39718a64f3da91929b83f68ade50a5ea21e5b26e (diff) | |
parent | 5579d9dcb069554aa7354a53f31dc34119fdc4ac (diff) | |
download | networkx-e6dd47220a99ec8bc227f08cee02ed59d1f0cc2c.tar.gz |
Merge pull request #1191 from ysitu/setup
Remove setup_egg.py
-rw-r--r-- | doc/source/install.rst | 45 | ||||
-rw-r--r-- | setup.py | 29 | ||||
-rwxr-xr-x | setup_egg.py | 57 |
3 files changed, 47 insertions, 84 deletions
diff --git a/doc/source/install.rst b/doc/source/install.rst index 9828cb21..2d3963e5 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -2,24 +2,31 @@ Installing ********** +Before installing NetworkX, you need to have +`setuptools <https://pypi.python.org/pypi/setuptools>`_ installed. + Quick install ============= Get NetworkX from the Python Package Index at http://pypi.python.org/pypi/networkx -or install it with:: +or install it with + +:: pip install networkx and an attempt will be made to find and install an appropriate version that matches your operating system and Python version. -You can install the development version (at github.com) with:: +You can install the development version (at github.com) with + +:: pip install git://github.com/networkx/networkx.git#egg=networkx -More download file options are at http://networkx.github.io/download.html +More download file options are at http://networkx.github.io/download.html. Installing from source ====================== @@ -42,12 +49,13 @@ Source archive file 2. Unpack and change directory to the source directory (it should have the files README.txt and setup.py). - 3. Run "python setup.py install" to build and install + 3. Run :samp:`python setup.py install` to build and install - 4. (optional) Run "python setup_egg.py nosetests" to execute the tests + 4. (Optional) Run :samp:`nosetests` to execute the tests if you have + `nose <https://pypi.python.org/pypi/nose>`_ installed. -Github +GitHub ------ 1. Clone the networkx repostitory @@ -56,30 +64,39 @@ Github (see https://github.com/networkx/networkx/ for other options) - 2. Change directory to "networkx" + 2. Change directory to :samp:`networkx` - 3. Run "python setup.py install" to build and install + 3. Run :samp:`python setup.py install` to build and install - 4. (optional) Run "python setup_egg.py nosetests" to execute the tests + 4. (Optional) Run :samp:`nosetests` to execute the tests if you have + `nose <https://pypi.python.org/pypi/nose>`_ installed. If you don't have permission to install software on your system, you can install into another directory using -the --user, --prefix, or --home flags to setup.py. +the :samp:`--user`, :samp:`--prefix`, or :samp:`--home` flags to setup.py. For example :: python setup.py install --prefix=/home/username/python - or + +or + +:: + python setup.py install --home=~ - or + +or + +:: + python setup.py install --user If you didn't install in the standard Python site-packages directory you will need to set your PYTHONPATH variable to the alternate location. -Seehttp://docs.python.org/2/install/index.html#search-path for further details. +See http://docs.python.org/2/install/index.html#search-path for further details. Requirements @@ -96,7 +113,7 @@ The easiest way to get Python and most optional packages is to install the Enthought Python distribution "Canopy" https://www.enthought.com/products/canopy/ -There are several other distributions that contain the key packages you need for scientific computing. See the following link for a list: http://scipy.org/install.html +There are several other distributions that contain the key packages you need for scientific computing. See http://scipy.org/install.html for a list. Optional packages @@ -5,14 +5,15 @@ Setup script for networkx You can install networkx with -python setup_egg.py install +python setup.py install """ from glob import glob import os import sys -if os.path.exists('MANIFEST'): os.remove('MANIFEST') +if os.path.exists('MANIFEST'): + os.remove('MANIFEST') -from distutils.core import setup +from setuptools import setup if sys.argv[-1] == 'setup.py': print("To install, run 'python setup.py install'") @@ -70,13 +71,13 @@ for d in ['advanced', 'multigraph', 'pygraphviz', 'readwrite']: - dd=os.path.join(docdirbase,'examples',d) - pp=os.path.join('examples',d) - data.append((dd,glob(os.path.join(pp,"*.py")))) - data.append((dd,glob(os.path.join(pp,"*.bz2")))) - data.append((dd,glob(os.path.join(pp,"*.gz")))) - data.append((dd,glob(os.path.join(pp,"*.mbox")))) - data.append((dd,glob(os.path.join(pp,"*.edgelist")))) + dd = os.path.join(docdirbase,'examples', d) + pp = os.path.join('examples', d) + data.append((dd, glob(os.path.join(pp ,"*.py")))) + data.append((dd, glob(os.path.join(pp ,"*.bz2")))) + data.append((dd, glob(os.path.join(pp ,"*.gz")))) + data.append((dd, glob(os.path.join(pp ,"*.mbox")))) + data.append((dd, glob(os.path.join(pp ,"*.edgelist")))) # add the tests package_data = { @@ -130,6 +131,8 @@ if __name__ == "__main__": packages = packages, data_files = data, package_data = package_data, - install_requires = install_requires - ) - + install_requires = install_requires, + test_suite = 'nose.collector', + tests_require = ['nose>=0.10.1'], + zip_safe = False + ) diff --git a/setup_egg.py b/setup_egg.py deleted file mode 100755 index 924eacfe..00000000 --- a/setup_egg.py +++ /dev/null @@ -1,57 +0,0 @@ - -#!/usr/bin/env python -""" -An alternate setup.py script that uses setuptools. - -You can install networkx with - -python setup_egg.py install - -If you have setuptools and run this as - -python setup_egg.py bdist_egg - -you will get a Python egg. - -Use - -python setup_egg.py nosetests - -to run the tests. - - -""" -# local import, might need modification for 2.6/3.0 -from setup import * - -# must occur after local import to override distutils.core.setup -from setuptools import setup - - -if __name__ == "__main__": - - setup( - name = release.name.lower(), - version = version, - maintainer = release.maintainer, - maintainer_email = release.maintainer_email, - author = release.authors['Hagberg'][0], - author_email = release.authors['Hagberg'][1], - description = release.description, - keywords = release.keywords, - long_description = release.long_description, - license = release.license, - platforms = release.platforms, - url = release.url, - download_url = release.download_url, - classifiers = release.classifiers, - packages = packages, - data_files = data, - package_data = package_data, - install_requires=['setuptools'], - test_suite = 'nose.collector', - tests_require = ['nose >= 0.10.1'] , - zip_safe = False - ) - - |