|
1 | 1 | # Contributing to Python Project Template |
2 | 2 |
|
3 | | -Hello and welcome! We're excited that you're interested in contributing to the Python |
4 | | -Project Template project. |
| 3 | +Thank you for your interest in contributing to the **Python Project Template**. |
| 4 | +Contributions of all types are welcome, including code, documentation, bug reports, and |
| 5 | +feature requests. This guide outlines the recommended workflow for contributing |
| 6 | +effectively. |
5 | 7 |
|
6 | | -We appreciate all types of contributions whether it's code, documentation, bug reports, |
7 | | -or feature requests. |
| 8 | +## Joining the Project |
8 | 9 |
|
9 | | -## Want to Join the Team? |
| 10 | +If you are interested in contributing or collaborating more closely, feel free to reach |
| 11 | +out to the maintainers. |
10 | 12 |
|
11 | | -If you’re interested in contributing or collaborating more closely, feel free to reach |
12 | | -out!. |
| 13 | +## Ways to Contribute |
13 | 14 |
|
14 | | -## How to Contribute Code |
| 15 | +You can contribute by: |
15 | 16 |
|
16 | | -There are two main ways to contribute: |
| 17 | +- Reporting bugs or requesting new features. |
| 18 | +- Submitting code contributions, including bug fixes, improvements, or new features. |
17 | 19 |
|
18 | | -- Request a **new feature** or report a **bug** |
19 | | -- Submit a **code contribution** (bug fix, feature, improvement, etc.) |
| 20 | +> Note: While we strive to respond promptly, we cannot guarantee an immediate reply due |
| 21 | +> to the number of projects we maintain. |
20 | 22 |
|
21 | | -> Please note: we're actively supporting several projects, so while we’ll do our best to |
22 | | -> respond promptly, we can't always guarantee an immediate reply. |
| 23 | +## Contributing Code |
23 | 24 |
|
24 | 25 | ### Step 1: Open an Issue |
25 | 26 |
|
26 | | -Start by opening an issue to describe your proposal or the problem you've found. This |
27 | | -helps us evaluate and guide the work before coding begins. |
| 27 | +Start by opening an issue to describe your proposed change or the problem you |
| 28 | +encountered. This helps maintainers review and guide the work before coding begins. |
28 | 29 |
|
29 | | -> If your change is small (e.g., a typo fix or minor bug), feel free to skip this and |
30 | | -> open a pull request directly. |
| 30 | +> For minor changes, such as typo fixes, you may skip this step and submit a pull |
| 31 | +> request directly. |
31 | 32 |
|
32 | 33 | ### Step 2: Make Your Changes |
33 | 34 |
|
34 | | -1. Fork this repository. |
35 | | -2. Clone it locally. |
36 | | -3. Create a new branch for your change. |
| 35 | +1. Fork the repository. |
| 36 | +2. Clone your fork locally. |
| 37 | +3. Create a new branch for your changes. |
37 | 38 | 4. Set up your development environment (see [Setup Environment](#setup-environment)). |
38 | | -5. Make your changes and ensure all tests pass. |
| 39 | +5. Implement your changes and ensure all tests pass. |
39 | 40 |
|
40 | 41 | ### Step 3: Submit a Pull Request |
41 | 42 |
|
42 | | -Once your changes are ready, open a pull request (PR) from your forked branch to the |
43 | | -`main` branch. |
| 43 | +Open a pull request (PR) from your branch to the `main` branch of the repository. |
44 | 44 |
|
45 | 45 | ### Step 4: Code Review |
46 | 46 |
|
47 | | -A maintainer will review your PR and may leave feedback. You may be asked to revise the |
48 | | -code, improve formatting, or adjust test coverage. |
| 47 | +A maintainer will review your PR and may provide feedback. You might be asked to: |
49 | 48 |
|
50 | | -> Fix any failing tests and address review comments before re-requesting review. |
| 49 | +- Revise code for correctness or clarity |
| 50 | +- Adjust formatting |
| 51 | +- Improve test coverage |
| 52 | + |
| 53 | +> Address any review comments and ensure all tests pass before requesting a re-review. |
51 | 54 |
|
52 | 55 | ### Step 5: Merge |
53 | 56 |
|
54 | | -Once approved, a maintainer will merge the pull request. |
| 57 | +After approval, a maintainer will merge your pull request. |
55 | 58 |
|
56 | 59 | ## Setup Environment |
57 | 60 |
|
58 | | -You can set up your dev environment in two ways: |
| 61 | +You can set up the development environment in one of two ways: |
59 | 62 |
|
60 | 63 | ### Option 1: Dev Container |
61 | 64 |
|
62 | | -We support Visual Studio Code, GitHub Codespaces, and JetBrains IDEs dev containers for |
63 | | -an easy, preconfigured development setup. |
| 65 | +We support development containers for Visual Studio Code, GitHub Codespaces, and |
| 66 | +JetBrains IDEs. This provides a preconfigured environment for immediate work. |
64 | 67 |
|
65 | 68 | ### Option 2: Local Setup |
66 | 69 |
|
67 | | -To work locally: |
| 70 | +To set up locally: |
68 | 71 |
|
69 | | -1. Install `git`, `python`, and preferably [`uv`](https://github.com/astral-sh/uv). |
70 | | -2. Clone the repository. |
71 | | -3. Run: |
| 72 | +1. Ensure `git` and Python (3.10, 3.11, or 3.12) are installed. |
| 73 | +2. Optionally, install [`uv`](https://github.com/astral-sh/uv) to manage dependency |
| 74 | + groups. |
| 75 | +3. Clone the repository and run: |
72 | 76 |
|
73 | | - ```bash |
74 | | - make install |
75 | | - ``` |
| 77 | +```bash |
| 78 | +make install |
| 79 | +``` |
76 | 80 |
|
77 | | -> The required Python version is defined in `pyproject.toml`. If using `uv`, it will |
78 | | -> create a compatible virtual environment automatically. |
| 81 | +> If using `uv`, a compatible virtual environment will be created automatically. |
79 | 82 |
|
80 | 83 | ## Running Tests |
81 | 84 |
|
82 | | -We use [pytest](https://docs.pytest.org/) for testing. Run all tests with: |
| 85 | +All tests are run using [pytest](https://docs.pytest.org/): |
83 | 86 |
|
84 | 87 | ```bash |
85 | 88 | make tests |
86 | 89 | ``` |
87 | 90 |
|
88 | 91 | ## Code Formatting & Quality Checks |
89 | 92 |
|
90 | | -We use `make` to automate formatting, linting, and checks. Just run: |
| 93 | +Use `make` to automate formatting, linting, static analysis, testing, and documentation: |
91 | 94 |
|
92 | 95 | ```bash |
93 | 96 | make |
94 | 97 | ``` |
95 | 98 |
|
96 | | -This will: |
| 99 | +This executes: |
97 | 100 |
|
98 | | -- Install dependencies |
99 | | -- Run linters (`black`, `isort`, `ruff`, ...) |
100 | | -- Run static analysis (`complexipy`) |
101 | | -- Run tests |
102 | | -- Serve the documentation locally |
| 101 | +- Dependency installation |
| 102 | +- Linters (`ruff`, `black`, `isort`) |
| 103 | +- Static analysis (`complexipy`, `mypy`, `bandit`) |
| 104 | +- Test suite execution |
| 105 | +- Local documentation preview |
103 | 106 |
|
104 | | -## Docstring Style |
| 107 | +## Docstring Guidelines |
105 | 108 |
|
106 | | -A good function docstring typically includes: |
| 109 | +Function docstrings should include: |
107 | 110 |
|
108 | | -- A short one-line description |
109 | | -- Optional longer explanation |
110 | | -- `Args:` section with parameter descriptions |
| 111 | +- A concise one-line description |
| 112 | +- Optional detailed explanation |
| 113 | +- `Args:` section describing parameters |
111 | 114 | - `Returns:` section |
112 | | -- Optional `Raises:` section |
113 | | -- Optional `Examples:` section |
| 115 | +- Optional `Raises:` section for exceptions |
| 116 | +- Optional `Examples:` section demonstrating usage |
114 | 117 |
|
115 | | -Please write clear, concise, and consistent docstrings. |
| 118 | +Maintain clarity, consistency, and completeness in docstrings. |
116 | 119 |
|
117 | 120 | ## Other Ways to Contribute |
118 | 121 |
|
119 | | -Not a fan of writing code? You can still help by: |
| 122 | +Non-code contributions are highly valuable, including: |
120 | 123 |
|
121 | 124 | - Improving documentation or examples |
122 | | -- Fixing typos or grammar |
123 | | -- Suggesting features or usability improvements |
124 | | -- Helping triage and respond to issues |
| 125 | +- Fixing typos and grammar issues |
| 126 | +- Suggesting features or enhancements |
| 127 | +- Assisting with issue triage and responses |
125 | 128 |
|
126 | | -Thank you for being part of Python Project Template's journey. We’re thrilled to have |
127 | | -you here. If you have questions, feel free to reach out or open an issue. |
| 129 | +Thank you for contributing to the Python Project Template. Your participation helps |
| 130 | +improve the project for everyone. If you have questions, feel free to reach out or open |
| 131 | +an issue. |
0 commit comments