Skip to content

Commit

Permalink
Added contributor's guide, updated links, install guide.
Browse files Browse the repository at this point in the history
  • Loading branch information
dotsdl committed Mar 23, 2016
1 parent f97eb20 commit a11f059
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 24 deletions.
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ Contributing
This project is still under heavy development, and there are certainly rough
edges and bugs. Issues and pull requests welcome!

Check out our `contributor's guide`_
if you learn how to get started with contributing back.

.. _`contributor's guide`: https://github.com/datreant/datreant/wiki/Contributing
Check out our `contributor's guide`_ to learn how to get started with
contributing back.

.. _`contributor's guide`: http://datreant.readthedocs.org/en/develop/contributing.html

.. |docs| image:: https://readthedocs.org/projects/datreant/badge/?version=develop
:alt: Documentation Status
Expand Down
72 changes: 72 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@

.. _Contributing:

========================
Contributing to datreant
========================
**datreant** is an open-source project, with its development driven by the needs
of its users. Anyone is welcome to contribute to any of its packages, which
can all be found under the `datreant <https://github.com/datreant>`_ GitHub
organization.

Development model
=================
datreant subpackages follow the `development model outlined by Vincent
Driessen <http://nvie.com/posts/a-successful-git-branching-model/>`_ , with the
``develop`` branch being the unstable focal point for development. The
``master`` branch merges from the develop branch only when all tests are
passing, and usually only before a release. In general, master should be usable
at all times, while develop may be broken at any particular moment.

.. _Development_env:

Setting up your development environment
=======================================
We recommend using `virtual environments
<https://pypi.python.org/pypi/virtualenv>`_ with `virtualenvwrapper
<http://virtualenvwrapper.readthedocs.org/en/latest/>`_. Since
datreant is a collection of subpackages, you will need to clone
whichever repositories you are interested in contributing to. Since all
datreant subpackages depend on `datreant.core
<https://github.com/datreant/datreant.core>`_, you will probably want to clone
this one::

git clone git@github.com:datreant/datreant.core.git

Make a new virtualenv called ``datreant`` with::

mkvirtualenv datreant

and make a development installation of ``datreant.core`` with::

cd datreant.core
pip install -e .

The ``-e`` flag will cause pip to call setup with the ``develop`` option. This
means that any changes on the source code will immediately be reflected in your
virtual environment.

Repeat the same operations for any other datreant subpackage you wish to work
on. Note that other subpackages are likely to have heavier dependencies.

Running the tests locally
=========================
As you work on a datreant subpackage, it's important to see how your changes
affected its expected behavior. With your virtualenv enabled::

workon datreant

switch to the top-level directory of the subpackage you are working on and
run::

py.test --cov src/ --pep8 src/
This will run all the tests for that subpackage (often inside
``src/datreant/<subpackage_name>/tests``), with `coverage
<https://pypi.python.org/pypi/pytest-cov>`_ and `PEP8
<https://pypi.python.org/pypi/pytest-pep8>`_ checks.

Note that to run the tests you will need to install ``py.test`` and the
coverage and PEP8 plugins into your virtualenv::

pip install py.test pytest pytest-cov pytest-pep8
19 changes: 8 additions & 11 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,11 @@ the project, clone the repository to your local machine with::
git clone https://github.com/datreant/datreant.core.git


Dependencies
============
The dependencies of ``datreant.core`` are light, with many being pure-Python
packages themselves.


Contributing
============
This project is still under heavy development, and there are certainly rough
edges and bugs. Issues and pull requests welcome!
edges and bugs. Issues and pull requests welcome! See :ref:`Contributing`
for more information.

--------------------------------------------------------------------------------

Expand All @@ -84,11 +79,13 @@ edges and bugs. Issues and pull requests welcome!
groups
api

.. .. toctree::
.. :maxdepth: 1
.. toctree::
:maxdepth: 1
:caption: For Developers
limbs-treelimbs
agglimbs-aggtreelimbs

contributing
.. limbs-treelimbs
.. agglimbs-aggtreelimbs
.. toctree::
Expand Down
48 changes: 39 additions & 9 deletions docs/install.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
========================
Installing datreant.core
========================
There are no official releases of datreant yet, but the master branch on GitHub
gives the most current state of the package.
You can install ``datreant.core`` from `PyPI <https://pypi.python.org/>`_ using pip::

.. note:: Python 2.7 or above is required for all datreant packages.
pip install datreant.core

It is also possible to use ``--user`` to install into your user Python
site-packages directory::

pip install --user datreant.core

All datreant packages currently support the following Python versions::

- 2.7
- 3.3
- 3.4
- 3.5


Dependencies
============
The dependencies of ``datreant.core`` are light, with many being pure-Python
packages themselves. The current dependencies are::

- asciitree
- pathlib
- scandir
- six
- fuzzywuzzy

These are automatically installed when installing ``datreant.core``.

Installing from source
======================

To install from source, clone the repository and switch to the master branch ::

Expand All @@ -14,12 +42,14 @@ To install from source, clone the repository and switch to the master branch ::

Installation of the packages is as simple as ::

python setup.py install
pip install .

This installs datreant in the system wide python directory; this may require
administrative privileges.
administrative privileges. If you have a virtualenv active, it will install the
package within your virtualenv. See :ref:`Development_env` for more on setting
up a proper development environment.

It is also possible to use ``--user`` to install into your user's site-packages
directory::

It is also possible to use ``--prefix``, ``--home``, or ``--user`` options for
setup.py to install in a different (probably your local user) Python
site-packages directory. ``python setup.py install --help`` should show you
your options.
pip install --user -e .

0 comments on commit a11f059

Please sign in to comment.