forked from twisted/twisted
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
418 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
Development process | ||
=================== | ||
|
||
This page described the process that should be followed for contributing to Twisted. | ||
|
||
|
||
If you're going to be doing development on Twisted itself, | ||
or if you want to take advantage of bleeding-edge features (or bug fixes) that are not yet available in a numbered release, | ||
you'll probably want to check out a tree from the Twisted Git repository. | ||
|
||
The `trunk` is the main branch and is where all current development takes place. | ||
|
||
|
||
|
||
Checkout and initial dev virtual environment | ||
-------------------------------------------- | ||
|
||
|
||
Git tutorials can be found elsewhere, see in particular `Git and GitHub learning resources <https://help.github.com/articles/good-resources-for-learning-git-and-github/>`_ : | ||
|
||
.. code-block:: console | ||
$ git clone https://github.com/twisted/twisted twisted | ||
$ virtualenv venv | ||
$ . venv/bin/activate | ||
$ pip install -e .[dev] | ||
$ pip install pre-commit | ||
The output of ``git blame`` `will be better <https://github.com/psf/black#migrating-your-code-style-without-ruining-git-blame>`_ if you configure it to use our ignore file: | ||
|
||
.. code-block:: console | ||
$ cd twisted | ||
$ git config blame.ignoreRevsFile .git-blame-ignore-revs | ||
Running tests | ||
------------- | ||
|
||
The test are handled by `trial` testing framework. | ||
It knows about deferred and any other good stuff provided by Twisted. | ||
To run the full unit-test suite, do: | ||
|
||
.. code-block:: console | ||
./bin/trial twisted | ||
To run a single test file (like ``twisted/test/test_defer.py`` ), do one of: | ||
|
||
.. code-block:: console | ||
./bin/trial twisted.test.test_defer | ||
# or | ||
./bin/trial twisted/test/test_defer.py | ||
To run any tests that are related to a code file, like ``twisted/protocols/imap4.py`` , do: | ||
|
||
.. code-block:: console | ||
./bin/trial --testmodule twisted/mail/imap4.py | ||
This depends upon the ``.py`` file having an appropriate "test-case-name" tag that indicates which test cases provide coverage. | ||
See the :doc:`Test Standards <policy/test-standard>` document for | ||
details about using "test-case-name". | ||
In this example, the ``twisted.mail.test.test_imap`` test will be run. | ||
|
||
Many tests create temporary files in /tmp or ./_trial_temp, | ||
but everything in /tmp should be deleted when the test finishes. | ||
Sometimes these cleanup calls are commented out by mistake, so if you see a stray ``/tmp/@12345.1`` directory, it is probably from ``test_dirdbm`` or ``test_popsicle`` . | ||
Look for an ``rmtree`` that has been commented out and complain to the last developer who touched that file. | ||
|
||
|
||
Building docs | ||
------------- | ||
|
||
Twisted documentation is generated by `Sphinx <https://sphinx-doc.org/>`_. | ||
The automatically-generated API docs is generated by `pydoctor <https://pydoctor.readthedocs.io/>`_. | ||
|
||
To build the HTML form of the docs into the ``doc/`` directory, do the following. | ||
This will trigger a full build including the API docs: | ||
|
||
.. code-block:: console | ||
tox -e narrativedocs | ||
firefox docs/_build/index.html | ||
Committing and Post-commit Hooks | ||
-------------------------------- | ||
|
||
|
||
Twisted's Trac installation is notified when the Git repository changes, | ||
and will update the ticket depending on the Git commit logs. | ||
When making a branch for a ticket, the branch name should end | ||
in ``-<ticket number>`` , for | ||
example ``my-branch-9999`` . This will add a ticket comment containing a | ||
changeset link and branch name. To make your commit message show up as a comment | ||
on a Trac ticket, add a ``refs #<ticket number>`` line at the | ||
bottom of your commit message. To automatically close a ticket on Trac | ||
as ``Fixed`` and add a comment with the closing commit message, add | ||
a ``Fixes: #<ticket number>`` line to your commit message. In | ||
general, a commit message closing a ticket looks like this: | ||
|
||
|
||
|
||
|
||
|
||
:: | ||
|
||
Merge my-branch-9999: A single-line summary. | ||
Author: jesstess | ||
Reviewers: exarkun, glyph | ||
Fixes: #9999 | ||
My longer description of the changes made. | ||
|
||
|
||
|
||
|
||
The :doc:`Twisted Coding Standard <coding-standard>` | ||
elaborates on commit messages and source control. | ||
|
||
|
||
|
||
|
||
|
||
Emacs | ||
----- | ||
|
||
|
||
|
||
A minor mode for development with Twisted using Emacs is available. See ``twisted-dev.el`` , provided by `twisted-emacs <https://launchpad.net/twisted-emacs>`_ , | ||
for several utility functions which make it easier to grep for methods, run test cases, etc. | ||
|
||
|
||
|
||
|
||
|
||
Building Debian packages | ||
------------------------ | ||
|
||
|
||
|
||
Our support for building Debian packages has fallen into disrepair. We | ||
would very much like to restore this functionality, but until we do so, if | ||
you are interested in this, you are on your own. See `stdeb <https://github.com/astraw/stdeb>`_ for one possible approach to | ||
this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
|
||
:LastChangedDate: $LastChangedDate$ | ||
:LastChangedRevision: $LastChangedRevision$ | ||
:LastChangedBy: $LastChangedBy$ | ||
|
||
Development of Twisted | ||
====================== | ||
|
||
This section of documentation is for people who work on the Twisted codebase itself, | ||
rather than for people who want to use Twisted in their projects. | ||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
dev-process | ||
review-process | ||
naming | ||
philosophy | ||
policy/index | ||
|
||
|
||
This documentation is for people who work on the Twisted codebase itself, rather than for people who want to use Twisted in their own projects. | ||
|
||
- :doc:`Naming <naming>` | ||
- :doc:`Philosophy <philosophy>` | ||
- :doc:`Twisted development policy <policy/index>` |
Oops, something went wrong.