forked from kaspanet/kaspa-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-dev
More file actions
executable file
·33 lines (25 loc) · 813 Bytes
/
build-dev
File metadata and controls
executable file
·33 lines (25 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -e
VENV_DIR="env"
if [ ! -d "$VENV_DIR" ]; then
echo "Creating virtual environment in '$VENV_DIR'"
python3 -m venv $VENV_DIR
else
echo "Virtual environment already exists, using '$VENV_DIR'"
fi
echo "Activating virtual environment '$VENV_DIR'"
source $VENV_DIR/bin/activate
if ! command -v maturin &> /dev/null; then
echo "Maturin not found in '$VENV_DIR', installing..."
pip install maturin
else
echo "Maturin is already installed (in '$VENV_DIR'). Installed version is:"
maturin --version
fi
STUB_COMMAND="cargo run --bin stub-gen"
echo "Generating stub file (.pyi) with command: '$STUB_COMMAND'"
$STUB_COMMAND
BUILD_CMD="maturin develop --strip --target-dir target"
echo "Building Python package with command: '$BUILD_CMD'"
$BUILD_CMD
echo "Build complete."