Development Workflow¶
Code Style¶
Follow the Code Style and Standards section.
Testing¶
Running Tests¶
# Run all tests
make test
# Run specific test file
pipenv run pytest tests/path/to/test_file.py
# Run with coverage
make coverage
Writing Tests¶
- Place tests in the
tests/
directory - Follow the same directory structure as the source code
- Name test files with
test_
prefix - Use pytest fixtures for common setup
- Aim for 100% test coverage for new code
Debugging¶
Local Debugging¶
-
Use Python debugger (pdb):
-
VSCode debugging:
- Set breakpoints in the editor
- Use the Run and Debug panel
- Configure
launch.json
for your specific needs
Logging¶
- Use the loguru module
- Configure log levels appropriately (debug, info, warning, error, critical)
GitHub Workflows¶
The project uses several GitHub Actions workflows:
Main Workflow (main.yml
)¶
- Runs on every push and pull request
- Performs linting and testing
- Checks code formatting
- Generates coverage report
Documentation Workflow (deploy-docs.yml
)¶
- Builds and deploys documentation to GitHub Pages
- Triggers on pushes to main branch
- Uses MkDocs Material theme
Docker Workflow (docker.yml
)¶
- Builds and pushes Docker images
- Runs on releases and main branch pushes
- Tags images appropriately
Release Process¶
- Update version in
pyproject.toml
- Update CHANGELOG.md
- Create a new release on GitHub
- Tag the release following semantic versioning
- CI/CD will automatically:
- Build and test the package
- Deploy documentation
- Push Docker images
- Publish to PyPI