|
| 1 | +# Contributing to SigPro |
| 2 | + |
| 3 | +Here you will find a series of steps that describe how to contribute a new implementation, fix or |
| 4 | +update to `SigPro` library. |
| 5 | + |
| 6 | +## 1. Clone the repository |
| 7 | + |
| 8 | +The first step would be to clone the `SigPro` repository. In order to do so |
| 9 | +make sure that you have access to the repository by accessing it direcly |
| 10 | +[https://github.com/signals-dev/SigPro/]( |
| 11 | +https://github.com/signals-dev/SigPro/). |
| 12 | + |
| 13 | +If you have access to the repository and you have your `ssh` keys configured |
| 14 | +in your github account, you can clone it by using the following command |
| 15 | + |
| 16 | +```bash |
| 17 | +git clone [email protected]:signals-dev/SigPro.git |
| 18 | +``` |
| 19 | + |
| 20 | +If you don't have your `ssh` keys configured you can clone the repository |
| 21 | +using your login name and password running the following command: |
| 22 | + |
| 23 | +```bash |
| 24 | +git clone https://github.com/signals-dev/SigPro |
| 25 | +``` |
| 26 | + |
| 27 | +Next, you can enter your repository folder, create a virtualenv and install |
| 28 | +the project and the development dependencies. |
| 29 | +**Note**: You need to have virtualenv and virtualenvwrapper installed for |
| 30 | +these steps to work |
| 31 | + |
| 32 | +```bash |
| 33 | +cd SigPro |
| 34 | +mkvirtualenv sigpro |
| 35 | +make install-develop |
| 36 | +``` |
| 37 | + |
| 38 | +## 2. Prepare your branch |
| 39 | + |
| 40 | +Before going any further, create the new `git` branch to which you will |
| 41 | +be pushing your development. |
| 42 | + |
| 43 | +To do so, type the following command with the desired name for your branch: |
| 44 | + |
| 45 | +```bash |
| 46 | +git checkout -b <name_of_your_branch> |
| 47 | +``` |
| 48 | + |
| 49 | +Try to use the naming scheme of prefixing your branch with issue-X where X is |
| 50 | +the associated issue, such as issue-3-fix-foo-bug. And if you are not |
| 51 | +developing on your own fork, further prefix the branch with your GitHub |
| 52 | +username, like githubusername/issue-3-fix-foo-bug. |
| 53 | + |
| 54 | +## 3. Code your changes |
| 55 | + |
| 56 | +Once you have your branch ready and set, you can start coding your changes. |
| 57 | + |
| 58 | +When doing so, ensure that the code is placed in its corresponding python |
| 59 | +file, and if you think that this doesn't exist, create it in the location |
| 60 | +that you find more suitable. However, when it comes to `aggregations` and |
| 61 | +`tranformations`, those are bound to their type and subtype. |
| 62 | + |
| 63 | +Also, while hacking your changes, make sure to follow the [PEP8]( |
| 64 | +https://www.python.org/dev/peps/pep-0008/) style guide for python code |
| 65 | +and our `setup.cfg` (the main change is that we allow 99 characters per |
| 66 | +line). |
| 67 | + |
| 68 | + |
| 69 | +## 4. Test your changes |
| 70 | + |
| 71 | +Now that you have implemented your changes, make sure to cover all your |
| 72 | +developments with the required unit tests, and that none of the old tests |
| 73 | +fail as consequence of your changes. For this, make sure to run the tests |
| 74 | +suite and check the code coverage by using the following commands: |
| 75 | + |
| 76 | +```bash |
| 77 | +$ make lint # Check code styling |
| 78 | +$ make test # Run the tests |
| 79 | +$ make coverage # Get the coverage report |
| 80 | +``` |
| 81 | + |
| 82 | +Once you have finished coding your changes, make sure to run the following |
| 83 | +command to ensure that your changes pass all the styling checks and tests |
| 84 | +including other Python supported versions using: |
| 85 | + |
| 86 | +```bash |
| 87 | +$ make test-all |
| 88 | +``` |
| 89 | + |
| 90 | +## 5. Create a pull request |
| 91 | + |
| 92 | +Once you have created and tested your primitive, you can create a pull |
| 93 | +request by doing the following steps: |
| 94 | + |
| 95 | +0. (You did this previoulsy, but make sure) Create a new branch or ensure you are in the correct branch. Run the command `git branch` to see at which branch you are pointing. If you are in the desired follow the next step. |
| 96 | +1. Add the new files and the updated ones. By running `git status` you will see the modified and `new/untracked` files. Use `git add` to `add` the files that involve your implementation, such as the new primitive `json` file, the new module with the new transformation or aggregation and other changes that you may have done to existing files (such as `setup.py` if you updated or introduce a new dependency). |
| 97 | +2. Commit your changes using `git commit -m "Implement my new transformation"`. |
| 98 | +3. Push your branch: `git push --set-upstream origin <name_of_your_branch>`. |
| 99 | +4. Go to [https://github.com/signals-dev/SigPro/](https://github.com/signals-dev/SigPro/) and create a pull request from this branch to the master branch. |
0 commit comments