Dmitry Frenkel | 63f97f3 | 2020-07-09 10:14:02 -0700 | [diff] [blame] | 1 | How to Contribute |
| 2 | ================= |
| 3 | |
| 4 | We'd love to accept your patches and contributions to this project. |
| 5 | There are a few guidelines described in our |
| 6 | `Contribution Guide <http://google.github.io/google-api-python-client/contributing.html>`__ |
| 7 | that you need to follow. |
| 8 | |
| 9 | To summarize here: when contributing, please: |
| 10 | |
| 11 | * Sign Contributor License Agreement |
| 12 | * Before making changes, file an issue |
| 13 | * Fork this repository and use github pull requests for all submissions |
| 14 | * Follow |
| 15 | `Contributor Code of Conduct |
| 16 | <https://github.com/googleapis/google-api-python-client/blob/master/CODE_OF_CONDUCT.md>`__ |
| 17 | and `Community Guidelines <https://opensource.google/conduct/>`__ |
| 18 | * Follow `Google Python Style Guide <https://google.github.io/styleguide/pyguide.html>`__ |
| 19 | and `this commit authoring style <http://chris.beams.io/posts/git-commit/#seven-rules>`__ |
| 20 | * Don't forget to write tests and update documentation! |
| 21 | |
| 22 | Setup Notes |
| 23 | ----------- |
| 24 | |
| 25 | Please follow these steps after forking and cloning the repository |
| 26 | to make sure you can modify code and run tests with confidence:: |
| 27 | |
| 28 | # From the root dir of the cloned repository: |
| 29 | # Create Virtual Environment called env (you may choose your own name) |
| 30 | python3 -m venv env |
| 31 | |
| 32 | # Activate virtual environment |
| 33 | source env/bin/activate |
| 34 | |
| 35 | # Install this library as editable install |
| 36 | # (see https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption-e) |
| 37 | python3 -m pip install -e . |
| 38 | |
| 39 | # Install nox |
| 40 | python3 -m pip install nox |
| 41 | |
| 42 | We use `nox <https://nox.thea.codes/>`__ to instrument our tests. |
| 43 | To test your changes, run unit tests with ``nox``:: |
| 44 | |
| 45 | # Run tests for all supported versions of Python and oauth2client: |
| 46 | nox |
| 47 | # Run tests for Python 3.7: |
| 48 | nox -s unit-3.7 |
| 49 | # Run lint |
| 50 | nox -s lint |
| 51 | |
| 52 | |
| 53 | .. note:: |
| 54 | |
| 55 | The unit tests and system tests are described in the |
| 56 | ``noxfile.py`` file in this directory. Nox will automatically |
| 57 | handle constriction of new virtual environments and installation |
| 58 | of the required test dependencies. |
| 59 | |
| 60 | For more information about Nox, including command-line usage, consult |
| 61 | `nox documentation <https://nox.thea.codes/>`__. |