diff options
author | Tres Seaver <tseaver@palladion.com> | 2015-01-10 13:12:31 -0500 |
---|---|---|
committer | Tres Seaver <tseaver@palladion.com> | 2015-01-10 13:12:37 -0500 |
commit | 1213a6182b26d73234a55c8a390fd98b577d6a05 (patch) | |
tree | 4a64855cdd0d8e64ac5df2a9a79524326a835818 | |
parent | 744ac868bbfe5284386f737edf5f1a536c847868 (diff) | |
download | zope-event-1213a6182b26d73234a55c8a390fd98b577d6a05.tar.gz |
Modernize 'Hacking' docs.
[ci skip]
-rw-r--r-- | docs/hacking.rst | 102 |
1 files changed, 56 insertions, 46 deletions
diff --git a/docs/hacking.rst b/docs/hacking.rst index 5f88ea2..de90dc7 100644 --- a/docs/hacking.rst +++ b/docs/hacking.rst @@ -3,18 +3,24 @@ Hacking on :mod:`zope.event` Getting the Code ------------------ +################ + +The main repository for :mod:`zope.event` is in the Zope Foundation +Github repository: + + https://github.com/zopefoundation/zope.event -The main repository for :mod:`zope.event` is in the Zope Subversion -repository: +You can get a read-only checkout from there: -http://svn.zope.org/zope.event +.. code-block:: sh + + $ git clone https://github.com/zopefoundation/zope.event.git -You can get a read-only Subversion checkout from there: +or fork it and get a writeable checkout of your fork: .. code-block:: sh - $ svn checkout svn://svn.zope.org/repos/main/zope.event/trunk zope.event + $ git clone git@github.com/jrandom/zope.event.git The project also mirrors the trunk from the Subversion repository as a Bazaar branch on Launchpad: @@ -28,8 +34,11 @@ You can branch the trunk from there using Bazaar: $ bzr branch lp:zope.event -Running the tests in a ``virtualenv`` -------------------------------------- +Working in a ``virtualenv`` +########################### + +Installing +---------- If you use the ``virtualenv`` package to create lightweight Python development environments, you can run the tests using nothing more @@ -47,7 +56,10 @@ environment: $ /tmp/hack-zope.event/bin/python setup.py develop -Finally, run the tests using the build-in ``setuptools`` testrunner: +Running the tests +----------------- + +Then, you canrun the tests using the build-in ``setuptools`` testrunner: .. code-block:: sh @@ -108,8 +120,8 @@ you can see how well the tests cover the code: OK -Building the documentation in a ``virtualenv`` ----------------------------------------------- +Building the documentation +-------------------------- :mod:`zope.event` uses the nifty :mod:`Sphinx` documentation system for building its docs. Using the same virtualenv you set up to run the @@ -154,8 +166,11 @@ You can also test the code snippets in the documentation: results in _build/doctest/output.txt. -Running the tests using :mod:`zc.buildout` -------------------------------------------- +Using :mod:`zc.buildout` +######################## + +Setting up the buildout +----------------------- :mod:`zope.event` ships with its own :file:`buildout.cfg` file and :file:`bootstrap.py` for setting up a development buildout: @@ -171,6 +186,9 @@ Running the tests using :mod:`zc.buildout` Generated script '.../bin/sphinx-quickstart'. Generated script '.../bin/sphinx-build'. +Running the tests +----------------- + You can now run the tests: .. code-block:: sh @@ -183,8 +201,8 @@ You can now run the tests: Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds. -Building the documentation using :mod:`zc.buildout` ---------------------------------------------------- +Building the documentation +-------------------------- The :mod:`zope.event` buildout installs the Sphinx scripts required to build the documentation, including testing its code snippets: @@ -218,8 +236,12 @@ the documentation, including testing its code snippets: Build finished. The HTML pages are in .../docs/_build/html. -Running Tests on Multiple Python Versions via :mod:`tox` --------------------------------------------------------- + +Using :mod:`tox` +################ + +Running Tests on Multiple Python Versions +----------------------------------------- `tox <http://tox.testrun.org/latest/>`_ is a Python-based test automation tool designed to run tests against multiple Python versions. It creates @@ -230,22 +252,11 @@ configured commands. :mod:`zope.event` configures the following :mod:`tox` environments via its ``tox.ini`` file: -- The ``py26`` environment builds a ``virtualenv`` with ``python2.6``, - installs :mod:`zope.event`, and runs the tests - via ``python setup.py test -q``. - -- The ``py27`` environment builds a ``virtualenv`` with ``python2.7``, - installs :mod:`zope.event`, and runs the tests - via ``python setup.py test -q``. - -- The ``py32`` environment builds a ``virtualenv`` with ``python3.2``, +- The ``py26``, ``py27``, ``py33``, ``py34``, and ``pypy`` environments + builds a ``virtualenv`` with ``pypy``, installs :mod:`zope.event` and dependencies, and runs the tests via ``python setup.py test -q``. -- The ``pypy`` environment builds a ``virtualenv`` with ``pypy``, - installs :mod:`zope.event`, and runs the tests - via ``python setup.py test -q``. - - The ``coverage`` environment builds a ``virtualenv`` with ``python2.6``, installs :mod:`zope.event`, installs :mod:`nose` and :mod:`coverage`, and runs ``nosetests`` with statement @@ -261,8 +272,8 @@ as well as installing ``tox``: .. code-block:: sh $ tox -e py26 - GLOB sdist-make: .../zope.interface/setup.py - py26 sdist-reinst: .../zope.interface/.tox/dist/zope.interface-4.0.2dev.zip + GLOB sdist-make: .../zope.event/setup.py + py26 sdist-reinst: .../zope.event/.tox/dist/zope.event-4.0.2dev.zip py26 runtests: commands[0] ... ---------------------------------------------------------------------- @@ -279,8 +290,8 @@ including building the docs and testing their snippets: .. code-block:: sh $ tox - GLOB sdist-make: .../zope.interface/setup.py - py26 sdist-reinst: .../zope.interface/.tox/dist/zope.interface-4.0.2dev.zip + GLOB sdist-make: .../zope.event/setup.py + py26 sdist-reinst: .../zope.event/.tox/dist/zope.event-4.0.2dev.zip py26 runtests: commands[0] ... Doctest summary @@ -300,12 +311,15 @@ including building the docs and testing their snippets: congratulations :) +Contributing to :mod:`zope.event` +################################# + Submitting a Bug Report ----------------------- -:mod:`zope.event` tracks its bugs on Launchpad: +:mod:`zope.event` tracks its bugs on Github: -https://bugs.launchpad.net/zope.event + https://github.com/zopefoundation/zope.event/issues Please submit bug reports and feature requests there. @@ -320,16 +334,12 @@ Sharing Your Changes or bug fixes, although it is possible that you may have tested your new code by updating existing tests. -If you got a read-only checkout from the Subversion repository, and you -have made a change you would like to share, the best route is to let -Subversion help you make a patch file: - -.. code-block:: sh - - $ svn diff > zope.event-cool_feature.patch +If have made a change you would like to share, the best route is to fork +the Githb repository, check out your fork, make your changes on a branch +in your fork, and push it. You can then submit a pull request from your +branch: -You can then upload that patch file as an attachment to a Launchpad bug -report. + https://github.com/zopefoundation/zope.event/pulls If you branched the code from Launchpad using Bazaar, you have another option: you can "push" your branch to Launchpad: @@ -338,6 +348,6 @@ option: you can "push" your branch to Launchpad: $ bzr push lp:~tseaver/zope.event/cool_feature -After pushing your branch, you can link it to a bug report on Launchpad, +After pushing your branch, you can link it to a bug report on Github, or request that the maintainers merge your branch using the Launchpad "merge request" feature. |