.PHONY: test build
PY37_VERSION=3.7.10
PY38_VERSION=3.8.8
PY39_VERSION=3.9.7
PY3A_VERSION=3.10.0
PY37_PATH=$(shell pyenv prefix $(PY37_VERSION))
PY38_PATH=$(shell pyenv prefix $(PY38_VERSION))
PY39_PATH=$(shell pyenv prefix $(PY39_VERSION))
PY3A_PATH=$(shell pyenv prefix $(PY3A_VERSION))
PY36_BIN=$(PY36_PATH)/bin/python
PY37_BIN=$(PY37_PATH)/bin/python
PY38_BIN=$(PY38_PATH)/bin/python
PY39_BIN=$(PY39_PATH)/bin/python
PY3A_BIN=$(PY3A_PATH)/bin/python
build:
cargo build --release
build-tiny:
RUSTFLAGS='-C link-arg=-s' cargo build --release
test:
cargo test
test-python:
cargo build --lib --release --features "python-library"
cp ./target/release/libreasonable.so reasonable/reasonable.so
python test.py
install-python-versions:
pyenv install -s $(PY37_VERSION)
pyenv install -s $(PY38_VERSION)
pyenv install -s $(PY39_VERSION)
python-build-remove:
cargo rustc --lib --release --features python-library --profile=check -- -Zunstable-options --pretty=expanded
dev-python-library:
poetry run maturin develop -b pyo3 --cargo-extra-args="--features python-library --release"
poetry run python lang.py
build-python-library:
poetry run maturin build -i $(PY36_BIN) -i $(PY37_BIN) -i $(PY38_BIN) -i $(PY39_BIN) -b pyo3 --cargo-extra-args="--features python-library"
publish-python-library: build-python-library
poetry run maturin publish -i $(PY36_BIN) -i $(PY37_BIN) -i $(PY38_BIN) -i $(PY39_BIN) -b pyo3 --cargo-extra-args="--features python-library"
bench: build
./scripts/bench_examples.sh