Development Guidelines ====================== This page is intended for developers of Zipline, people who want to contribute to the Zipline codebase or documentation, or people who want to install from source and make local changes to their copy of Zipline. All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome. We `track issues`__ on `GitHub`__ and also have a `mailing list`__ where you can ask questions. __ https://github.com/quantopian/zipline/issues __ https://github.com/ __ https://groups.google.com/forum/#!forum/zipline Creating a Development Environment ---------------------------------- See the install page of this documentation or the README.rst file on the github homepage for this repo for most installation instructions for development. Finally, you can build the C extensions by running: .. code-block:: bash $ python setup.py build_ext --inplace To finish, make sure `tests`__ pass. __ #style-guide-running-tests If you get an error running nosetests after setting up a conda environment, please try running .. code-block:: bash # where hca is the name of your conda env $ conda deactivate hca $ conda activate hca Development with Docker ----------------------- If you want to work with zipline using a `Docker`__ container, you'll need to build the ``Dockerfile`` in the Zipline root directory, and then build ``Dockerfile-dev``. Instructions for building both containers can be found in ``Dockerfile`` and ``Dockerfile-dev``, respectively. __ https://docs.docker.com/get-started/ Style Guide & Running Tests --------------------------- We use `flake8`__ for checking style requirements and `nosetests`__ to run Zipline tests. Our `continuous integration`__ tools will run these commands. __ http://flake8.pycqa.org/en/latest/ __ http://nose.readthedocs.io/en/latest/ __ https://en.wikipedia.org/wiki/Continuous_integration Before submitting patches or pull requests, please ensure that your changes pass when running: .. code-block:: bash $ flake8 zipline tests In order to run tests locally, you'll need `TA-lib`__, which you can install on Linux by running: __ https://mrjbq7.github.io/ta-lib/install.html .. code-block:: bash $ wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz $ tar -xvzf ta-lib-0.4.0-src.tar.gz $ cd ta-lib/ $ ./configure --prefix=/usr $ make $ sudo make install You should now be free to run tests: .. code-block:: bash $ nosetests Continuous Integration ---------------------- TBD Contributing to the Docs ------------------------ If you'd like to contribute to the documentation, send us a message or a pull-request, and we'll incorporate in your changes. We use `Sphinx`__ to generate documentation for Zipline., which you will need to install by running: __ http://www.sphinx-doc.org/en/stable/ .. code-block:: bash $ pip install -r ./etc/requirements_docs.txt To build and view the docs locally, run: .. code-block:: bash # assuming you're in the Zipline root directory $ cd docs $ make html $ {BROWSER} build/html/index.html Formatting Docstrings --------------------- When adding or editing docstrings for classes, functions, etc, we use `numpy`__ as the canonical reference. __ https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt Updating the Whatsnew --------------------- We have a set of `whatsnew `__ files that are used for documenting changes that have occurred between different versions of Zipline. Once you've made a change to Zipline, in your Pull Request, please update the most recent ``whatsnew`` file with a comment about what you changed. You can find examples in previous ``whatsnew`` files.