| 1 |
========================== |
| 2 |
Contributing to jsonpickle |
| 3 |
========================== |
| 4 |
|
| 5 |
We welcome contributions from everyone. Please fork jsonpickle on |
| 6 |
`github <http://github.com/jsonpickle/jsonpickle>`_. |
| 7 |
|
| 8 |
Get the Code |
| 9 |
============ |
| 10 |
|
| 11 |
.. _jsonpickle-contrib-checkout: |
| 12 |
|
| 13 |
:: |
| 14 |
|
| 15 |
git clone https://github.com/jsonpickle/jsonpickle.git |
| 16 |
|
| 17 |
Run the Test Suite |
| 18 |
================== |
| 19 |
|
| 20 |
All tests should pass before before code is merged into the main repository. |
| 21 |
If you are contributing an addition or a change in behavior, we ask that you |
| 22 |
document the change in the form of test cases. |
| 23 |
|
| 24 |
.. _tox: https://tox.readthedocs.io/ |
| 25 |
|
| 26 |
The test suite is most readily run with the `tox`_ testing tool. |
| 27 |
Once installed, run the test suite against the default Python:: |
| 28 |
|
| 29 |
tox |
| 30 |
|
| 31 |
It is recommended that you install at least one Python2 and one Python3 |
| 32 |
interpreter for use by tox_. To test against Python 2.7 and 3.7:: |
| 33 |
|
| 34 |
tox -e py27,py37 |
| 35 |
|
| 36 |
The jsonpickle test suite uses several JSON encoding libraries as well as |
| 37 |
several libraries for sample objects. To create an environment to test |
| 38 |
against these libs:: |
| 39 |
|
| 40 |
tox -e libs |
| 41 |
|
| 42 |
To test against these libs on Python 3.7:: |
| 43 |
|
| 44 |
tox -e py37-libs |
| 45 |
|
| 46 |
To create the environment without running tests:: |
| 47 |
|
| 48 |
tox -e libs --notest |
| 49 |
|
| 50 |
Now you may experiment and interact with jsonpickle under development |
| 51 |
from the virtualenv at ``.tox/libs/{bin/Scripts}/python``. |
| 52 |
|
| 53 |
|
| 54 |
Generate Documentation |
| 55 |
====================== |
| 56 |
|
| 57 |
Generating the documentation_ is not necessary when contributing. |
| 58 |
To build the docs:: |
| 59 |
|
| 60 |
tox -e docs |
| 61 |
|
| 62 |
Now docs are available in ``build/html``. |
| 63 |
|
| 64 |
If you wish to browse the documentation, use Python's :mod:`http.server` |
| 65 |
to host them at http://localhost:8000:: |
| 66 |
|
| 67 |
python -m http.server -d build/html |
| 68 |
|
| 69 |
.. _documentation: http://jsonpickle.github.com |
| 70 |
.. _Sphinx: http://sphinx.pocoo.org |