django-axes/docs/9_development.rst

47 lines
1.4 KiB
ReStructuredText
Raw Normal View History

2019-04-27 14:55:28 +00:00
.. _development:
2019-05-01 15:28:29 +00:00
Development
===========
2019-04-27 14:55:28 +00:00
You can contribute to this project forking it from GitHub and sending pull requests.
2019-05-01 15:28:29 +00:00
First `fork <https://help.github.com/en/articles/fork-a-repo>`_ the
`repository <https://github.com/jazzband/django-axes>`_ and then clone it::
2019-04-27 14:55:28 +00:00
2019-05-01 15:28:29 +00:00
$ git clone git@github.com:<you>/django-axes.git
2019-04-27 14:55:28 +00:00
2019-05-01 15:28:29 +00:00
Initialize a virtual environment for development purposes::
2019-04-27 14:55:28 +00:00
2019-05-01 15:28:29 +00:00
$ mkdir -p ~/.virtualenvs
2019-04-27 14:55:28 +00:00
$ python3 -m venv ~/.virtualenvs/django-axes
2019-05-01 15:28:29 +00:00
$ source ~/.virtualenvs/django-axes/bin/activate
Then install the necessary requirements::
$ cd django-axes
2019-04-27 14:55:28 +00:00
$ pip install -r requirements.txt
2019-05-01 15:28:29 +00:00
Unit tests are located in the ``axes/tests`` folder and can be easily run with the pytest tool::
2019-04-27 14:55:28 +00:00
$ pytest
Prospector runs a number of source code style, safety, and complexity checks::
$ prospector
Mypy runs static typing checks to verify the source code type annotations and correctness::
$ mypy .
2019-05-01 15:28:29 +00:00
Before committing, you can run all the above tests against all supported Python and Django versions with tox::
2019-04-27 14:55:28 +00:00
$ tox
2019-05-01 15:28:29 +00:00
Tox runs the same test set that is run by Travis, and your code should be good to go if it passes.
If you wish to limit the testing to specific environment(s), you can parametrize the tox run::
$ tox -e py37-django21
2019-04-27 14:55:28 +00:00
2019-05-01 15:28:29 +00:00
After you have pushed your changes, open a pull request on GitHub for getting your code upstreamed.