From d22197ea698b21fcc2bca601c8fd8c80d9ee26ed Mon Sep 17 00:00:00 2001 From: Corey Kosak Date: Wed, 20 Mar 2024 11:56:13 -0400 Subject: [PATCH] Python Client: add instructions that set DEEPHAVEN_VERSION (#5006) --- py/client-ticking/README.md | 20 ++++++++++---------- py/client/README.md | 8 ++++++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/py/client-ticking/README.md b/py/client-ticking/README.md index 42d5266d0ef..bb207afff7e 100644 --- a/py/client-ticking/README.md +++ b/py/client-ticking/README.md @@ -33,39 +33,39 @@ you will continue to use that venv here. ### Install Cython in the venv If you've exited your venv, re-activate it with something like: -``` +``` shell source ~/py/cython/bin/activate ``` Then run -``` +``` shell pip3 install cython ``` ### Build the shared library: -``` +``` shell cd ${DHROOT}/py/client-ticking ``` -``` +``` shell # Ensure the DHCPP environment variable is set per the instructions above -rm -rf build # Ensure we clean the remnants of any pre-existing build. -CFLAGS="-I${DHCPP}/include" LDFLAGS="-L${DHCPP}/lib" python3 setup.py build_ext -i +rm -rf build dist # Ensure we clean the remnants of any pre-existing build. +DEEPHAVEN_VERSION=$(../../gradlew :printVersion -q) CFLAGS="-I${DHCPP}/include" LDFLAGS="-L${DHCPP}/lib" python3 setup.py build_ext -i ``` ### Install pydeephaven-ticking Build the wheel with -``` -python3 setup.py bdist_wheel +``` shell +DEEPHAVEN_VERSION=$(../../gradlew :printVersion -q) python3 setup.py bdist_wheel ``` Then install the package. Note the actual name of the `.whl` file may be different depending on system details. -``` +``` shell pip3 install --force --no-deps dist/pydeephaven_ticking--cp310-cp310-linux_x86_64.whl ``` @@ -78,7 +78,7 @@ one from the PyPI repository. Run python from the venv while in this directory, and try this sample Python program: -``` +``` python import pydeephaven as dh import time session = dh.Session() # assuming Deephaven Community Edition is running locally with the default configuration diff --git a/py/client/README.md b/py/client/README.md index 56d1392a051..31d774ccb24 100644 --- a/py/client/README.md +++ b/py/client/README.md @@ -5,11 +5,14 @@ Deephaven Python Client is a Python package created by Deephaven Data Labs. It i ## Source Directory -### From the deephaven-core repository root +### From the deephaven-core repository root (clone from https://github.com/deephaven/deephaven-core) + +## Change to the py/client directory inside the deephaven-core repository ``` shell $ cd py/client ``` + ## Dev environment setup ``` shell $ pip3 install -r requirements-dev.txt @@ -17,8 +20,9 @@ $ pip3 install -r requirements-dev.txt ## Build ``` shell -$ python3 setup.py bdist_wheel +$ DEEPHAVEN_VERSION=$(../../gradlew :printVersion -q) python3 setup.py bdist_wheel ``` + ## Run tests ``` shell $ python3 -m unittest discover tests