2015-02-27 18:54:17 +08:00
|
|
|
============================
|
|
|
|
Contribution getting started
|
|
|
|
============================
|
2014-01-22 18:37:02 +08:00
|
|
|
|
|
|
|
Contributions are highly welcomed and appreciated. Every little help counts,
|
|
|
|
so do not hesitate!
|
|
|
|
|
2015-02-27 18:54:17 +08:00
|
|
|
.. contents:: Contribution links
|
|
|
|
:depth: 2
|
2014-01-23 17:51:45 +08:00
|
|
|
|
2015-02-27 18:54:17 +08:00
|
|
|
|
|
|
|
.. _submitplugin:
|
|
|
|
|
|
|
|
Submit a plugin, co-develop pytest
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
Pytest development of the core, some plugins and support code happens
|
|
|
|
in repositories living under:
|
|
|
|
|
|
|
|
- `the pytest-dev github organisation <https://github.com/pytest-dev>`_
|
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
- `the pytest-dev bitbucket team <https://bitbucket.org/pytest-dev>`_
|
|
|
|
|
2015-07-26 18:07:50 +08:00
|
|
|
All pytest-dev Contributors team members have write access to all contained
|
2015-02-27 18:54:17 +08:00
|
|
|
repositories. pytest core and plugins are generally developed
|
|
|
|
using `pull requests`_ to respective repositories.
|
|
|
|
|
|
|
|
You can submit your plugin by subscribing to the `pytest-dev mail list
|
|
|
|
<https://mail.python.org/mailman/listinfo/pytest-dev>`_ and writing a
|
|
|
|
mail pointing to your existing pytest plugin repository which must have
|
|
|
|
the following:
|
|
|
|
|
2015-03-03 03:48:09 +08:00
|
|
|
- PyPI presence with a ``setup.py`` that contains a license, ``pytest-``
|
|
|
|
prefixed, version number, authors, short and long description.
|
2015-02-27 18:54:17 +08:00
|
|
|
|
|
|
|
- a ``tox.ini`` for running tests using `tox <http://tox.testrun.org>`_.
|
|
|
|
|
|
|
|
- a ``README.txt`` describing how to use the plugin and on which
|
|
|
|
platforms it runs.
|
|
|
|
|
2015-03-19 19:53:32 +08:00
|
|
|
- a ``LICENSE.txt`` file or equivalent containing the licensing
|
|
|
|
information, with matching info in ``setup.py``.
|
|
|
|
|
2015-02-27 18:54:17 +08:00
|
|
|
- an issue tracker unless you rather want to use the core ``pytest``
|
|
|
|
issue tracker.
|
|
|
|
|
|
|
|
If no contributor strongly objects and two agree, the repo will be
|
|
|
|
transferred to the ``pytest-dev`` organisation and you'll become a
|
2015-07-26 18:07:50 +08:00
|
|
|
member of the ``pytest-dev Contributors`` team, with commit rights
|
|
|
|
to all projects. We recommend that each plugin has at least three
|
|
|
|
people who have the right to release to pypi.
|
2015-02-27 18:54:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
.. _reportbugs:
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
Report bugs
|
|
|
|
-----------
|
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
Report bugs for pytest at https://github.com/pytest-dev/pytest/issues
|
2014-01-23 18:38:05 +08:00
|
|
|
|
|
|
|
If you are reporting a bug, please include:
|
|
|
|
|
|
|
|
* Your operating system name and version.
|
|
|
|
* Any details about your local setup that might be helpful in troubleshooting,
|
|
|
|
specifically Python interpreter version,
|
2014-01-23 18:42:20 +08:00
|
|
|
installed libraries and pytest version.
|
2014-01-23 18:38:05 +08:00
|
|
|
* Detailed steps to reproduce the bug.
|
|
|
|
|
2015-07-26 18:19:39 +08:00
|
|
|
If you can write a demonstration test that currently fails but should pass (xfail),
|
|
|
|
that is a very useful commit to make as well, even if you can't find how
|
|
|
|
to fix the bug yet.
|
|
|
|
|
2015-02-27 18:54:17 +08:00
|
|
|
.. _submitfeedback:
|
|
|
|
|
2014-01-22 18:37:02 +08:00
|
|
|
Submit feedback for developers
|
|
|
|
------------------------------
|
|
|
|
|
2014-01-23 18:42:20 +08:00
|
|
|
Do you like pytest? Share some love on Twitter or in your blog posts!
|
2014-01-22 18:37:02 +08:00
|
|
|
|
|
|
|
We'd also like to hear about your propositions and suggestions. Feel free to
|
2015-06-16 05:54:44 +08:00
|
|
|
`submit them as issues <https://github.com/pytest-dev/pytest/issues>`__ and:
|
2014-01-22 18:37:02 +08:00
|
|
|
|
|
|
|
* Set the "kind" to "enhancement" or "proposal" so that we can quickly find
|
|
|
|
about them.
|
|
|
|
* Explain in detail how they should work.
|
|
|
|
* Keep the scope as narrow as possible. This will make it easier to implement.
|
2014-01-23 17:21:06 +08:00
|
|
|
* If you have required skills and/or knowledge, we are very happy for
|
2014-01-25 02:21:21 +08:00
|
|
|
:ref:`pull requests <pull-requests>`.
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-02-27 18:54:17 +08:00
|
|
|
.. _fixbugs:
|
2014-01-22 18:37:02 +08:00
|
|
|
|
|
|
|
Fix bugs
|
|
|
|
--------
|
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
Look through the GitHub issues for bugs. Here is sample filter you can use:
|
|
|
|
https://github.com/pytest-dev/pytest/labels/bug
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-22 19:19:33 +08:00
|
|
|
:ref:`Talk <contact>` to developers to find out how you can fix specific bugs.
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-07-26 18:19:39 +08:00
|
|
|
Don't forget to check the issue trackers of your favourite plugins, too!
|
|
|
|
|
2015-02-27 18:54:17 +08:00
|
|
|
.. _writeplugins:
|
|
|
|
|
2014-01-22 18:37:02 +08:00
|
|
|
Implement features
|
|
|
|
------------------
|
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
Look through the GitHub issues for enhancements. Here is sample filter you
|
2014-01-22 18:37:02 +08:00
|
|
|
can use:
|
2015-06-16 05:54:44 +08:00
|
|
|
https://github.com/pytest-dev/pytest/labels/enhancement
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-22 19:19:33 +08:00
|
|
|
:ref:`Talk <contact>` to developers to find out how you can implement specific
|
2014-01-22 18:37:02 +08:00
|
|
|
features.
|
|
|
|
|
|
|
|
Write documentation
|
|
|
|
-------------------
|
|
|
|
|
2014-01-23 18:42:20 +08:00
|
|
|
pytest could always use more documentation. What exactly is needed?
|
2014-01-22 18:37:02 +08:00
|
|
|
|
|
|
|
* More complementary documentation. Have you perhaps found something unclear?
|
2015-07-26 18:19:39 +08:00
|
|
|
* Documentation translations. We currently have only English.
|
2015-10-24 17:21:22 +08:00
|
|
|
* Docstrings. There can never be too many of them.
|
2014-01-22 18:37:02 +08:00
|
|
|
* Blog posts, articles and such -- they're all very appreciated.
|
|
|
|
|
2015-07-26 18:19:39 +08:00
|
|
|
You can also edit documentation files directly in the Github web interface
|
|
|
|
without needing to make a fork and local copy. This can be convenient for
|
|
|
|
small fixes.
|
|
|
|
|
2015-02-27 18:54:17 +08:00
|
|
|
.. _`pull requests`:
|
2015-02-27 23:42:03 +08:00
|
|
|
.. _pull-requests:
|
2014-01-25 02:21:21 +08:00
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
Preparing Pull Requests on GitHub
|
|
|
|
---------------------------------
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-25 02:21:21 +08:00
|
|
|
.. note::
|
|
|
|
What is a "pull request"? It informs project's core developers about the
|
|
|
|
changes you want to review and merge. Pull requests are stored on
|
2015-06-16 05:54:44 +08:00
|
|
|
`GitHub servers <https://github.com/pytest-dev/pytest/pulls>`_.
|
2014-01-25 02:21:21 +08:00
|
|
|
Once you send pull request, we can discuss it's potential modifications and
|
|
|
|
even add more commits to it later on.
|
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
There's an excellent tutorial on how Pull Requests work in the
|
|
|
|
`GitHub Help Center <https://help.github.com/articles/using-pull-requests/>`_,
|
|
|
|
but here is a simple overview:
|
2014-01-22 19:19:33 +08:00
|
|
|
|
2015-03-03 03:48:09 +08:00
|
|
|
#. Fork the
|
2015-06-16 05:54:44 +08:00
|
|
|
`pytest GitHub repository <https://github.com/pytest-dev/pytest>`__. It's
|
2014-01-25 02:37:44 +08:00
|
|
|
fine to use ``pytest`` as your fork repository name because it will live
|
|
|
|
under your user.
|
2014-01-23 18:38:05 +08:00
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
#. Clone your fork locally using `git <https://git-scm.com/>`_ and create a branch::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
$ git clone git@github.com:YOUR_GITHUB_USERNAME/pytest.git
|
2014-01-23 18:38:05 +08:00
|
|
|
$ cd pytest
|
2015-09-22 16:21:01 +08:00
|
|
|
# now, to fix a bug create your own branch off "master":
|
|
|
|
|
2015-09-22 21:54:37 +08:00
|
|
|
$ git checkout -b your-bugfix-branch-name master
|
2015-09-22 16:21:01 +08:00
|
|
|
|
|
|
|
# or to instead add a feature create your own branch off "features":
|
|
|
|
|
2015-09-22 21:54:37 +08:00
|
|
|
$ git checkout -b your-feature-branch-name features
|
2015-09-22 16:21:01 +08:00
|
|
|
|
2015-09-22 16:29:12 +08:00
|
|
|
Given we have "major.minor.micro" version numbers, bugfixes will usually
|
2015-09-22 16:21:01 +08:00
|
|
|
be released in micro releases whereas features will be released in
|
|
|
|
minor releases and incompatible changes in major releases.
|
2014-01-25 02:37:44 +08:00
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
If you need some help with Git, follow this quick start
|
|
|
|
guide: https://git.wiki.kernel.org/index.php/QuickStart
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-09-21 17:49:35 +08:00
|
|
|
#. Install tox
|
|
|
|
|
|
|
|
Tox is used to run all the tests and will automatically setup virtualenvs
|
|
|
|
to run the tests in.
|
2015-03-03 03:48:09 +08:00
|
|
|
(will implicitly use http://www.virtualenv.org/en/latest/)::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-09-21 17:49:35 +08:00
|
|
|
$ pip install tox
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-09-21 17:49:35 +08:00
|
|
|
#. Run all the tests
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-09-21 20:04:30 +08:00
|
|
|
You need to have Python 2.7 and 3.5 available in your system. Now
|
2015-03-03 03:48:09 +08:00
|
|
|
running tests is as simple as issuing this command::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2016-01-06 04:14:57 +08:00
|
|
|
$ python runtox.py -e linting,py27,py35
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-09-21 20:04:30 +08:00
|
|
|
This command will run tests via the "tox" tool against Python 2.7 and 3.5
|
2016-01-06 04:14:57 +08:00
|
|
|
and also perform "lint" coding-style checks. ``runtox.py`` is
|
2015-03-03 03:48:09 +08:00
|
|
|
a thin wrapper around ``tox`` which installs from a development package
|
|
|
|
index where newer (not yet released to pypi) versions of dependencies
|
|
|
|
(especially ``py``) might be present.
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-09-21 17:49:35 +08:00
|
|
|
#. You can now edit your local working copy.
|
|
|
|
|
|
|
|
You can now make the changes you want and run the tests again as necessary.
|
|
|
|
|
|
|
|
To run tests on py27 and pass options to pytest (e.g. enter pdb on failure)
|
2015-03-03 03:48:09 +08:00
|
|
|
to pytest you can do::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 20:21:00 +08:00
|
|
|
$ python runtox.py -e py27 -- --pdb
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-09-21 20:04:30 +08:00
|
|
|
or to only run tests in a particular test module on py35::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-09-21 20:04:30 +08:00
|
|
|
$ python runtox.py -e py35 -- testing/test_config.py
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-03-03 03:48:09 +08:00
|
|
|
#. Commit and push once your tests pass and you are happy with your change(s)::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
$ git commit -a -m "<commit message>"
|
|
|
|
$ git push -u
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2015-07-29 07:04:46 +08:00
|
|
|
Make sure you add a CHANGELOG message, and add yourself to AUTHORS. If you
|
|
|
|
are unsure about either of these steps, submit your pull request and we'll
|
|
|
|
help you fix it up.
|
|
|
|
|
2015-09-29 19:48:38 +08:00
|
|
|
#. Finally, submit a pull request through the GitHub website using this data::
|
2014-01-23 17:51:45 +08:00
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
head-fork: YOUR_GITHUB_USERNAME/pytest
|
|
|
|
compare: your-branch-name
|
2014-01-25 03:01:04 +08:00
|
|
|
|
2015-06-16 05:54:44 +08:00
|
|
|
base-fork: pytest-dev/pytest
|
2015-09-29 19:48:38 +08:00
|
|
|
base: master # if it's a bugfix
|
|
|
|
base: feature # if it's a feature
|
2014-01-22 19:19:33 +08:00
|
|
|
|
2014-01-25 02:37:44 +08:00
|
|
|
|