Contributing¶
Thank you for your interest in contributing to eftoolkit!
Development Setup¶
-
Clone the repository:
-
Install dependencies with uv:
-
Install pre-commit hooks:
Development Workflow¶
Running Tests¶
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=eftoolkit --cov-report=term-missing
# Run specific test file
uv run pytest tests/sql/test_duckdb.py
Linting and Formatting¶
# Run all pre-commit checks
uv run pre-commit run --all-files
# Run ruff directly
uv run ruff check eftoolkit tests
uv run ruff format eftoolkit tests
Building Documentation¶
Code Style¶
- Follow PEP 8
- Use single quotes for strings
- Use type hints for function signatures
- Write docstrings in Google style
Example¶
def process_data(
df: pd.DataFrame,
*,
filter_empty: bool = True,
) -> pd.DataFrame:
"""Process the input DataFrame.
Args:
df: Input DataFrame to process.
filter_empty: If True, remove empty rows.
Returns:
Processed DataFrame.
Raises:
ValueError: If DataFrame is empty.
"""
if df.empty:
raise ValueError('DataFrame cannot be empty')
if filter_empty:
df = df.dropna()
return df
Testing Guidelines¶
- Write tests for all new functionality
- Use pytest fixtures for setup
- Keep tests focused and independent
- Use moto for mocking S3 operations
- Use
local_preview=Truefor Google Sheets tests
Test Structure¶
tests/
├── conftest.py # Shared fixtures
├── sql/
│ ├── test_duckdb.py
│ └── ...
├── s3/
│ ├── test_read.py
│ └── ...
└── gsheets/
├── test_spreadsheet.py
└── ...
Pull Request Process¶
- Create a feature branch from
main - Make your changes
- Run tests and linting
- Submit a pull request
- Wait for CI to pass and review
PR Checklist¶
- [ ] Tests pass locally (
uv run pytest) - [ ] Linting passes (
uv run pre-commit run --all-files) - [ ] Documentation updated if needed
- [ ] Commit messages are clear
Questions?¶
Open an issue on GitHub.