Developer setup

Prerequisites

This project uses mise to manage tool versions (Python, PDM, prek). Install mise first:

curl https://mise.run | sh

Or via Homebrew:

brew install mise

Getting started

  1. Clone the repository:

git clone --recursive git@github.com:LedgerHQ/python-erc7730.git
cd python-erc7730
  1. Install tools via mise:

mise trust
mise install

This installs the correct versions of Python, PDM (package manager), and prek (git hooks manager).

  1. Install project dependencies:

pdm install --dev
  1. Install git hooks:

prek install

Common tasks

All project tasks are available as PDM scripts:

Command

Description

pdm run lint

Run all linters/formatters via prek

pdm run test

Run the test suite

pdm run docs

Build documentation (output at docs/build/index.html)

pdm run all

Run lint + test

Linting

Linting is managed by prek, a fast Rust-based drop-in replacement for pre-commit. It uses the same .pre-commit-config.yaml configuration file.

pdm run lint

Testing

pdm run test

By default, deprecated v1 tests and integration tests (full registry) are skipped. To include them:

pdm run test --run-v1           # include deprecated v1 tests
pdm run test --run-integration  # include integration tests against the full registry