/usr/share/doc/python-attr/html/contributing.html is in python-attr-doc 17.4.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>How To Contribute — attrs 17.4.0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '17.4.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Changelog" href="changelog.html" />
<link rel="prev" title="Backward Compatibility" href="backward-compatibility.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="how-to-contribute">
<span id="contributing"></span><h1>How To Contribute<a class="headerlink" href="#how-to-contribute" title="Permalink to this headline">¶</a></h1>
<p>First off, thank you for considering contributing to <code class="docutils literal"><span class="pre">attrs</span></code>!
It’s people like <em>you</em> who make it is such a great tool for everyone.</p>
<p>This document is mainly to help you to get started by codifying tribal knowledge and expectations and make it more accessible to everyone.
But don’t be afraid to open half-finished PRs and ask questions if something is unclear!</p>
<div class="section" id="support">
<h2>Support<a class="headerlink" href="#support" title="Permalink to this headline">¶</a></h2>
<p>In case you’d like to help out but don’t want to deal with GitHub, there’s a great opportunity:
help your fellow developers on <a class="reference external" href="https://stackoverflow.com/questions/tagged/python-attrs">StackOverflow</a>!</p>
<p>The offical tag is <code class="docutils literal"><span class="pre">python-attrs</span></code> and helping out in support frees us up for improving <code class="docutils literal"><span class="pre">attrs</span></code> instead!</p>
</div>
<div class="section" id="workflow">
<h2>Workflow<a class="headerlink" href="#workflow" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>No contribution is too small!
Please submit as many fixes for typos and grammar bloopers as you can!</li>
<li>Try to limit each pull request to <em>one</em> change only.</li>
<li><em>Always</em> add tests and docs for your code.
This is a hard rule; patches with missing tests or documentation can’t be merged.</li>
<li>Make sure your changes pass our <a class="reference external" href="https://travis-ci.org/python-attrs/attrs/">CI</a>.
You won’t get any feedback until it’s green unless you ask for it.</li>
<li>Once you’ve addressed review feedback, make sure to bump the pull request with a short note, so we know you’re done.</li>
<li>Don’t break <a class="reference external" href="http://www.attrs.org/en/latest/backward-compatibility.html">backward compatibility</a>.</li>
</ul>
</div>
<div class="section" id="code">
<h2>Code<a class="headerlink" href="#code" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first">Obey <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">PEP 8</a> and <a class="reference external" href="https://www.python.org/dev/peps/pep-0257/">PEP 257</a>.
We use the <code class="docutils literal"><span class="pre">"""</span></code>-on-separate-lines style for docstrings:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">func</span><span class="p">(</span><span class="n">x</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Do something.</span>
<span class="sd"> :param str x: A very important parameter.</span>
<span class="sd"> :rtype: str</span>
<span class="sd"> """</span>
</pre></div>
</div>
</li>
<li><p class="first">If you add or change public APIs, tag the docstring using <code class="docutils literal"><span class="pre">..</span>  <span class="pre">versionadded::</span> <span class="pre">16.0.0</span> <span class="pre">WHAT</span></code> or <code class="docutils literal"><span class="pre">..</span>  <span class="pre">versionchanged::</span> <span class="pre">16.2.0</span> <span class="pre">WHAT</span></code>.</p>
</li>
<li><p class="first">Prefer double quotes (<code class="docutils literal"><span class="pre">"</span></code>) over single quotes (<code class="docutils literal"><span class="pre">'</span></code>) unless the string contains double quotes itself.</p>
</li>
</ul>
</div>
<div class="section" id="tests">
<h2>Tests<a class="headerlink" href="#tests" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first">Write your asserts as <code class="docutils literal"><span class="pre">expected</span> <span class="pre">==</span> <span class="pre">actual</span></code> to line them up nicely:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="n">f</span><span class="p">()</span>
<span class="k">assert</span> <span class="mi">42</span> <span class="o">==</span> <span class="n">x</span><span class="o">.</span><span class="n">some_attribute</span>
<span class="k">assert</span> <span class="s2">"foo"</span> <span class="o">==</span> <span class="n">x</span><span class="o">.</span><span class="n">_a_private_attribute</span>
</pre></div>
</div>
</li>
<li><p class="first">To run the test suite, all you need is a recent <a class="reference external" href="https://tox.readthedocs.io/">tox</a>.
It will ensure the test suite runs with all dependencies against all Python versions just as it will on Travis CI.
If you lack some Python versions, you can can always limit the environments like <code class="docutils literal"><span class="pre">tox</span> <span class="pre">-e</span> <span class="pre">py27,py35</span></code> (in that case you may want to look into <a class="reference external" href="https://github.com/pyenv/pyenv">pyenv</a>, which makes it very easy to install many different Python versions in parallel).</p>
</li>
<li><p class="first">Write <a class="reference external" href="https://jml.io/pages/test-docstrings.html">good test docstrings</a>.</p>
</li>
<li><p class="first">To ensure new features work well with the rest of the system, they should be also added to our <a class="reference external" href="https://hypothesis.readthedocs.io/">Hypothesis</a> testing strategy which you find in <code class="docutils literal"><span class="pre">tests/util.py</span></code>.</p>
</li>
</ul>
</div>
<div class="section" id="documentation">
<h2>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first">Use <a class="reference external" href="http://rhodesmill.org/brandon/2012/one-sentence-per-line/">semantic newlines</a> in <a class="reference external" href="http://www.sphinx-doc.org/en/stable/rest.html">reStructuredText</a> files (files ending in <code class="docutils literal"><span class="pre">.rst</span></code>):</p>
<div class="highlight-rst"><div class="highlight"><pre><span></span>This is a sentence.
This is another sentence.
</pre></div>
</div>
</li>
<li><p class="first">If you start a new section, add two blank lines before and one blank line after the header except if two headers follow immediately after each other:</p>
<div class="highlight-rst"><div class="highlight"><pre><span></span>Last line of previous section.
<span class="gh">Header of New Top Section</span>
<span class="gh">-------------------------</span>
<span class="gh">Header of New Section</span>
<span class="gh">^^^^^^^^^^^^^^^^^^^^^</span>
First line of new section.
</pre></div>
</div>
</li>
<li><p class="first">If you add a new feature, demonstrate its awesomeness in the <a class="reference external" href="https://github.com/python-attrs/attrs/blob/master/docs/examples.rst">examples page</a>!</p>
</li>
</ul>
<div class="section" id="changelog">
<h3>Changelog<a class="headerlink" href="#changelog" title="Permalink to this headline">¶</a></h3>
<p>If your change is noteworthy, there needs to be a changelog entry, so our users can learn about it!</p>
<p>To avoid merge conflicts, we use the <a class="reference external" href="https://pypi.org/project/towncrier">towncrier</a> package to manage our changelog.
<code class="docutils literal"><span class="pre">towncrier</span></code> uses independent files for each pull request – so called <em>news fragments</em> – instead of one monolithic changelog file.
On release those news fragments are compiled into our <code class="docutils literal"><span class="pre">CHANGELOG.rst</span></code>.</p>
<p>You don’t need to install <code class="docutils literal"><span class="pre">towncrier</span></code> yourself, you just have to abide to a few simple rules:</p>
<ul class="simple">
<li>For each pull request, add a new file into <code class="docutils literal"><span class="pre">changelog.d</span></code> with a filename adhering to the <code class="docutils literal"><span class="pre">pr#.(change|deprecation|breaking).rst</span></code> schema:
For example <code class="docutils literal"><span class="pre">changelog.d/42.change.rst</span></code> for a non-breaking change, that is proposed in pull request number 42.</li>
<li>As with other docs, please use <a class="reference external" href="http://rhodesmill.org/brandon/2012/one-sentence-per-line/">semantic newlines</a> within news fragments.</li>
<li>Wrap symbols like modules, functions, or classes into double backticks so they are rendered in a monospaced font.</li>
<li>If you mention functions or other callables, add parantheses at the end of their names: <code class="docutils literal"><span class="pre">attr.func()</span></code> or <code class="docutils literal"><span class="pre">attr.Class.method()</span></code>.
This makes the changelog a lot more readable.</li>
<li>Prefer simple past or constructions with “now”.
For example:<ul>
<li>Added <code class="docutils literal"><span class="pre">attr.validators.func()</span></code>.</li>
<li><code class="docutils literal"><span class="pre">attr.func()</span></code> now doesn’t crash the Large Hadron Collider anymore.</li>
</ul>
</li>
<li>If you want to reference multiple issues, copy the news fragment to another filename.
<code class="docutils literal"><span class="pre">towncrier</span></code> will merge all news fragments with identical contents into one entry with multiple links to the respective pull requests.</li>
</ul>
<p>Example entries:</p>
<blockquote>
<div><div class="highlight-rst"><div class="highlight"><pre><span></span>Added <span class="s">``attr.validators.func()``</span>.
The feature really <span class="ge">*is*</span> awesome.
</pre></div>
</div>
</div></blockquote>
<p>or:</p>
<blockquote>
<div><div class="highlight-rst"><div class="highlight"><pre><span></span><span class="s">``attr.func()``</span> now doesn't crash the Large Hadron Collider anymore.
The bug really <span class="ge">*was*</span> nasty.
</pre></div>
</div>
</div></blockquote>
<hr class="docutils" />
<p><code class="docutils literal"><span class="pre">tox</span> <span class="pre">-e</span> <span class="pre">changelog</span></code> will render the current changelog to the terminal if you have any doubts.</p>
</div>
</div>
<div class="section" id="local-development-environment">
<h2>Local Development Environment<a class="headerlink" href="#local-development-environment" title="Permalink to this headline">¶</a></h2>
<p>You can (and should) run our test suite using <a class="reference external" href="https://tox.readthedocs.io/">tox</a>.
However you’ll probably want a more traditional environment too.
We highly recommend to develop using the latest Python 3 release because <code class="docutils literal"><span class="pre">attrs</span></code> tries to take advantage of modern features whenever possible.</p>
<p>First create a <a class="reference external" href="https://virtualenv.pypa.io/">virtual environment</a>.
It’s out of scope for this document to list all the ways to manage virtual environments in Python but if you don’t have already a pet way, take some time to look at tools like <a class="reference external" href="https://github.com/berdario/pew">pew</a>, <a class="reference external" href="http://virtualfish.readthedocs.io/">virtualfish</a>, and <a class="reference external" href="http://virtualenvwrapper.readthedocs.io/">virtualenvwrapper</a>.</p>
<p>Next, get an up to date checkout of the <code class="docutils literal"><span class="pre">attrs</span></code> repository:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ git checkout git@github.com:python-attrs/attrs.git
</pre></div>
</div>
<p>Change into the newly created directory and <strong>after activating your virtual environment</strong> install an editable version of <code class="docutils literal"><span class="pre">attrs</span></code> along with its tests and docs requirements:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> attrs
$ pip install -e .<span class="o">[</span>dev<span class="o">]</span>
</pre></div>
</div>
<p>At this point</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ python -m pytest
</pre></div>
</div>
<p>should work and pass, as should:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> docs
$ make html
</pre></div>
</div>
<p>The built documentation can then be found in <code class="docutils literal"><span class="pre">docs/_build/html/</span></code>.</p>
</div>
<div class="section" id="governance">
<h2>Governance<a class="headerlink" href="#governance" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal"><span class="pre">attrs</span></code> is maintained by <a class="reference external" href="https://github.com/python-attrs">team of volunteers</a> that is always open for new members that share our vision of a fast, lean, and magic-free library that empowers programmers to write better code with less effort.
If you’d like to join, just get a pull request merged and ask to be added in the very same pull request!</p>
<p><strong>The simple rule is that everyone is welcome to review/merge pull requests of others but nobody is allowed to merge their own code.</strong></p>
<p><a class="reference external" href="https://hynek.me/about/">Hynek Schlawack</a> acts reluctantly as the <a class="reference external" href="https://en.wikipedia.org/wiki/Benevolent_dictator_for_life">BDFL</a> and has the final say over design decisions.</p>
<hr class="docutils" />
<p>Please note that this project is released with a Contributor <a class="reference external" href="https://github.com/python-attrs/attrs/blob/master/.github/CODE_OF_CONDUCT.rst">Code of Conduct</a>.
By participating in this project you agree to abide by its terms.
Please report any harm to <a class="reference external" href="https://hynek.me/about/">Hynek Schlawack</a> in any way you find appropriate.</p>
<p>Thank you for considering contributing to <code class="docutils literal"><span class="pre">attrs</span></code>!</p>
</div>
</div>
<div class="section" id="contributor-covenant-code-of-conduct">
<h1>Contributor Covenant Code of Conduct<a class="headerlink" href="#contributor-covenant-code-of-conduct" title="Permalink to this headline">¶</a></h1>
<div class="section" id="our-pledge">
<h2>Our Pledge<a class="headerlink" href="#our-pledge" title="Permalink to this headline">¶</a></h2>
<p>In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.</p>
</div>
<div class="section" id="our-standards">
<h2>Our Standards<a class="headerlink" href="#our-standards" title="Permalink to this headline">¶</a></h2>
<p>Examples of behavior that contributes to creating a positive environment include:</p>
<ul class="simple">
<li>Using welcoming and inclusive language</li>
<li>Being respectful of differing viewpoints and experiences</li>
<li>Gracefully accepting constructive criticism</li>
<li>Focusing on what is best for the community</li>
<li>Showing empathy towards other community members</li>
</ul>
<p>Examples of unacceptable behavior by participants include:</p>
<ul class="simple">
<li>The use of sexualized language or imagery and unwelcome sexual attention or advances</li>
<li>Trolling, insulting/derogatory comments, and personal or political attacks</li>
<li>Public or private harassment</li>
<li>Publishing others’ private information, such as a physical or electronic address, without explicit permission</li>
<li>Other conduct which could reasonably be considered inappropriate in a professional setting</li>
</ul>
</div>
<div class="section" id="our-responsibilities">
<h2>Our Responsibilities<a class="headerlink" href="#our-responsibilities" title="Permalink to this headline">¶</a></h2>
<p>Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.</p>
<p>Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.</p>
</div>
<div class="section" id="scope">
<h2>Scope<a class="headerlink" href="#scope" title="Permalink to this headline">¶</a></h2>
<p>This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
Representation of a project may be further defined and clarified by project maintainers.</p>
</div>
<div class="section" id="enforcement">
<h2>Enforcement<a class="headerlink" href="#enforcement" title="Permalink to this headline">¶</a></h2>
<p>Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at <a class="reference external" href="mailto:hs%40ox.cx">hs<span>@</span>ox<span>.</span>cx</a>.
All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.</p>
<p>Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.</p>
</div>
<div class="section" id="attribution">
<h2>Attribution<a class="headerlink" href="#attribution" title="Permalink to this headline">¶</a></h2>
<p>This Code of Conduct is adapted from the <a class="reference external" href="https://www.contributor-covenant.org">Contributor Covenant</a>, version 1.4, available at <<a class="reference external" href="https://www.contributor-covenant.org/version/1/4/code-of-conduct.html">https://www.contributor-covenant.org/version/1/4/code-of-conduct.html</a>>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/attrs_logo.svg" alt="Logo"/>
</a></p>
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">How To Contribute</a><ul>
<li><a class="reference internal" href="#support">Support</a></li>
<li><a class="reference internal" href="#workflow">Workflow</a></li>
<li><a class="reference internal" href="#code">Code</a></li>
<li><a class="reference internal" href="#tests">Tests</a></li>
<li><a class="reference internal" href="#documentation">Documentation</a><ul>
<li><a class="reference internal" href="#changelog">Changelog</a></li>
</ul>
</li>
<li><a class="reference internal" href="#local-development-environment">Local Development Environment</a></li>
<li><a class="reference internal" href="#governance">Governance</a></li>
</ul>
</li>
<li><a class="reference internal" href="#contributor-covenant-code-of-conduct">Contributor Covenant Code of Conduct</a><ul>
<li><a class="reference internal" href="#our-pledge">Our Pledge</a></li>
<li><a class="reference internal" href="#our-standards">Our Standards</a></li>
<li><a class="reference internal" href="#our-responsibilities">Our Responsibilities</a></li>
<li><a class="reference internal" href="#scope">Scope</a></li>
<li><a class="reference internal" href="#enforcement">Enforcement</a></li>
<li><a class="reference internal" href="#attribution">Attribution</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="backward-compatibility.html" title="previous chapter">Backward Compatibility</a></li>
<li>Next: <a href="changelog.html" title="next chapter">Changelog</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2018, Hynek Schlawack.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.7</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
</div>
</body>
</html>
|