forked from deephaven/deephaven-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPDATE: Secondary readmes (deephaven#4267)
* Bring up-to-speed with Matt's other changes. I'll need to address Chip's comments, which I need to reach out to some other devs about first. * Updates from Chip's review of Matt's PR * Updates to proto README * Updates from Devin and Matt reviews * Update server/jetty-app/README.md * Updates from Chip/Matt reviews --------- Co-authored-by: margaretkennedy <[email protected]>
- Loading branch information
1 parent
77587f4
commit 0c90448
Showing
3 changed files
with
124 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Deephaven Protobuf | ||
|
||
Deephaven's [protobuf](https://protobuf.dev/) files are what drives its client APIs such as [Python](https://deephaven.io/core/client-api/python/), [C++](https://deephaven.io/core/client-api/cpp-examples/getting_started.html), and more using [gRPC](https://grpc.io/). If you wish to build your own client API or change how all client APIs interact with the Deephaven server, this is the place to start. | ||
|
||
For Java, proto changes will be automatically reflected when building/running the Java server app. Sections below list files that must be manually generated and committed to source control when proto files change. | ||
|
||
## Python/Go/C++ API | ||
|
||
```sh | ||
./gradlew :py-client:updateProtobuf :go:updateProtobuf :cpp-client:updateProtobuf | ||
``` | ||
|
||
## Authorization | ||
|
||
See [authorization readme](../authorization/README.md) | ||
|
||
## JS API | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Deephaven Python Source | ||
|
||
This folder contains Deephaven Community Core's Python source code, tests, and more. Source code can be found in `server/deephaven` and unit tests can be found in `server/tests`. Other content includes `jpy`, the Python client, wheels, and more. | ||
|
||
## Requirements | ||
|
||
Development and contribution requires Python 3.8+. We recommend always staying up-to-date on the latest Python version. | ||
|
||
## Virtual environments | ||
|
||
Deephaven Python development should always be done from a [virtual environment](https://docs.python.org/3/library/venv.html). See [PEP 405](https://peps.python.org/pep-0405/) for the motivation behind virtual environments (venvs). Creating and activating a venv takes two shell commands. | ||
|
||
From the root directory of your `deephaven-core` clone: | ||
|
||
```sh | ||
python3 -m venv .venv # Create a venv. Only needed once. | ||
source .venv/bin/activate # Activate the virtual environment. | ||
``` | ||
|
||
A virtual environment only exists in the terminal it's run from. New or other terminal windows or tabs will need to activate the virtual environment again. | ||
|
||
Once finished with a virtual environment, exiting is done with a single command. | ||
|
||
```sh | ||
deactivate # Exit the venv when finished | ||
``` | ||
|
||
## Local Development | ||
|
||
Using a `pip` editable install is recommended so that Python changes are reflected when your server is restarted. These instructions are for the Python server package in `py/server` but should apply to any other Python packages. | ||
|
||
Install the Python server package. This will install the dependencies as well as the autocomplete dependencies. | ||
|
||
```sh | ||
DEEPHAVEN_VERSION=0.dev pip install -e "py/server[autocomplete]" | ||
``` | ||
|
||
After installing, a `pip list` should include `deephaven-core` with an editable project location listed. | ||
|
||
Now you can start the Java server by following the instructions [here](../server/jetty-app/README.md). Any time you make Python changes, restart the server to apply them. | ||
|
||
## Local Build | ||
|
||
You can use these instructions if you do not plan on making frequent changes to your local Python environment or need to try things in a more production-like environment locally. | ||
|
||
First, run the following command to build the server and embedded-server if needed. The embedded-server is used to start [pip-installed Deephaven](https://deephaven.io/core/docs/how-to-guides/configuration/native-application/#python-embedded-server). | ||
|
||
```sh | ||
./gradlew :py-server:assemble | ||
|
||
# If using embedded-server | ||
# You can run both tasks w/ ./gradlew :task1 :task2 if you need both | ||
./gradlew :py-embedded-server:assemble | ||
``` | ||
|
||
Then run the following commands to install the server package. Note that the `wheel` folder should only contain 1 file, so you should be able to tab-complete the wheel file. | ||
|
||
**Note:** Adding the `--no-deps` flag on subsequent installs will skip re-installing other dependencies. | ||
|
||
```sh | ||
pip install --force py/server/build/wheel/deephaven_core-<version>-py3-none-any.whl | ||
|
||
# If using embedded-server | ||
# You can combine as pip install core.whl server.whl if you need both | ||
pip install --force py/embedded-server/build/wheel/deephaven_server-<version>-py3-none-any.whl | ||
``` | ||
|
||
**If you make Python server code changes, you will need to re-build and re-install the wheel.** | ||
|
||
Start the Java server by following the instructions [here](../server/jetty-app/README.md). | ||
|
||
## Tests | ||
|
||
Python unit tests must be run from the root directory of the cloned repository. | ||
|
||
```sh | ||
cd .. | ||
./gradlew integrations:test-py-deephaven | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters