blob: 558e1423927c38b3be4052788dcf9c8033e26d71 [file] [log] [blame]
Laurens Van Houtven5a422982014-03-15 21:42:31 +01001Contributing
2============
Laurens Van Houtven290aba12014-03-14 15:20:18 +01003
Laurens Van Houtven36a26652014-03-15 21:52:25 +01004First of all, thank you for your interest in contributing to pyOpenSSL!
Hynek Schlawack8fb864a2015-06-07 19:09:49 +02005This project has no company backing its development therefore we're dependent on help by the community.
6
Laurens Van Houtven290aba12014-03-14 15:20:18 +01007
Laurens Van Houtven5a422982014-03-15 21:42:31 +01008Filing bug reports
9------------------
Laurens Van Houtven290aba12014-03-14 15:20:18 +010010
Laurens Van Houtven36a26652014-03-15 21:52:25 +010011Bug reports are very welcome.
Hynek Schlawack35147f02015-09-06 09:00:15 +020012Please file them on the `GitHub issue tracker`_.
Laurens Van Houtven36a26652014-03-15 21:52:25 +010013Good bug reports come with extensive descriptions of the error and how to reproduce it.
Jean-Paul Calderone0679a692014-03-16 10:17:09 -040014Reporters are strongly encouraged to include an `short, self contained, correct example <http://www.sscce.org/>`_.
Laurens Van Houtven290aba12014-03-14 15:20:18 +010015
Hynek Schlawack8fb864a2015-06-07 19:09:49 +020016
Laurens Van Houtven5a422982014-03-15 21:42:31 +010017Patches
18-------
Laurens Van Houtven290aba12014-03-14 15:20:18 +010019
Hynek Schlawack8fb864a2015-06-07 19:09:49 +020020All patches to pyOpenSSL should be submitted in the form of pull requests to the main pyOpenSSL repository, `pyca/pyopenssl`_.
Laurens Van Houtven36a26652014-03-15 21:52:25 +010021These pull requests should satisfy the following properties:
Laurens Van Houtven290aba12014-03-14 15:20:18 +010022
Hynek Schlawacka2995a12015-10-28 12:14:57 +010023
24Code
25^^^^
26
Hynek Schlawack35147f02015-09-06 09:00:15 +020027- The pull request should focus on one particular improvement to pyOpenSSL.
28 Create different pull requests for unrelated features or bugfixes.
Laurens Van Houtven36a26652014-03-15 21:52:25 +010029- Code should follow `PEP 8`_, especially in the "do what code around you does" sense.
Laurens Van Houtven36a26652014-03-15 21:52:25 +010030 Follow OpenSSL naming for callables whenever possible is preferred.
Hynek Schlawacka2995a12015-10-28 12:14:57 +010031- New tests should use `py.test-style assertions`_ instead of the old ``self.assertXYZ``-style.
Jean-Paul Calderone0679a692014-03-16 10:17:09 -040032- Pull requests that introduce code must test all new behavior they introduce as well as for previously untested or poorly tested behavior that they touch.
Laurens Van Houtven290aba12014-03-14 15:20:18 +010033- Pull requests are not allowed to break existing tests.
Hynek Schlawack35147f02015-09-06 09:00:15 +020034 We usually don't comment on pull requests that are breaking the CI because we consider them work in progress.
35 Please note that not having 100% code coverage for the code you wrote/touched also causes our CI to fail.
Hynek Schlawacka2995a12015-10-28 12:14:57 +010036
37
38Documentation
39^^^^^^^^^^^^^
40
41When introducing new functionality, please remember to write documentation.
42
43- New functions and methods should have a docstring describing what they do, what parameters they takes, what types those parameters are, and what they return.
44
45 .. code-block:: python
46
47 def dump_publickey(type, pkey):
48 """
49 Dump a public key to a buffer.
50
51 :param type: The file type (one of :data:`FILETYPE_PEM` or
52 :data:`FILETYPE_ASN1`).
53 :param PKey pkey: The PKey to dump.
54
55 :return: The buffer with the dumped key in it.
56 :rtype: bytes
57 """
58
59
60 Don't forget to add an ``.. auto(function|class|method)::`` statement to the relevant API document found in ``doc/api/`` to actually add your function to the Sphinx documentation.
61- Do *not* use ``:py:`` prefixes when cross-linking (Python is default).
62 Do *not* use the generic ``:data:`` or ``:obj:``.
63 Instead use more specific types like ``:class:``, ``:func:`` or ``:meth:`` if applicable.
64- Pull requests that introduce features or fix bugs should note those changes in the CHANGELOG.rst_ file.
65 Please add new entries to the *top* of the *current* Changes section followed by a line linking to the relevant pull request:
66
67 .. code-block:: rst
68
Hynek Schlawack65e4def2016-03-13 15:07:52 +010069 - Added ``OpenSSL.crypto.some_func()`` to do something awesome.
Hynek Schlawacka2995a12015-10-28 12:14:57 +010070 [`#1 <https://github.com/pyca/pyopenssl/pull/1>`_]
71
72
73- Use `semantic newlines`_ in reStructuredText_ files (files ending in ``.rst``).
74
75
76Review
77------
Laurens Van Houtven290aba12014-03-14 15:20:18 +010078
Laurens Van Houtven36a26652014-03-15 21:52:25 +010079Finally, pull requests must be reviewed before merging.
80This process mirrors the `cryptography code review process`_.
81Everyone can perform reviews; this is a very valuable way to contribute, and is highly encouraged.
Laurens Van Houtven290aba12014-03-14 15:20:18 +010082
Hynek Schlawack8f4eeb52015-09-06 15:12:40 +020083Pull requests are merged by `members of PyCA`_.
Hynek Schlawack8fb864a2015-06-07 19:09:49 +020084They should, of course, keep all the requirements detailed in this document as well as the ``pyca/cryptography`` merge requirements in mind.
Laurens Van Houtven290aba12014-03-14 15:20:18 +010085
Hynek Schlawack8fb864a2015-06-07 19:09:49 +020086The final responsibility for the reviewing of merged code lies with the person merging it.
87Since pyOpenSSL is a sensitive project from a security perspective, reviewers are strongly encouraged to take this review and merge process very seriously.
Laurens Van Houtven290aba12014-03-14 15:20:18 +010088
Hynek Schlawack8fb864a2015-06-07 19:09:49 +020089
90Finding Help
91------------
92
93If you need any help with the contribution process, you'll find us hanging out at ``#cryptography-dev`` on Freenode_ IRC.
94You can also ask questions on our `mailing list`_.
95
Hynek Schlawack238effd2016-03-17 14:06:35 +010096Please note that this project is released with a Contributor `Code of Conduct`_.
97By participating in this project you agree to abide by its terms.
Hynek Schlawack8fb864a2015-06-07 19:09:49 +020098
99
Hynek Schlawack105bfb72015-10-28 12:16:40 +0100100Security
101--------
102
103If you feel that you found a security-relevant bug that you would prefer to discuss in private, please send us a GPG_-encrypted e-mail.
104
105The maintainer can be reached at hs@ox.cx and his GPG key ID is ``0xAE2536227F69F181`` (Fingerprint: ``C2A0 4F86 ACE2 8ADC F817 DBB7 AE25 3622 7F69 F181``).
106Feel free to cross-check this information with Keybase_.
107
108
Hynek Schlawack35147f02015-09-06 09:00:15 +0200109.. _GitHub issue tracker: https://github.com/pyca/pyopenssl/issues
Hynek Schlawack8d4f9762016-03-19 08:15:03 +0100110.. _GPG: https://en.wikipedia.org/wiki/GNU_Privacy_Guard
Hynek Schlawack8fb864a2015-06-07 19:09:49 +0200111.. _Keybase: https://keybase.io/hynek
112.. _pyca/pyopenssl: https://github.com/pyca/pyopenssl
113.. _PEP 8: https://www.python.org/dev/peps/pep-0008/
Hynek Schlawack35147f02015-09-06 09:00:15 +0200114.. _py.test-style assertions: https://pytest.org/latest/assert.html
Laurens Van Houtven5a422982014-03-15 21:42:31 +0100115.. _cryptography code review process: https://cryptography.io/en/latest/development/reviewing-patches/
Hynek Schlawack8fb864a2015-06-07 19:09:49 +0200116.. _freenode: https://freenode.net
Hynek Schlawack35147f02015-09-06 09:00:15 +0200117.. _mailing list: https://mail.python.org/mailman/listinfo/cryptography-dev
Hynek Schlawack8f4eeb52015-09-06 15:12:40 +0200118.. _members of PyCA: https://github.com/orgs/pyca/people
Hynek Schlawacka2995a12015-10-28 12:14:57 +0100119.. _semantic newlines: http://rhodesmill.org/brandon/2012/one-sentence-per-line/
Hynek Schlawack8d4f9762016-03-19 08:15:03 +0100120.. _reStructuredText: http://sphinx-doc.org/rest.html
Hynek Schlawacka2995a12015-10-28 12:14:57 +0100121.. _CHANGELOG.rst: https://github.com/pyca/pyopenssl/blob/master/CHANGELOG.rst
Hynek Schlawack238effd2016-03-17 14:06:35 +0100122.. _`Code of Conduct`: https://github.com/pyca/pyopenssl/blob/master/CODE_OF_CONDUCT.rst