Initial commit: smart contract templates for bash, go, python, and typescript
This commit is contained in:
40
python/Makefile
Executable file
40
python/Makefile
Executable file
@@ -0,0 +1,40 @@
|
||||
.PHONY: proto run clean setup venv test
|
||||
|
||||
# Generate Python code from proto files
|
||||
proto:
|
||||
python -m grpc_tools.protoc \
|
||||
-I./proto \
|
||||
--python_out=. \
|
||||
--grpc_python_out=. \
|
||||
proto/remote_sc.proto
|
||||
|
||||
# Create virtual environment and install dependencies
|
||||
setup: venv
|
||||
. venv/bin/activate && pip install -r requirements.txt
|
||||
|
||||
# Create virtual environment
|
||||
venv:
|
||||
python3 -m venv venv
|
||||
|
||||
# Run the smart contract
|
||||
run:
|
||||
python main.py --config config.yaml
|
||||
|
||||
# Clean generated files
|
||||
clean:
|
||||
rm -f *_pb2.py *_pb2_grpc.py
|
||||
rm -rf __pycache__
|
||||
rm -rf venv
|
||||
|
||||
# Run tests
|
||||
test:
|
||||
python -m pytest tests/ -v
|
||||
|
||||
# Install dependencies (without venv)
|
||||
deps:
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Format code
|
||||
format:
|
||||
black .
|
||||
isort .
|
||||
Reference in New Issue
Block a user