diff --git a/Makefile b/Makefile index c8fe57356a..6a86069725 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,21 @@ STARKNET_SIERRA_COMPILE_CAIRO_1:=cairo1/bin/starknet-sierra-compile STARKNET_COMPILE_CAIRO_2:=cairo2/bin/starknet-compile STARKNET_SIERRA_COMPILE_CAIRO_2:=cairo2/bin/starknet-sierra-compile +export PATH:=$(PATH):$(HOME)/.cargo/bin + ifndef PROPTEST_CASES PROPTEST_CASES:=10 export PROPTEST_CASES endif +ifeq (, $(shell which uv)) + PIP_CMD=python -m pip + VENV_CMD=python -m venv +else + PIP_CMD=uv pip + VENV_CMD=uv venv +endif + .PHONY: build-cairo-1-compiler build-cairo-1-compiler-macos build-cairo-2-compiler build-cairo-2-compiler-macos \ deps deps-macos cargo-deps build run check test clippy coverage benchmark flamegraph\ compare_benchmarks_deps compare_benchmarks docs clean \ @@ -215,6 +225,9 @@ build-cairo-2-compiler: && mv cairo/ cairo2/; \ fi +uv-program: + curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.1.41/uv-installer.sh | sh + cargo-deps: cargo install --version 0.3.1 iai-callgrind-runner cargo install --version 1.1.0 cargo-criterion @@ -229,23 +242,23 @@ cairo1-run-deps: deps: create-proof-programs-symlinks cargo-deps build-cairo-1-compiler build-cairo-2-compiler cairo1-run-deps pyenv install -s pypy3.9-7.3.9 - PYENV_VERSION=pypy3.9-7.3.9 python -m venv cairo-vm-pypy-env + PYENV_VERSION=pypy3.9-7.3.9 $(VENV_CMD) cairo-vm-pypy-env . cairo-vm-pypy-env/bin/activate ; \ - pip install -r requirements.txt ; \ + $(PIP_CMD) install -r requirements.txt ; \ pyenv install -s 3.9.15 - PYENV_VERSION=3.9.15 python -m venv cairo-vm-env + PYENV_VERSION=3.9.15 $(VENV_CMD) cairo-vm-env . cairo-vm-env/bin/activate ; \ - pip install -r requirements.txt ; \ + $(PIP_CMD) install -r requirements.txt ; \ deps-macos: create-proof-programs-symlinks cargo-deps build-cairo-1-compiler-macos build-cairo-2-compiler-macos cairo1-run-deps arch -x86_64 pyenv install -s pypy3.9-7.3.9 - PYENV_VERSION=pypy3.9-7.3.9 python -m venv cairo-vm-pypy-env + PYENV_VERSION=pypy3.9-7.3.9 $(VENV_CMD) cairo-vm-pypy-env . cairo-vm-pypy-env/bin/activate ; \ - CFLAGS=-I/opt/homebrew/opt/gmp/include LDFLAGS=-L/opt/homebrew/opt/gmp/lib pip install -r requirements.txt ; \ + CFLAGS=-I/opt/homebrew/opt/gmp/include LDFLAGS=-L/opt/homebrew/opt/gmp/lib $(PIP_CMD) install -r requirements.txt ; \ pyenv install -s 3.9.15 - PYENV_VERSION=3.9.15 python -m venv cairo-vm-env + PYENV_VERSION=3.9.15 $(VENV_CMD) cairo-vm-env . cairo-vm-env/bin/activate ; \ - CFLAGS=-I/opt/homebrew/opt/gmp/include LDFLAGS=-L/opt/homebrew/opt/gmp/lib pip install -r requirements.txt ; \ + CFLAGS=-I/opt/homebrew/opt/gmp/include LDFLAGS=-L/opt/homebrew/opt/gmp/lib $(PIP_CMD) install -r requirements.txt ; \ $(RELBIN): cargo build --release @@ -388,7 +401,7 @@ clean: fuzzer-deps: build cargo +nightly install cargo-fuzz . cairo-vm-env/bin/activate; \ - pip install atheris==2.2.2 maturin==1.2.3; \ + $(PIP_CMD) install atheris==2.2.2 maturin==1.2.3; \ cd fuzzer/; \ maturin develop diff --git a/install-scripts/install-debian.sh b/install-scripts/install-debian.sh index 9d42d88fb1..9e0a96f982 100755 --- a/install-scripts/install-debian.sh +++ b/install-scripts/install-debian.sh @@ -30,11 +30,8 @@ eval "$(pyenv init -)" # Make sure pyenv has been installed correctly pyenv -v +make uv-program make deps -pyenv local 3.9.15 - -pip install -r requirements.txt - echo "-- You need to follow these instructions to finish installing pyenv: --" pyenv init || true diff --git a/install-scripts/install-macos.sh b/install-scripts/install-macos.sh index c42d7c7307..89d9c01faf 100755 --- a/install-scripts/install-macos.sh +++ b/install-scripts/install-macos.sh @@ -14,11 +14,8 @@ brew install pyenv gmp # Make sure pyenv has been installed correctly pyenv -v +make uv-program make deps-macos -pyenv local 3.9.15 - -pip install -r requirements.txt - echo "-- You need to follow these instructions to finish installing pyenv: --" pyenv init || true diff --git a/install-scripts/install-ubuntu.sh b/install-scripts/install-ubuntu.sh index 9db1fe2b53..9436a8af11 100755 --- a/install-scripts/install-ubuntu.sh +++ b/install-scripts/install-ubuntu.sh @@ -27,11 +27,8 @@ eval "$(pyenv init -)" # Make sure pyenv has been installed correctly pyenv -v +make uv-program make deps -pyenv local 3.9.15 - -pip install -r requirements.txt - echo "-- You need to follow these instructions to finish installing pyenv: --" pyenv init || true