Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rmariano
Last active March 24, 2020 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmariano/249c267dd9783f40dc0d715b216092c5 to your computer and use it in GitHub Desktop.
Save rmariano/249c267dd9783f40dc0d715b216092c5 to your computer and use it in GitHub Desktop.
Testing out async grpc

gRPC Python: Instructions for Local Development

Note: The compilation of the C files (make) requires GCC version 7. Maybe LLVM?

  1. Git clone & init the project
git clone ...
git submodule update --init
  1. Create & setup a virtual environment
python3.7 -m venv py37_native
source py37_native/bin/activate
pip install -r requirements.txt
pip install six==1.12.0 cython
  1. Compile
make  # Compiles the C files (required the first time)
python tools/run_tests/run_tests.py -l python  --compiler python3.7 --build_only  # this is required on every change of cython files

3.1 Optionally, reset the sub-modules

git submodule foreach --recursive git clean -xfd
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
make clean
make build
  1. Run the tests
GRPC_ENABLE_FORK_SUPPORT=0 python ./src/python/grpcio_tests/setup.py test_aio

Running tests with Bazel

./tools/bazel test //src/python/grpcio_tests/tests_aio/...
  1. Linting & sanity checks
bash ./tools/distrib/yapf_code.sh
bash ./tools/distrib/pylint_code.sh
bash ./tools/distrib/check_pytype.sh
bash ./tools/distrib/buildifier_format_code.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment