-
Notifications
You must be signed in to change notification settings - Fork 2
Home
For python, it's assumed you are working from a Python 3.7+ virtual environment.
python3 -m venv venv
source venv/bin/activateFor Java you should have JDK 9+ installed (https://adoptium.net/).
Install tools:
pip install grpcio-toolsGenerate protos:
python -m grpc_tools.protoc -Ithird_party/api-common-protos-0.1.0 -Iproto --python_out=python --pyi_out=python --grpc_python_out=python proto/mtap/api/v1/*.protoCheck the bundled protobuf version:
pip install --upgrade grpcio-tools==[version]
python -m grpc_tools.protoc --version
It will output something like libprotoc 27.2.
Then in pyproject.toml update the [project].dependencies block:
dependencies = [
...
"protobuf>=5.27.2",
...Install build:
pip install build Build distributables:
python -m buildcd java
./gradlew build shadowJarFirst time setup, follow the instructions for gRPC Gateway requirements.
Build stuff:
cd go
make proto releasecd go
go install mtap-gateway/mtap-gateway.go The python unit tests run using the version of MTAP installed to the site-packages:
pip install .[tests]
pytest python/testscd java
./gradlew testFirst, the go gateway needs to be installed and $GOROOT/bin needs to be on your $PATH (https://go.dev/dl/). From
the root directory:
cd go
go install mtap-gateway/mtap-gateway.goSecond, the Java framework shadow jar needs to be built. From the root directory:
cd java
./gradlew build shadowJarIf you want to test service discovery via consul, consul needs to be [installed (it is not provided by mtap) and] started. From another terminal:
consul agent -devNow we're ready to run the integration tests, from the root directory:
pip install .[tests]
pytest python/tests --consul --integration --gateway