|
1 |
| -Contributing to ``pycodestyle`` |
2 |
| -=============================== |
| 1 | +Contributing to pycodestyle |
| 2 | +=========================== |
3 | 3 |
|
4 |
| -Please see the `developer notes <https://pycodestyle.readthedocs.io/en/latest/developer.html>`_ |
| 4 | +When contributing to pycodestyle, please observe our `Code of Conduct`_. |
| 5 | + |
| 6 | +Step 1: Forking pycodestyle for editing |
| 7 | +--------------------------------------- |
| 8 | + |
| 9 | +Fork the pycodestyle repository on GitHub. This will add |
| 10 | +pycodestyle to your GitHub account. You will push your changes to your |
| 11 | +fork and then make pull requests into the official pycodestyle repository. |
| 12 | + |
| 13 | +GitHub has an excellent `guide`_ that has screenshots on how to do this. |
| 14 | + |
| 15 | +Next, clone your fork of the pycodestyle repository to your system for |
| 16 | +editing:: |
| 17 | + |
| 18 | + $ git clone https://www.github.com/<your_username>/pycodestyle |
| 19 | + |
| 20 | +Now you have a copy of the pycodestyle codebase that is almost ready for |
| 21 | +edits. Next we will setup `virtualenv`_ which will help create an isolated |
| 22 | +environment to manage dependancies. |
| 23 | + |
| 24 | + |
| 25 | +Step 2: Use virtualenv when developing |
| 26 | +-------------------------------------- |
| 27 | + |
| 28 | +`virtualenv`_ is a tool to create isolated python environments. |
| 29 | +First, install virtualenv with:: |
| 30 | + |
| 31 | + $ pip install virtualenv |
| 32 | + |
| 33 | +Next, ``cd`` to the pycodestyle repository that you cloned earlier and |
| 34 | +create, then activate a virtualenv:: |
| 35 | + |
| 36 | + $ cd pycodestyle |
| 37 | + $ virtualenv pycodestyle-venv |
| 38 | + $ source pycodestyle-venv/bin/activate |
| 39 | + |
| 40 | +Now you can install the pycodestyle requirements:: |
| 41 | + |
| 42 | + $ pip install -r dev-requirements.txt |
| 43 | + |
| 44 | +To deactivate the virtualenv you can type:: |
| 45 | + |
| 46 | + $ deactivate |
| 47 | + |
| 48 | +For more information see `virtualenv`_'s documentation. |
| 49 | + |
| 50 | + |
| 51 | +Step 3: Run tests |
| 52 | +----------------- |
| 53 | + |
| 54 | +Before creating a pull request you should run the tests to make sure that the |
| 55 | +changes that have been made haven't caused any regressions in functionality. |
| 56 | +To run the tests, the core developer team and Travis-CI use `tox`_:: |
| 57 | + |
| 58 | + $ pip install -r dev-requirements.txt |
| 59 | + $ tox |
| 60 | + |
| 61 | +All the tests should pass for all available interpreters, with the summary of:: |
| 62 | + |
| 63 | + congratulations :) |
| 64 | + |
| 65 | +At this point you can create a pull request back to the official pycodestyles |
| 66 | +repository for review! For more information on how to make a pull request, |
| 67 | +GitHub has an excellent `guide`_. |
| 68 | + |
| 69 | +.. _virtualenv: http://docs.python-guide.org/en/latest/dev/virtualenvs/ |
| 70 | +.. _guide: https://guides.github.com/activities/forking/ |
| 71 | +.. _tox: https://tox.readthedocs.io/en/latest/ |
| 72 | +.. _Code of Conduct: http://meta.pycqa.org/en/latest/code-of-conduct.html |
0 commit comments