|
| 1 | +# Contributing to my_python_package |
| 2 | + |
| 3 | +Thank you for considering contributing to my_python_package! This document provides guidelines and instructions for contributing. |
| 4 | + |
| 5 | +## Code of Conduct |
| 6 | + |
| 7 | +Please be respectful and considerate of others when contributing to this project. We aim to foster an inclusive and welcoming community. |
| 8 | + |
| 9 | +## How to Contribute |
| 10 | + |
| 11 | +### Reporting Bugs |
| 12 | + |
| 13 | +If you find a bug, please create an issue using the bug report template. Include: |
| 14 | + |
| 15 | +1. A clear title and description |
| 16 | +2. Steps to reproduce the behavior |
| 17 | +3. Expected behavior |
| 18 | +4. Actual behavior |
| 19 | +5. Environment details (OS, Python version, package version) |
| 20 | + |
| 21 | +### Suggesting Enhancements |
| 22 | + |
| 23 | +For feature requests, please use the feature request template. Include: |
| 24 | + |
| 25 | +1. A clear title and description |
| 26 | +2. Why this feature would be useful |
| 27 | +3. Any potential implementation details |
| 28 | + |
| 29 | +### Pull Requests |
| 30 | + |
| 31 | +1. Fork the repository |
| 32 | +2. Create a new branch (`git checkout -b feature/amazing-feature`) |
| 33 | +3. Make your changes |
| 34 | +4. Run tests (`make test`) |
| 35 | +5. Commit your changes (`git commit -m 'Add amazing feature'`) |
| 36 | +6. Push to the branch (`git push origin feature/amazing-feature`) |
| 37 | +7. Open a Pull Request |
| 38 | + |
| 39 | +## Development Setup |
| 40 | + |
| 41 | +### Local Environment |
| 42 | + |
| 43 | +1. Clone the repository: |
| 44 | + ```bash |
| 45 | + git clone https://github.com/DiogoRibeiro7/my_python_package.git |
| 46 | + cd my_python_package |
| 47 | + ``` |
| 48 | + |
| 49 | +2. Install dependencies with Poetry: |
| 50 | + ```bash |
| 51 | + poetry install |
| 52 | + ``` |
| 53 | + |
| 54 | +3. Set up pre-commit hooks: |
| 55 | + ```bash |
| 56 | + pre-commit install |
| 57 | + ``` |
| 58 | + |
| 59 | +### Using Docker |
| 60 | + |
| 61 | +Alternatively, you can use Docker: |
| 62 | + |
| 63 | +```bash |
| 64 | +docker-compose up app # Run the application |
| 65 | +docker-compose up test # Run tests |
| 66 | +docker-compose up lint # Run linting |
| 67 | +docker-compose up type-check # Run type checking |
| 68 | +``` |
| 69 | + |
| 70 | +## Development Workflow |
| 71 | + |
| 72 | +1. Make sure your code passes all checks: |
| 73 | + ```bash |
| 74 | + make lint |
| 75 | + make type-check |
| 76 | + make test |
| 77 | + ``` |
| 78 | + |
| 79 | +2. Update documentation if needed: |
| 80 | + ```bash |
| 81 | + python scripts/generate_docs.py |
| 82 | + ``` |
| 83 | + |
| 84 | +3. Update the CHANGELOG.md with your changes under the [Unreleased] section |
| 85 | + |
| 86 | +## Coding Standards |
| 87 | + |
| 88 | +- Follow PEP 8 style guidelines |
| 89 | +- Include docstrings for all functions, classes, and modules |
| 90 | +- Add type hints to all function parameters and return values |
| 91 | +- Write tests for all new functionality |
| 92 | +- Ensure test coverage is maintained or improved |
| 93 | + |
| 94 | +## Commit Messages |
| 95 | + |
| 96 | +Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification: |
| 97 | + |
| 98 | +- `feat:` - A new feature |
| 99 | +- `fix:` - A bug fix |
| 100 | +- `docs:` - Documentation changes |
| 101 | +- `style:` - Changes that do not affect code logic |
| 102 | +- `refactor:` - Code changes that neither fix a bug nor add a feature |
| 103 | +- `perf:` - Performance improvements |
| 104 | +- `test:` - Adding or correcting tests |
| 105 | +- `build:` - Changes to build system or dependencies |
| 106 | +- `ci:` - Changes to CI configuration |
| 107 | +- `chore:` - Other changes that don't modify source or test files |
| 108 | + |
| 109 | +## Release Process |
| 110 | + |
| 111 | +1. Update version number in pyproject.toml |
| 112 | +2. Update CHANGELOG.md with release date |
| 113 | +3. Create a tag with the version number |
| 114 | +4. Push the tag to GitHub |
| 115 | +5. Build and publish to PyPI: |
| 116 | + ```bash |
| 117 | + make publish |
| 118 | + ``` |
| 119 | + |
| 120 | +## Questions? |
| 121 | + |
| 122 | +If you have any questions, feel free to open an issue or contact the maintainers. |
| 123 | + |
| 124 | +Thank you for contributing! |
0 commit comments