Skip to content

Developer Guide

This guide helps contributors and developers work on Clipper locally.


๐Ÿ›  Local Development Setup

  1. Clone the repository:
git clone https://github.com/yourusername/clipper.git
cd clipper
````

2. Create a virtual environment and activate it:

```bash
python -m venv venv
source venv/bin/activate        # On Windows: venv\Scripts\activate
  1. Install the package in editable mode with development dependencies:
pip install -e .[dev]

๐Ÿงช Run Tests

Clipper uses pytest for testing.

To run all tests:

pytest

To run only unit tests (skip integration):

pytest -m "not integration"

To run integration tests:

CLIPPER_ENABLE_INTEGRATION=1 pytest

๐Ÿ“ฆ Building and Uploading

To build the distribution:

python -m build

To upload to PyPI:

twine upload dist/*

Or to test it on TestPyPI:

twine upload --repository-url https://test.pypi.org/legacy/ dist/*

๐Ÿงฑ Project Structure

clipper/
โ”œโ”€โ”€ __main__.py     โ† CLI entry point
โ”œโ”€โ”€ core.py         โ† Main Clipper logic
โ”œโ”€โ”€ config.py       โ† Config loader
โ”œโ”€โ”€ prompts.py      โ† Prompt file utilities
โ”œโ”€โ”€ utils.py        โ† Logging & helper functions
tests/
โ”œโ”€โ”€ test_cli.py     โ† CLI integration tests
โ”œโ”€โ”€ test_core.py    โ† Unit tests for core logic
generated_images/   โ† Output folder
prompt_log.jsonl    โ† Log of all prompts & metadata

โœ… Contributions

  • Feel free to open issues or PRs
  • Style guide: keep it Pythonic + documented
  • Use clear commit messages and test your changes

Thanks for helping improve Clipper-AI!