Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update contributing docs to be more explicit #188

Merged
merged 4 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ sygnal.pid
sygnal.db
_trial_temp*

/venv/
/.venv/
/.idea
/.eggs
/*.egg-info
Expand Down
62 changes: 54 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,59 @@
# Contributing code to Sygnal

Everyone is welcome to contribute code to [matrix.org
projects](https://github.com/matrix-org), provided that they are willing to
license their contributions under the same license as the project itself. We
follow a simple 'inbound=outbound' model for contributions: the act of
submitting an 'inbound' contribution means that the contributor agrees to
license the code under the same terms as the project's overall 'outbound'
license - in our case, this is almost always Apache Software License v2 (see
[LICENSE](LICENSE)).
Everyone is welcome to contribute code to Sygnal, provided you are willing to
license your contributions under the same license as the project itself. In
this case, the [Apache Software License v2](LICENSE).

## Preparing your development environment

### Create a virtualenv

To contribute to Sygnal, ensure you have Python 3.7 or newer and then run:

```
python3 -m venv venv
./venv/bin/pip install -e .
./venv/bin/pip install -U black flake8 isort mypy mypy-zope tox
```

This creates an isolated virtual Python environment ("virtualenv") just for
use with Sygnal, then installs Sygnal along with its dependencies, and lastly
installs a handful of useful tools

Finally, activate the virtualenv by running:

```
source ./venv/bin/activate
```

Be sure to do this _every time_ you open a new terminal window for working on
Sygnal. Activating the venv ensures that any Python commands you run (`pip`,
`python`, etc.) use the versions inside your venv, and not your system Python.

When you're done, you can close your terminal or run `deactivate` to disable
the virtualenv.

### Run the tests

To make sure everything is working as expected, run the unit tests:

```
tox -e py
```

If you see a message like:

```
-------------------------------------------------------------------------------
Ran 46 tests in 0.209s

PASSED (successes=46)
___________________________________ summary ___________________________________
py: commands succeeded
congratulations :)
```

Then all is well and you're ready to work!

## How to contribute

Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ https://matrix.org/docs/spec/push_gateway/r0.1.0
describes the protocol that Matrix Home Servers use to send notifications to Push Gateways such as Sygnal.


Contributing
============
Looking to contribute to Sygnal? See `CONTRIBUTING.md <CONTRIBUTING.md>`_


Setup
=====
Sygnal is configured through a YAML configuration file.
Expand Down
1 change: 1 addition & 0 deletions changelog.d/187.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make CONTIBUTING.md more explicit about how to get tests passing.