Development of a feature for this repository should follow the workflow described by Vincent Driessen.
Here are the minimal procedure you should follow :
Create an issue on the github repository, describing the problem you will then address with your feature/fix. This is an important step as it forces one to think about the issue (to describe an issue to others, one has to think it through first).
-
Create a separate branch from
dev
, to work ongit checkout -b feature/myfeature dev
The convention is to always have
feature/
in the branch name. Themyfeature
part should describe shortly what the feature is about (separate words with_
). -
Try to follow these conventions for commit messages:
- Keep the subject line short (i.e. do not commit more than a few changes at the time)
- Use imperative for commit messages
- Do not end the commit message with a period
You can use
to edit the commit message of your latest commit (provided it is not already pushed on the remote server). With
git commit --amend
--amend
you can even add/modify changes to the commit.
-
Push your local branch on the remote server
origin
git push
If your branch does not exist on the remote server yet, git will provide you with instructions, simply follow them.
To run tests locally, install the dependencies
pip install -r tests/test_requirements.txt
- Integration/unit tests
pytest tests
- Linting tests
and
flake8
You can fix the linting errors either manually or with the packagespylint
autopep8
orblack
for example.
Follow the steps of the github help to create the PR.
Please note that you PR should be directed from your branch (for example myfeature
) towards the branch dev
.
Add a line Fix #<number of the issue created in Step 2.0>
in the
description of your PR, so that when it is merged, it automatically
closes the issue once your code gets merged into the default branch of
your repository.
Here
is a list of other keywords you can use to automatically close the
issues
To have the test run automatically everytime you push to a pull request
you can add the bash commands under # command to run tests
of the
.travis.yml
file. For this you need to have an account by
Travis and link your repo to their service.
Soon GitHub action might take
care of this directly within github.
In the .travis.yml
file are many options commented out, you can have
very complexe schemes to test on many different python versions etc. For
more information look at Travis
doc for python.