|
| 1 | +# Contributing to `opengsq-python` |
| 2 | + |
| 3 | +Thank you for your interest in contributing to OpenGSQ Python. This guide will help you get started with the contribution process. |
| 4 | + |
| 5 | +## Code of Conduct |
| 6 | + |
| 7 | +This project and everyone participating in it is governed by our [Code of Conduct](/CODE_OF_CONDUCT.md) By participating, you are expected to uphold this code. |
| 8 | + |
| 9 | +## Project Structure |
| 10 | + |
| 11 | +The `opengsq-python` is organized as follows: |
| 12 | + |
| 13 | +- `/docs` - Documentation |
| 14 | +- `/opengsq` - Core opengsq library |
| 15 | +- `/tests` - Tests |
| 16 | + |
| 17 | +## Development Guidelines |
| 18 | + |
| 19 | +When contributing to `opengsq-python`: |
| 20 | + |
| 21 | +- Keep changes focused. Large PRs are harder to review and unlikely to be accepted. We recommend opening an issue and discussing it with us first. |
| 22 | +- Write clear, self-explanatory code. Use comments only when truly necessary. |
| 23 | +- Follow the existing code style and conventions. |
| 24 | + |
| 25 | +## Getting Started |
| 26 | + |
| 27 | +1. Fork the repository to your GitHub account |
| 28 | +2. Clone your fork locally: |
| 29 | + ```bash |
| 30 | + git clone https://github.com/your-username/opengsq-python.git |
| 31 | + cd opengsq-python |
| 32 | + ``` |
| 33 | +3. Create a Virtual Python Environment |
| 34 | + ```bash |
| 35 | + python -m venv venv |
| 36 | + ``` |
| 37 | +4. Activate the Environment |
| 38 | + #### Windows |
| 39 | + ```bash |
| 40 | + venv\Scripts\activate.bat |
| 41 | + ``` |
| 42 | + #### Linux, Mac |
| 43 | + ```bash |
| 44 | + source venv/bin/activate |
| 45 | + ``` |
| 46 | +6. Install Python dependencies |
| 47 | + ```bash |
| 48 | + pip install -r requirements.txt |
| 49 | + ``` |
| 50 | +7. Install Python dependencies (tests) |
| 51 | + ```bash |
| 52 | + pip install -r tests/requirements.txt |
| 53 | + ``` |
| 54 | +8. Install Python dependencies (docs) |
| 55 | + ```bash |
| 56 | + pip install -r docs/requirements.txt |
| 57 | + ``` |
| 58 | + |
| 59 | +## Code Formatting with Ruff |
| 60 | + |
| 61 | +We use [Ruff](https://github.com/astral-sh/ruff) for code formatting and linting. Before committing, please ensure your code is properly formatted: |
| 62 | + |
| 63 | +```bash |
| 64 | +# Format all code |
| 65 | +ruff format |
| 66 | + |
| 67 | +# Check for linting issues |
| 68 | +ruff check |
| 69 | +``` |
| 70 | + |
| 71 | +## Documentation (`/docs`) |
| 72 | + |
| 73 | +1. Sphinx API Documentation Generation |
| 74 | +```bash |
| 75 | +sphinx-apidoc -o docs/api opengsq |
| 76 | +``` |
| 77 | + |
| 78 | +2. Sphinx HTML Documentation Build |
| 79 | +```bash |
| 80 | +sphinx-build -b html docs docs/_build |
| 81 | +``` |
| 82 | + |
| 83 | +- Keep documentation up-to-date with code changes |
| 84 | +- Use clear, concise language |
| 85 | +- Include code examples for common use cases |
| 86 | +- Document any breaking changes in the migration guide |
| 87 | +- Follow the existing documentation style and structure |
0 commit comments