This project uses various tools to maintain code quality and includes a Makefile for common development tasks. The Makefile is cross-platform compatible and works on both Windows and Linux/macOS.
To use the Makefile on Windows, you must run make via Windows Subsystem for Linux (WSL).
- Install Windows Subsystem for Linux (WSL)
- Run the
makecommands from a WSL shell (e.g., Ubuntu)
Alternative for Windows users: If you prefer not to use WSL, you can use the provided alternative scripts:
PowerShell:
.\dev-tools.ps1 help # Show all available commands
.\dev-tools.ps1 setup # Set up development environment
.\dev-tools.ps1 install # Install dependencies
# ... (same commands as make)Command Prompt (Batch):
.\dev-tools.bat help # Show all available commands
.\dev-tools.bat setup # Set up development environment
.\dev-tools.bat install # Install dependencies
# ... (same commands as make)make help # Show all available commands
make setup # Set up development environment
make install # Install dependencies
make install-dev # Install development dependencies
make format # Format code with ruff
make lint # Run all linting checks
make lint-fix # Run linting and fix what can be auto-fixed
make test # Run tests
make test-cov # Run tests with coverage
make pre-commit # Run pre-commit hooks on all files
make clean # Clean cache and temporary filesTo quickly configure the development environment:
make setup# Production dependencies only
make install
# Development dependencies
make install-devPre-commit hooks are automatically executed on each commit to verify code quality.
make pre-commit-installmake pre-commitmake formatmake lintmake lint-fixmake testmake test-covmake setup- Sets up the complete development environmentmake install- Installs production dependenciesmake install-dev- Installs development dependenciesmake format- Formats code with black and isortmake lint- Runs all linting checksmake lint-fix- Runs linting and automatically fixes issuesmake test- Runs testsmake test-cov- Runs tests with coveragemake pre-commit- Runs pre-commit on all filesmake pre-commit-install- Installs pre-commit hooksmake clean- Cleans cache and temporary files
ruff format edge_mining/ruff check edge_mining/Use the option --ignore=E501 to disable line length checks.
ruff check edge_mining/ --ignore=E501mypy edge_mining/bandit -r edge_mining/.pre-commit-config.yaml: Pre-commit hooks configurationpyproject.toml: Configuration for mypy, ruff, bandit, pytest and coveragerequirements-dev.txt: Development dependenciesMakefile: Automation commands
If pre-commit doesn't work properly:
- Make sure git is initialized:
git init - Reinstall pre-commit:
make pre-commit-install - Update hooks:
pre-commit autoupdate
If you have dependency issues:
- Clean the environment:
make clean - Recreate the virtual environment:
python -m venv .venv - Reinstall dependencies:
make setup