From a7a00e1b1f7c56b02ec2c7fcfe9bfd334181a3b6 Mon Sep 17 00:00:00 2001 From: Umut Date: Mon, 23 Sep 2024 18:05:29 +0300 Subject: [PATCH] Introduce `install-watched` Make target --- Cargo.toml | 3 +++ Makefile | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 6cd9c145..032c4ad0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,3 +26,6 @@ lto = true codegen-units = 1 strip = true panic = 'abort' + +[package.metadata.scripts] +install = "pip install -e ." diff --git a/Makefile b/Makefile index f2c0b7c3..53f1a190 100644 --- a/Makefile +++ b/Makefile @@ -14,12 +14,18 @@ venv: # Setup the active virtual environment for development. setup: + cargo install --force cargo-watch + cargo install --force cargo-run-script pip install -e .[test] # Build the latest changes in the rust bindings and install it to the active environment. install: pip install -e . +# Build the latest changes in the rust bindings and install it to the active environment automatically when rust crate changes. +install-watched: + cargo watch -x 'run-script install' + # Run pre-commit checks. pcc: pre-commit run --all-files