Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 0164c26

Browse files
committed
Update contributing docs with tox/travis usage
1 parent ad3379a commit 0164c26

File tree

1 file changed

+46
-18
lines changed

1 file changed

+46
-18
lines changed

docs/contributing.rst

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,67 @@ Contributing
44
Want to contribute back to Sentry? This page describes the general development flow,
55
our philosophy, the test suite, and issue tracking.
66

7-
(Though it actually doesn't describe all of that, yet)
7+
There are many ways to you can help, either by submitting bug reports, improving the
8+
documentation, or submitting a patch. This document describes how to get the
9+
test suite running for the Python SDK.
810

911
Setting up an Environment
1012
-------------------------
1113

12-
Sentry is designed to run off of setuptools with minimal work. Because of this
13-
setting up a development environment requires only a few steps.
14+
There are several ways of setting up a development environment. If you want to ensure
15+
your changes work across all environments and integrations that Raven supports,
16+
the easiest way to run one or more jobs from test suite matrix is using a virtualenv
17+
management and test command line tool called `Tox`_,
1418

15-
The first thing you're going to want to do, is build a virtualenv and install
16-
any base dependancies.
19+
It is also recommended to have the Python versions you are targeting installed on your
20+
system. There are several tools that help you manage several Python installations,
21+
like `Pyenv`_ or `Pythonz`_, but you can also install them manually by downloading them
22+
from the Python.org website or installing them from repositories depending on your
23+
operating system.
1724

18-
::
25+
Once you have the Python versions you are going to work with, you have to install `Tox`.
26+
The easiest way of installing `Tox` is by running `pip install tox` into your
27+
default Python installation.
1928

20-
virtualenv ~/.virtualenvs/raven
21-
source ~/.virtualenvs/raven/bin/activate
22-
make
29+
Running the tests
30+
-----------------
2331

24-
That's it :)
32+
Running the tests is easy: just run `tox` from the command line and it will take care of
33+
creating all the necessary virtualenvs and running all the environments defined in the `tox.ini`
34+
file.
2535

26-
Running the Test Suite
27-
----------------------
36+
During development you might want to run only a certain environment, which can be done by
37+
passing the `-e ENV` to tox, for example:
2838

29-
The test suite is also powered off of py.test, and can be run in a number of ways. Usually though,
30-
you'll just want to use our helper method to make things easy:
39+
.. code-block:: bash
3140
32-
::
41+
$ tox -e py35-django19
3342
34-
make test
43+
which would run the Python3.5 environment and the Django integration tests with Django 1.9.
44+
You can list all the defined environments with `tox --listenvs`, or fall into the Python debugger
45+
on any raised exception by using `tox --pdb`. Please refer to the Tox Documentation for additional
46+
information.
3547

3648

3749
Contributing Back Code
3850
----------------------
3951

40-
Ideally all patches should be sent as a pull request on GitHub, and include tests. If you're fixing a bug or making a large change the patch **must** include test coverage.
52+
Ideally all patches should be sent as a pull request on GitHub, and include tests.
53+
If you're fixing a bug or making a large change the patch **must** include test coverage.
54+
55+
You can see a list of open pull requests (pending changes) by visiting our `Github Pull Request` page.
56+
Every pull requests triggers a test build on our Travis CI where you can verify that
57+
all tests pass.
58+
59+
Notes
60+
-----
61+
62+
In order to use Pyenv with Tox, create a `.python-version` file similar to the
63+
`.python-version-example` in the project root.
64+
4165

42-
You can see a list of open pull requests (pending changes) by visiting https://github.com/getsentry/raven-python/pulls
66+
.. _Sentry: https://getsentry.com
67+
.. _Github Pull Request: https://github.com/getsentry/raven-python/pulls
68+
.. _Tox: https://tox.readthedocs.io
69+
.. _Pythonz: https://github.com/saghul/pythonz
70+
.. _Pyenv: https://github.com/pyenv/pyenv

0 commit comments

Comments
 (0)