2016-10-14 12:51:08 +01:00
# How to contribute to Sanic
2016-10-14 11:23:48 +01:00
Thank you for your interest!
2016-10-29 19:39:12 +01:00
## Setting up the dev environment
It is ideal to create a virtual environment whenever you want to work on
a python project. **Note:** This is not a necessity to work on sanic.
Create a a new virtual environment if you dont have one, using:
`python3 -m venv <any name>`
Enable it using:
`. <any name>/bin/activate`
Get the source of sanic:
`git clone https://github.com/channelcat/sanic`
`cd sanic`
Install sanic :
2016-12-27 09:46:01 +00:00
`python setup.py install develop`
OR
`pip install -e .`
2016-10-29 19:39:12 +01:00
Install the dev dependencies:
`pip install -r requirements-dev.txt`
Create a new branch for your bugfix or feature:
`git checkout -b <branch name>`
Now you can start working on sanic.
## Tests
2016-12-27 09:46:01 +00:00
Install pytest and flake8 or tox:
2016-10-29 19:39:12 +01:00
`pip install pytest`
2016-12-27 09:46:01 +00:00
`pip install flake8` or `pip install tox`
2016-10-29 19:39:12 +01:00
Run the tests:
`pytest tests`
Ensure your code is properly linted using flake8:
`flake8 sanic/`
## Pull request
Once all tests have passed send out a PR.
2016-10-14 11:23:48 +01:00
2016-10-14 12:51:08 +01:00
## Warning
2016-12-27 09:46:01 +00:00
One of the main goals of Sanic is speed. Sanic uses `wrk` tool for benchmarking purposes. Code that lowers the performance of Sanic without significant gains in usability, security, or features may not be merged.