Debian Codegraph @

CONTRIBUTING.rst

raw
1 .. highlight:: shell
2
3 ============
4 Contributing
5 ============
6
7 Contributions are welcome, and they are greatly appreciated! Every little bit
8 helps, and credit will always be given.
9
10 You can contribute in many ways:
11
12 Types of Contributions
13 ----------------------
14
15 Report Bugs
16 ~~~~~~~~~~~
17
18 Report bugs at https://github.com/blebox/blebox_uniapi/issues.
19
20 If you are reporting a bug, please include:
21
22 * Your operating system name and version.
23 * Any details about your local setup that might be helpful in troubleshooting.
24 * Detailed steps to reproduce the bug.
25
26 Fix Bugs
27 ~~~~~~~~
28
29 Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
30 wanted" is open to whoever wants to implement it.
31
32 Implement Features
33 ~~~~~~~~~~~~~~~~~~
34
35 Look through the GitHub issues for features. Anything tagged with "enhancement"
36 and "help wanted" is open to whoever wants to implement it.
37
38 Write Documentation
39 ~~~~~~~~~~~~~~~~~~~
40
41 BleBox Python UniAPI could always use more documentation, whether as part of the
42 official BleBox Python UniAPI docs, in docstrings, or even on the web in blog posts,
43 articles, and such.
44
45 Submit Feedback
46 ~~~~~~~~~~~~~~~
47
48 The best way to send feedback is to file an issue at https://github.com/blebox/blebox_uniapi/issues.
49
50 If you are proposing a feature:
51
52 * Explain in detail how it would work.
53 * Keep the scope as narrow as possible, to make it easier to implement.
54 * Remember that this is a volunteer-driven project, and that contributions
55 are welcome :)
56
57 Get Started!
58 ------------
59
60 Ready to contribute? Here's how to set up `blebox_uniapi` for local development.
61
62 1. Fork the `blebox_uniapi` repo on GitHub.
63 2. Clone your fork locally::
64
65 $ git clone [email protected]:your_name_here/blebox_uniapi.git
66
67 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
68
69 $ mkvirtualenv blebox_uniapi
70 $ cd blebox_uniapi/
71 $ python setup.py develop
72
73 4. Create a branch for local development::
74
75 $ git checkout -b name-of-your-bugfix-or-feature
76
77 Now you can make your changes locally.
78
79 5. When you're done making changes, check that your changes pass flake8 and the
80 tests, including testing other Python versions with tox::
81
82 $ flake8 blebox_uniapi tests
83 $ python setup.py test or pytest
84 $ tox
85
86 To get flake8 and tox, just pip install them into your virtualenv.
87
88 6. Commit your changes and push your branch to GitHub::
89
90 $ git add .
91 $ git commit -m "Your detailed description of your changes."
92 $ git push origin name-of-your-bugfix-or-feature
93
94 7. Submit a pull request through the GitHub website.
95
96 Pull Request Guidelines
97 -----------------------
98
99 Before you submit a pull request, check that it meets these guidelines:
100
101 1. The pull request should include tests.
102 2. If the pull request adds functionality, the docs should be updated. Put
103 your new functionality into a function with a docstring, and add the
104 feature to the list in README.rst.
105 3. The pull request should work for Python 3.6, 3.7 and 3.8, and for PyPy. Check
106 https://travis-ci.com/gadgetmobile/blebox_uniapi/pull_requests
107 and make sure that the tests pass for all supported Python versions.
108
109 Tips
110 ----
111
112 To run a subset of tests::
113
114 $ pytest tests.test_blebox_uniapi
115
116
117 Deploying
118 ---------
119
120 A reminder for the maintainers on how to deploy.
121 Make sure all your changes are committed (including an entry in HISTORY.rst).
122 Then run::
123
124 $ bump2version patch # possible: major / minor / patch
125 $ git push --follow-tags
126
127 bump2version bumps the version in setup.py, blebox_uniapi/__init__.py and
128 setup.cfg, commits the change and creates a matching git tag (e.g. v2.6.0).
129 Pushing the tag triggers the "Publish to PyPI" GitHub Actions workflow
130 (.github/workflows/release.yml), which first runs lint + tests, then builds and
131 uploads to PyPI via Trusted Publishing (OIDC) from the blebox/blebox_uniapi repo.
132 The publish step only runs if the tests pass.