git clone https://github.com/luno/luno-python.gitcd luno-python
python -m venv env
source env/bin/activatepython -m pip install --upgrade pip setuptools wheel
pip install -e '.[dev]'This installs the package in editable mode with all development dependencies including testing tools and pre-commit hooks.
This project uses pre-commit to maintain code quality and consistency. The hooks run automatically before commits and pushes.
pre-commit installThis will run code formatting, linting, security checks, and tests on every commit.
To run all hooks on all files manually:
pre-commit run --all-files- Code formatting: Automatically formats code with
blackand sorts imports withisort - Linting: Checks code quality with
flake8 - Security: Scans for common security issues with
bandit - File checks: Fixes trailing whitespace, ensures files end with newlines, validates YAML/JSON
- Tests: Runs the full test suite (via
pytest)
If you need to skip hooks for a specific commit:
git commit --no-verifypytest