Installation
Install from PyPI (once published):
# From PyPI
pip install merrypopins
# For development
git clone https://github.com/SerpRateAI/merrypopins.git
cd merrypopins
pip install -e .
merrypopins supports Python 3.10+ and depends on:
matplotlib
numpy
pandas
scipy
scikit-learn
tensorflow
These are installed automatically via pip
.
All core and development dependencies are tested with Python 3.10 through 3.12.
Development & Testing
- Install development requirements: This installs the main package and development dependencies listed in pyproject.toml under [project.optional-dependencies].dev
Optionally, you can install development dependencies via:
🔧 Pre-commit Hooks
We rely on pre-commit to auto-run ruff (lint) and black (format) against every change before it is committed.
If these checks are not executed locally, your PR will fail in CI.
🚨 Important: You must have the
pre-commit
package installed globally
(pip install --user pre-commit
or via the project’s dev extras) before making commits.
Setup (Run once per clone)
# 1) Install the tool (only needed if it’s not already on your system)
pip install pre-commit # or: pip install -e '.[dev]'
# 2) Install the Git hooks defined in .pre-commit-config.yaml
pre-commit install
This adds a Git hook that formats / lints the staged files automatically at each git commit
.
Run Checks Manually
To run all checks on all files:
What if the hook rejects my commit?
If pre-commit
finds issues (usually formatting via black or lint via ruff),
the commit will abort and the affected files will be modified in-place to satisfy the rules.
- Open Source Control (e.g. the Git sidebar in VS Code).
- You will see the updated (but unstaged) files.
- Click the âž• (stage) button next to each fixed file or
git add <file>
. - Re-run
git commit
– it should now succeed. - Finally, push your branch to the remote.
Tip: always run
pre-commit run --all-files
before making a commit to catch issues early.
Notes:
- Hooks are defined in .pre-commit-config.yaml
.
- You can exclude specific files or directories (e.g., tutorials/
) by modifying the config file .pre-commit-config.yaml
.
- CI will re-run the same hooks; commits that bypass them locally will be rejected.
🧪 Running Tests
-
Run tests with coverage:
This command runs all tests in thetests/
directory and generates a coverage report showing which lines of code were executed during the tests. Tests and linting are automatically run on each pull request via GitHub Actions. The CI uses Python 3.10–3.12 and runs pre-commit, pytest, and coverage checks. -
Generate HTML coverage report: