|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Contributions are welcome, and they are greatly appreciated! Every |
| 4 | +little bit helps, and credit will always be given. |
| 5 | + |
| 6 | +You can contribute in many ways: |
| 7 | + |
| 8 | +## Types of Contributions |
| 9 | + |
| 10 | +### Report Bugs |
| 11 | + |
| 12 | +Report bugs at <https://github.com/tr4nt0r/pythonkuma/issues>. |
| 13 | + |
| 14 | +If you are reporting a bug, please include: |
| 15 | + |
| 16 | +- Your operating system name and version. |
| 17 | +- Any details about your local setup that might be helpful in |
| 18 | + troubleshooting. |
| 19 | +- Detailed steps to reproduce the bug. |
| 20 | + |
| 21 | +### Fix Bugs |
| 22 | + |
| 23 | +Look through the GitHub issues for bugs. Anything tagged with "bug" |
| 24 | +and "help wanted" is open to whoever wants to implement it. |
| 25 | + |
| 26 | +### Implement Features |
| 27 | + |
| 28 | +Look through the GitHub issues for features. Anything tagged with |
| 29 | +"enhancement" and "help wanted" is open to whoever wants to |
| 30 | +implement it. |
| 31 | + |
| 32 | +### Write Documentation |
| 33 | + |
| 34 | +Pythonkuma could always use more documentation, whether as part of the |
| 35 | +official Pythonkuma docs, in docstrings, or even on the web in blog |
| 36 | +posts, articles, and such. |
| 37 | + |
| 38 | +### Submit Feedback |
| 39 | + |
| 40 | +The best way to send feedback is to file an issue at |
| 41 | +<https://github.com/tr4nt0r/pythonkuma/issues>. |
| 42 | + |
| 43 | +If you are proposing a feature: |
| 44 | + |
| 45 | +- Explain in detail how it would work. |
| 46 | +- Keep the scope as narrow as possible, to make it easier to |
| 47 | + implement. |
| 48 | +- Remember that this is a volunteer-driven project, and that |
| 49 | + contributions are welcome :) |
| 50 | + |
| 51 | +## Development |
| 52 | + |
| 53 | +Ready to contribute? Here's how to set up `pythonkuma` for |
| 54 | +local development. |
| 55 | + |
| 56 | +### Setup Git |
| 57 | + |
| 58 | +[Fork](https://github.com/tr4nt0r/pythonkuma/fork) the `pythonkuma` repo on GitHub. |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +Clone your fork locally: |
| 63 | + |
| 64 | +```bash |
| 65 | +$ git clone git@github.com:yourusername/pythonkuma.git |
| 66 | +``` |
| 67 | + |
| 68 | +Create a branch for local development: |
| 69 | + |
| 70 | +``` bash |
| 71 | +$ git checkout -b name-of-your-bugfix-or-feature |
| 72 | +``` |
| 73 | + |
| 74 | +Now you can make your changes locally. |
| 75 | + |
| 76 | + |
| 77 | +### Setup environment |
| 78 | + |
| 79 | +We use [Hatch](https://hatch.pypa.io/latest/install/) to manage the development environment and production build. Ensure it's installed on your system. |
| 80 | + |
| 81 | +### Run unit tests |
| 82 | + |
| 83 | +You can run all the tests with: |
| 84 | + |
| 85 | +```bash |
| 86 | +hatch run test |
| 87 | +``` |
| 88 | + |
| 89 | +### Format the code |
| 90 | + |
| 91 | +Execute the following command to apply linting and check typing: |
| 92 | + |
| 93 | +```bash |
| 94 | +hatch run lint |
| 95 | +``` |
| 96 | + |
| 97 | +### Publish a new version |
| 98 | + |
| 99 | +You can bump the version, create a commit and associated tag with one command: |
| 100 | + |
| 101 | +```bash |
| 102 | +hatch version patch |
| 103 | +``` |
| 104 | + |
| 105 | +```bash |
| 106 | +hatch version minor |
| 107 | +``` |
| 108 | + |
| 109 | +```bash |
| 110 | +hatch version major |
| 111 | +``` |
| 112 | + |
| 113 | +Your default Git text editor will open so you can add information about the release. |
| 114 | + |
| 115 | +When you push the tag on GitHub, the workflow will automatically publish it on PyPi and a GitHub release will be created as draft. |
| 116 | + |
| 117 | + |
| 118 | +## Pull Request Guidelines |
| 119 | + |
| 120 | +Before you submit a pull request, check that it meets these guidelines: |
| 121 | + |
| 122 | +1. The pull request should include tests. |
| 123 | +2. If the pull request adds functionality, the docs should be updated. |
| 124 | + Put your new functionality into a function with a docstring, and add |
| 125 | + the feature to the list in README.md. |
| 126 | +3. The pull request should work for Python 3.12 and 3.13. Check |
| 127 | + <https://github.com/tr4nt0r/pythonkuma/actions/workflows/build.yaml> |
| 128 | + and make sure that the tests pass for all supported Python versions. |
| 129 | + |
| 130 | + |
| 131 | +## Serve the documentation |
| 132 | + |
| 133 | +You can serve the Mkdocs documentation with: |
| 134 | + |
| 135 | +```bash |
| 136 | +hatch run docs-serve |
| 137 | +``` |
0 commit comments