2014-01-22 18:37:02 +08:00
|
|
|
============
|
|
|
|
Contributing
|
|
|
|
============
|
|
|
|
|
|
|
|
Contributions are highly welcomed and appreciated. Every little help counts,
|
|
|
|
so do not hesitate!
|
|
|
|
|
2014-01-23 17:51:45 +08:00
|
|
|
|
2014-01-22 18:37:02 +08:00
|
|
|
Types of contributions
|
|
|
|
======================
|
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
Report bugs
|
|
|
|
-----------
|
|
|
|
|
|
|
|
Report bugs at https://bitbucket.org/hpk42/pytest/issues.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
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
|
2014-01-23 17:21:06 +08:00
|
|
|
`submit them as issues <https://bitbucket.org/hpk42/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
|
|
|
|
|
|
|
|
|
|
|
Fix bugs
|
|
|
|
--------
|
|
|
|
|
|
|
|
Look through the BitBucket issues for bugs. Here is sample filter you can use:
|
|
|
|
https://bitbucket.org/hpk42/pytest/issues?status=new&status=open&kind=bug
|
|
|
|
|
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
|
|
|
|
|
|
|
Implement features
|
|
|
|
------------------
|
|
|
|
|
|
|
|
Look through the BitBucket issues for enhancements. Here is sample filter you
|
|
|
|
can use:
|
|
|
|
https://bitbucket.org/hpk42/pytest/issues?status=new&status=open&kind=enhancement
|
|
|
|
|
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?
|
|
|
|
* Documentation translations. We currently have English and Japanese versions.
|
|
|
|
* Docstrings. There's never too much of them.
|
|
|
|
* Blog posts, articles and such -- they're all very appreciated.
|
|
|
|
|
2014-01-25 02:21:21 +08:00
|
|
|
.. _pull-requests:
|
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
Preparing Pull Requests on Bitbucket
|
|
|
|
=====================================
|
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
|
|
|
|
`BitBucket servers <https://bitbucket.org/hpk42/pytest/pull-requests>`__.
|
|
|
|
Once you send pull request, we can discuss it's potential modifications and
|
|
|
|
even add more commits to it later on.
|
|
|
|
|
2014-01-23 18:42:20 +08:00
|
|
|
The primary development platform for pytest is BitBucket. You can find all
|
2014-01-25 02:37:44 +08:00
|
|
|
the issues there and submit your pull requests.
|
2014-01-22 19:19:33 +08:00
|
|
|
|
2014-01-25 02:37:44 +08:00
|
|
|
1. Fork the
|
|
|
|
`pytest BitBucket repository <https://bitbucket.org/hpk42/pytest>`__. It's
|
|
|
|
fine to use ``pytest`` as your fork repository name because it will live
|
|
|
|
under your user.
|
2014-01-23 18:38:05 +08:00
|
|
|
|
|
|
|
.. _virtualenvactivate:
|
2014-01-22 19:19:33 +08:00
|
|
|
|
2014-01-23 20:21:00 +08:00
|
|
|
2. Create and activate a fork-specific virtualenv
|
2014-01-23 18:38:05 +08:00
|
|
|
(http://www.virtualenv.org/en/latest/)::
|
2014-01-22 19:19:33 +08:00
|
|
|
|
|
|
|
$ virtualenv pytest-venv
|
2014-01-23 18:38:05 +08:00
|
|
|
$ source pytest-venv/bin/activate
|
2014-01-22 19:19:33 +08:00
|
|
|
|
2014-01-22 18:37:02 +08:00
|
|
|
.. _checkout:
|
2014-01-22 19:19:33 +08:00
|
|
|
|
2014-01-25 02:37:44 +08:00
|
|
|
3. Clone your fork locally using `Mercurial <http://mercurial.selenic.com/>`_
|
|
|
|
(``hg``) and create a branch::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
$ hg clone ssh://hg@bitbucket.org/YOUR_BITBUCKET_USERNAME/pytest
|
|
|
|
$ cd pytest
|
2014-01-25 02:37:44 +08:00
|
|
|
$ hg branch your-branch-name
|
|
|
|
|
|
|
|
If you need some help with Mercurial, follow this quick start
|
|
|
|
guide: http://mercurial.selenic.com/wiki/QuickStart
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
.. _testing-pytest:
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
4. You can now edit your local working copy. To test you need to
|
|
|
|
install the "tox" tool into your virtualenv::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
$ pip install tox
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
You need to have Python 2.7 and 3.3 available in your system. Now
|
|
|
|
running tests is as simple as issuing this command::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
$ python runtox.py -e py27,py33,flakes
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 20:21:00 +08:00
|
|
|
This command will run tests via the "tox" tool against Python 2.7 and 3.3
|
2014-01-23 18:38:05 +08:00
|
|
|
and also perform "flakes" coding-style checks. ``runtox.py`` is
|
|
|
|
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
|
|
|
|
2014-01-23 20:21:00 +08:00
|
|
|
To run tests on py27 and pass options (e.g. enter pdb on failure)
|
2014-01-23 18:38:05 +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
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
or to only run tests in a particular test module on py33::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
$ python runtox.py -e py33 -- testing/test_config.py
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
5. Commit and push once your tests pass and you are happy with your change(s)::
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-23 18:38:05 +08:00
|
|
|
$ hg commit -m"<commit message>"
|
2014-01-23 07:52:49 +08:00
|
|
|
$ hg push -b .
|
2014-01-22 18:37:02 +08:00
|
|
|
|
2014-01-25 03:01:04 +08:00
|
|
|
6. Finally, submit a pull request through the BitBucket website:
|
|
|
|
|
|
|
|
.. image:: img/pullrequest.png
|
|
|
|
:width: 700px
|
|
|
|
:align: center
|
|
|
|
|
|
|
|
::
|
2014-01-23 17:51:45 +08:00
|
|
|
|
2014-01-25 02:37:44 +08:00
|
|
|
source: YOUR_BITBUCKET_USERNAME/pytest
|
|
|
|
branch: your-branch-name
|
2014-01-23 17:51:45 +08:00
|
|
|
|
|
|
|
target: hpk42/pytest
|
|
|
|
branch: default
|
2014-01-22 19:19:33 +08:00
|
|
|
|
2014-01-23 20:19:49 +08:00
|
|
|
.. _contribution-using-git:
|
2014-01-25 03:01:04 +08:00
|
|
|
|
2014-01-23 20:19:49 +08:00
|
|
|
What about git (and so GitHub)?
|
|
|
|
-------------------------------
|
2014-01-22 19:19:33 +08:00
|
|
|
|
2014-01-25 02:37:44 +08:00
|
|
|
There used to be the pytest GitHub mirror. It was removed in favor of the
|
|
|
|
Mercurial one, to remove confusion of people not knowing where it's better to
|
|
|
|
put their issues and pull requests. Also it wasn't easily possible to automate
|
|
|
|
the mirroring process.
|
|
|
|
|
|
|
|
However, it's still possible to use git to contribute to pytest using tools
|
|
|
|
like `gitifyhg <https://github.com/buchuki/gitifyhg>`_ which allows you to
|
|
|
|
clone and work with Mercurial repo still using git.
|
2014-01-22 19:19:33 +08:00
|
|
|
|
2014-01-23 20:19:49 +08:00
|
|
|
.. warning::
|
2014-01-25 02:37:44 +08:00
|
|
|
Remember that git is **not** a default version control system for pytest and
|
|
|
|
you need to be careful using it.
|