1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
.. _contributring:
How to contribute
=================
All contributions are greatly appreciated!
How to report issues
~~~~~~~~~~~~~~~~~~~~
Facilitating the work of potential contributors is recommended since it
increases the likelihood of your issue being solved quickly. The few extra
steps listed below will help clarify problems you might be facing:
- Include a `minimal reproducible example`_ when possible.
- Describe the expected behaviour and what actually happened including a full
trace-back in case of exceptions.
- Make sure to list details about your environment, such as your platform,
versions of pytest, pytest-xprocess and python release.
Also, it's important to check the current open issues for similar reports
in order to avoid duplicates.
.. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example
Setting up your development environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Fork pytest-xprocess to your GitHub account by clicking the `Fork`_ button.
- `Clone`_ the main repository (not your fork) to your local machine.
.. code-block:: text
$ git clone https://github.com/pytest-dev/pytest-xprocess
$ cd pytest-xprocess
- Add your fork as a remote to push your contributions.Replace
``{username}`` with your username.
.. code-block:: text
git remote add fork https://github.com/{username}/pytest-xprocess
- Using `Tox`_, create a virtual environment and install xprocess in editable mode with development dependencies.
.. code-block:: text
$ tox -e dev
$ source venv/bin/activate
- Install pre-commit hooks
.. code-block:: text
$ pre-commit install
.. _Fork: https://github.com/pytest-dev/pytest-xprocess/fork
.. _Clone: https://help.github.com/en/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork
.. _Tox: https://tox.readthedocs.io/en/latest/
Start Coding
~~~~~~~~~~~~
- Create a new branch to identify what feature you are working on.
.. code-block:: text
$ git fetch origin
$ git checkout -b your-branch-name origin/master
- Make your changes
- Include tests that cover any code changes you make and run them
as described below.
- Push your changes to your fork.
`create a pull request`_ describing your changes.
.. code-block:: text
$ git push --set-upstream fork your-branch-name
.. _create a pull request: https://help.github.com/en/articles/creating-a-pull-request
How to run tests
~~~~~~~~~~~~~~~~
You can run the test suite for the current environment with
.. code-block:: text
$ pytest
To run the full test suite for all supported python versions
.. code-block:: text
$ tox
Obs. CI will run tox when you submit your pull request, so this is optional.
Checking Test Coverage
~~~~~~~~~~~~~~~~~~~~~~~
To get a complete report of code sections not being touched by the
test suite run ``pytest`` using ``coverage``.
.. code-block:: text
$ coverage run -m pytest
$ coverage html
Open ``htmlcov/index.html`` in your browser.
More about converage `here <https://coverage.readthedocs.io>`__.
|