2. Setting Up the Code for Local Development¶
Here’s how to set up Cohen3 for local development.
Fork the Cohen3 repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/Cohen3.git
Install your local copy into a virtualenv. Assuming you have pyenv installed, this is how you set up your fork for local development:
$ CONFIGURE_OPTS=--enable-shared pyenv install 3.7-dev $ CONFIGURE_OPTS=--enable-shared pyenv virtualenv 3.7-dev cohen3 $ cd Cohen3/ $ pyenv activate cohen3 $ pip install pipenv $ pipenv install $ pip install -e .[dev]
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
When you’re done making changes, check that your changes pass the tests:
$ pycodestyle coherence --statistics --ignore=E402 $ pylint -E coherence --rcfile=.pylintrc $ nosetests --with-coverage --cover-erase --cover-package=coherence --cover-html
Check that the test coverage hasn’t dropped:
The last command of the above point (nosetests), will print a report at the end of the tests (or you can check the results via your web browser: check the created folder “cover” and visualize the index.htm file for a nice report). Check that coverage percent against the coverage before the changes you made.
- Note
You also can check the coverage once you submitted the pull requests and travis tests are done (but this, probably, it will be slower than do it manually from your os, because you can skip some steps that travis cannot skip).
Commit your changes and push your branch to GitHub:
$ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.