Skip to content

Commit

Permalink
Merge 5646dda into ca2df82
Browse files Browse the repository at this point in the history
  • Loading branch information
harryscholes committed Aug 3, 2017
2 parents ca2df82 + 5646dda commit 528a45e
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Developer overview

git checkout -b bugfix-for-issue-1480

* For more information on how to set up a development environment, refer to
the :doc:`setup guide <setup>` for developers

* Commit locally as you progress (``git add`` and ``git commit``)

3. To submit your contribution:
Expand Down
1 change: 1 addition & 0 deletions doc/developer/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Developer Guide
:maxdepth: 2

contribute
setup
gitwash/index
60 changes: 60 additions & 0 deletions doc/developer/setup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.. _setup:

.. highlight:: bash

===============================================
Guide to setting up a development environment
===============================================

This guide explains how to set up a clean development environment using
`Anaconda <https://anaconda.org/>`__ virtual environments and ``virtualenv``
environments.

Anaconda
========

First, ensure that Anaconda is installed, then fork and clone NetworkX and check
out a development branch. Now create a new Conda environment, in this case
called ``networkx_dev``::

conda create -n networkx_dev python=3

If you use Jupyter notebooks to run code during development, instead run::

conda create -n networkx_dev python=3 jupyter nb_conda

Once the environment is created, activate it::

source activate networkx_dev

Install an editable version of NetworkX and its required packages::

pip install -e .
pip install -r requirements.txt

N.B. ``gdal`` may need to be installed before installing the required packages
e.g.::

================ ============================================================
Debian / Ubuntu ``sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable``
``sudo apt-get update``
``sudo apt-get install gdal``
Fedora ``sudo dnf install gdal``
Windows Download and install a `windows binary
<http://www.gisinternals.com/release.php>`__
OS X ``brew install gdal``
================ ============================================================

If you use Jupyter notebooks to run code during development, it is very handy to
have the following in the first cell (N.B. these Juypter notebooks should not be
committed to the NetworkX repository)::

%load_ext autoreload
%autoreload 2
import networkx

Once the changes have been tested, committed and pushed, the Conda environment
can be removed by::

source deactivate networkx_dev
conda env remove -n networkx_dev

0 comments on commit 528a45e

Please sign in to comment.