Thanks for your interest in contributing to Imitatus! This project aims to be a sophisticated, zero-dependency mock HTTP server. This guide will help you understand how to contribute effectively.
- Code of Conduct
- Getting Started
- Development Workflow
- Pull Request Process
- Development Guidelines
- Release Process
By participating in this project, you agree to maintain a respectful and inclusive environment. Key points:
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Accept constructive criticism gracefully
- Focus on what's best for the project
- Show empathy towards other contributors
-
Fork and clone the repository:
git clone https://github.com/serkanaltuntas/imitatus.git cd imitatus
-
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install development dependencies:
make develop # Or manually: pip install -r requirements-dev.txt pip install -e .
imitatus/
├── src/imitatus/ # Source code
│ ├── __init__.py # Package initialization
│ └── server.py # Core server implementation
├── tests/ # Test suite
│ └── test_server.py # Server tests
├── examples/ # Usage examples
├── docs/ # Documentation
└── Makefile # Build and development commands
-
Ensure you're on the latest main branch:
git checkout main git pull origin main
-
Create a feature branch:
git checkout -b feature/feature-name
-
Follow the zero-dependency principle:
- Core functionality should only use Python's standard library
- Development tools can be added to requirements-dev.txt
- Test dependencies can be added to requirements-test.txt
-
Document your changes:
- Add docstrings to new functions and classes
- Update README.md if adding new features
- Add examples for significant features
-
Run the test suite:
make test
-
Run specific test categories:
make test-unit # Unit tests only make test-api # API tests only make test-coverage # Tests with coverage report
-
Writing tests:
- Add tests for all new features
- Maintain test coverage above 90%
- Follow existing test patterns in test_server.py
-
Format your code:
make format # Runs black and isort
-
Check style compliance:
make lint # Runs flake8, black --check, and isort --check
-
Style guidelines:
- Follow PEP 8
- Use type hints where appropriate
- Keep functions focused and modular
- Maintain clear separation of concerns
-
Before submitting:
- Ensure all tests pass
- Run code formatting
- Update documentation
- Add test cases for new features
-
PR Guidelines:
- Use a clear, descriptive title
- Fill out the PR template completely
- Reference any related issues
- Keep changes focused and atomic
-
Review process:
- PRs require approval
- Address all review comments
- Maintain a professional, constructive dialogue
-
Zero-dependency principle:
- Core functionality must use only standard library
- Document any new standard library usage
- Justify any development dependency additions
-
Error handling:
- Use appropriate HTTP status codes
- Provide clear error messages
- Log errors appropriately
- Handle edge cases gracefully
-
Performance considerations:
- Minimize memory usage
- Optimize request handling
- Consider concurrent request handling
-
Security practices:
- Validate all inputs
- Sanitize error messages
- Follow security best practices
- Don't expose sensitive information
-
Version numbering:
- Follow semantic versioning (MAJOR.MINOR.PATCH)
- Document all changes in CHANGELOG.md
-
Release checklist:
- Update version in init.py
- Update CHANGELOG.md
- Run full test suite
- Build and test distribution
- Create GitHub release
- Upload to PyPI
-
Release commands:
make build # Build distribution make publish-test # Upload to TestPyPI make publish # Upload to PyPI
Thanks for contributing to Imitatus! Your contributions help make this project better.
For questions or support:
- Open an issue on GitHub
- Contact me (Serkan Altuntas)
- Join project discussions