Debian Codegraph @

CONTRIBUTING.rst

raw
1 Contributing Guidelines
2 =======================
3
4 Security Contact Information
5 ----------------------------
6
7 To report a security vulnerability, please use the
8 `Tidelift security contact <https://tidelift.com/security>`_.
9 Tidelift will coordinate the fix and disclosure.
10
11 Questions, Feature Requests, Bug Reports, and Feedback. . .
12 -----------------------------------------------------------
13
14 . . .should all be reported on the `GitHub Issue Tracker`_ .
15
16 .. _`GitHub Issue Tracker`: https://github.com/marshmallow-code/apispec/issues?state=open
17
18 Contributing Code
19 -----------------
20
21 Setting Up for Local Development
22 ++++++++++++++++++++++++++++++++
23
24 1. Fork apispec_ on GitHub.
25
26 ::
27
28 $ git clone https://github.com/marshmallow-code/apispec.git
29 $ cd apispec
30
31 2. Install development requirements. **It is highly recommended that you use a virtualenv.**
32 Use the following command to install an editable version of
33 apispec along with its development requirements.
34
35 ::
36
37 # After activating your virtualenv
38 $ pip install -e '.[dev]'
39
40 3. Install the pre-commit hooks, which will format and lint your git staged files.
41
42 ::
43
44 # The pre-commit CLI was installed above
45 $ pre-commit install
46
47
48 Git Branch Structure
49 ++++++++++++++++++++
50
51 apispec abides by the following branching model:
52
53
54 ``dev``
55 Current development branch. **New features should branch off here**.
56
57 ``X.Y-line``
58 Maintenance branch for release ``X.Y``. **Bug fixes should be sent to the most recent release branch.** The maintainer will forward-port the fix to ``dev``. Note: exceptions may be made for bug fixes that introduce large code changes.
59
60 **Always make a new branch for your work**, no matter how small. Also, **do not put unrelated changes in the same branch or pull request**. This makes it more difficult to merge your changes.
61
62 Pull Requests
63 ++++++++++++++
64
65 1. Create a new local branch.
66
67 ::
68
69 # For a new feature
70 $ git checkout -b name-of-feature dev
71
72 # For a bugfix
73 $ git checkout -b fix-something 1.2-line
74
75 2. Commit your changes. Write `good commit messages <http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html>`_.
76
77 ::
78
79 $ git commit -m "Detailed commit message"
80 $ git push origin name-of-feature
81
82 3. Before submitting a pull request, check the following:
83
84 - If the pull request adds functionality, it is tested and the docs are updated.
85 - You've added yourself to ``AUTHORS.rst``.
86
87 4. Submit a pull request to ``marshmallow-code:dev`` or the appropriate maintenance branch.
88 The `CI <https://dev.azure.com/sloria/sloria/_build/latest?definitionId=8&branchName=dev>`_
89 build must be passing before your pull request is merged.
90
91 Running Tests
92 +++++++++++++
93
94 To run all tests: ::
95
96 $ pytest
97
98 To run syntax checks: ::
99
100 $ tox -e lint
101
102 (Optional) To run tests in all supported Python versions in their own virtual environments (must have each interpreter installed): ::
103
104 $ tox
105
106 Documentation
107 +++++++++++++
108
109 Contributions to the documentation are welcome. Documentation is written in `reStructuredText`_ (rST). A quick rST reference can be found `here <https://docutils.sourceforge.io/docs/user/rst/quickref.html>`_. Builds are powered by Sphinx_.
110
111 To build the docs in "watch" mode: ::
112
113 $ tox -e docs-serve
114
115 Changes in the `docs/` directory will automatically trigger a rebuild.
116
117 .. _Sphinx: http://sphinx.pocoo.org/
118 .. _`reStructuredText`: https://docutils.sourceforge.io/rst.html
119 .. _`apispec`: https://github.com/marshmallow-code/apispec