PIICatcher Developer Setup

Download PIICatcher from Github or fork

git clone https://github.com/tokern/piicatcher.git

Setup virtualenv

PiiCatcher uses pipenv to setup a development virtualenv.

cd piicatcher
pipenv sync
pipenv shell
piicatcher -h

Setup pre-commit hooks (required if you plan to contribute code)

Pre-commit hooks run the following checks:

  • black
  • mypy
  • flake8
  • isort
pipenv run pre-commit install -t pre-commit

Setup databases in docker for tests

Install docker and docker-compose.

docker-compose -f test/docker-compose.yml up -d

Check if the container are running:

docker ps
CONTAINER ID IMAGE ... CREATED STATUS PORTS NAMES
8b1798a9307d postgres:13 ... 6 days ago Up 6 days 0.0.0.0:5432->5432/tcp postgres
09775e0d564f ghcr.io/linuxserver/mariadb ... 2 months ago Up 6 days 0.0.0.0:3306->3306/tcp mariadb

Run unit tests

pipenv run pytest
# Run tests in a specific file
pipenv run pytest tests/test_sample_database.py