CONTRIBUTING.rst 4.53 KB
Newer Older
dboe's avatar
dboe committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.. highlight:: shell

============
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

dboe's avatar
dboe committed
18
Report bugs at https://gitlab.mpcdf.mpg.de/dboe/rna/issues.
dboe's avatar
dboe committed
19
20
21
22
23
24
25

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.
* Detailed steps to reproduce the bug.

dboe's avatar
dboe committed
26
27
28
If you want quick feedback, it is helpful to mention speicific developers
(@devloper_name) or @all. This will trigger a mail to the corresponding developer(s).

dboe's avatar
dboe committed
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
Fix Bugs
~~~~~~~~

Look through the repository issues for bugs. Anything tagged with "bug" and "help
wanted" is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the remote issues for features. Anything tagged with "enhancement"
and "help wanted" is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

`rna` could always use more :ref:`documentation<Documentation>`, whether as part of the
official `rna` docs, in docstrings, or even on the web in blog posts,
articles, and such.

Write Unittests or Doctests
~~~~~~~~~~~~~~~~~~~~~~~~~~~

`rna` profits a lot from better :ref:`testing<Testing>`. We encourage you to add unittests 
(in the `tests` directory) or doctests (as part of docstrings or in the documentation).

Submit Feedback
~~~~~~~~~~~~~~~

dboe's avatar
dboe committed
57
The best way to send feedback is to file an `Issue <https://gitlab.mpcdf.mpg.de/dboe/rna/issues>`_.
dboe's avatar
dboe committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
  are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `rna` for local development.

1. Fork the `rna` repo.
2. Clone your fork locally::

dboe's avatar
dboe committed
74
    $ git clone git@gitlab.mpcdf.mpg.de:dboe/rna.git
dboe's avatar
dboe committed
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

3. Set up your fork for local development::

    $ cd rna/
    $ pip install .[dev]

4. Step 3. already installed `pre-commit <https://pre-commit.com/>`_. Initialize it by running::

    $ pre-commit install

5. Create a branch for local development::

    $ git checkout -b name-of-your-bugfix-or-feature

   Now you can make your changes locally.

6. When you're done making changes, check that your changes pass flake8 and the
   tests::

    $ make test

7. Commit your changes and push your branch to origin::

    $ git add .
    $ git commit -m "Your detailed description of your changes."
    $ git push origin name-of-your-bugfix-or-feature

8. Submit a pull request through the repository website.

Pull Request Guidelines
-----------------------

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
   your new functionality into a function with a docstring, and add the
   feature to the list in README.rst.
3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
dboe's avatar
dboe committed
114
   https://gitlab.mpcdf.mpg.de/dboe/rna/-/merge_requests
dboe's avatar
dboe committed
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
   and make sure that the tests pass for all supported Python versions.

Testing
-------

To run tests, use::

    $ make test

To run a subset of tests, you have the following options::

    $ pytest tests/test_package.py

    $ pytest tests/test_package.py::Test_rna::test_version_type

    $ pytest --doctest-modules docs/usage.rst

    $ pytest --doctest-modules rna/core.py -k "MyClass.funciton_with_doctest"

Use the '--trace' option to directly jump into a pdb debugger on fails. Check out the coverage of your api with::

    $ make coverage

Documentation
-------------
To compile the documentation (including automatically generated module api docs), run::

    $ make doc

Use doctests as much as possible in order to have tested examples in your documentation.

Styleguide
-----------
Please follow the `google style guide <https://google.github.io/styleguide/pyguide.html>`_ illustrated
by `this example <https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html>`_.

Deploying
---------

A reminder for the maintainers on how to deploy.
Make sure all your changes are committed.
Then run::

    $ bump2version patch # possible: major / minor / patch
    $ git push
    $ git push --tags

or use the convenient alias for the above (patch increases only)::

    $ make publish

The CI will then deploy to PyPI if tests pass.