Thank you for your interest in contributing to TSignal! This document provides guidelines and instructions for contributing to the project.
- Fork and clone the repository:
git clone https://github.com/TSignalDev/tsignal-python.git
cd tsignal-python
- Create a virtual environment and install development dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e ".[dev]"
We follow these coding conventions:
- PEP 8 style guide
- Maximum line length of 88 characters (Black default)
- Type hints for function arguments and return values
- Docstrings for all public modules, functions, classes, and methods
Run the test suite before submitting changes:
# Run all tests
pytest
# Run with coverage
pytest --cov=tsignal
# Run specific test file
pytest tests/unit/test_signal.py
# Enable debug logging during tests
TSIGNAL_DEBUG=1 pytest
- Create a new branch for your feature or bugfix:
git checkout -b feature-name
- Make your changes and commit them:
git add .
git commit -m "Description of changes"
-
Ensure your changes include:
- Tests for any new functionality
- Documentation updates if needed
- No unnecessary debug prints or commented code
- Type hints for new functions/methods
-
Push your changes and create a pull request:
git push origin feature-name
- In your pull request description:
- Describe what the changes do
- Reference any related issues
- Note any breaking changes
- Include examples if applicable
- Start with tests
- Implement the feature
- Update documentation
- Add examples if applicable
Use appropriate log levels:
import logging
logger = logging.getLogger(__name__)
# Debug information
logger.debug("Detailed connection info")
# Important state changes
logger.info("Signal connected successfully")
# Warning conditions
logger.warning("Multiple connections detected")
# Errors
logger.error("Failed to emit signal", exc_info=True)
- Be respectful and inclusive
- Focus on constructive criticism
- Accept feedback gracefully
- Put the project's best interests first
Violations of the code of conduct may result in:
- Warning
- Temporary ban
- Permanent ban
Report issues to project maintainers via email.
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT License).