diff --git a/README.md b/README.md index 74fd264a..0e82ef35 100644 --- a/README.md +++ b/README.md @@ -182,22 +182,31 @@ To keep your development environment clean, the script creates a virtual environ ``` 4) Build a [deephaven-ib](https://github.com/deephaven-examples/deephaven-ib) virtual environment: - To install the latest production version from PyPi: + First, install the dependencies needed to run the script: ```bash python3 -m pip install -r requirements_dhib_env.txt + ``` + + To see all options: + ```bash + python3 ./dhib_env.py --help + ``` + + To install the latest production version from PyPi: + ```bash python3 ./dhib_env.py release ``` - To build the latest development version from source: + To install the latest development version from source: ```bash - python3 -m pip install -r requirements_dhib_env.txt python3 ./dhib_env.py dev ``` - - To see all options: + + To create a venv for developing [deephaven-ib](https://github.com/deephaven-examples/deephaven-ib) in PyCharm: (This will not install deephaven-ib.) ```bash - python3 ./dhib_env.py --help + python3 ./dhib_env.py dev --install_dhib false ``` + 5) In the logs, take note of where the virtual environment was created. It will be in a directory like `./venv-`. ### Activate the Virtual Environment diff --git a/dhib_env.py b/dhib_env.py index a61f8f10..ae4a4069 100755 --- a/dhib_env.py +++ b/dhib_env.py @@ -371,7 +371,8 @@ def cli(): @click.option('--ib_version', default=IB_VERSION_DEFAULT, help='The version of ibapi.') @click.option('--dh_ib_version', default=None, help='The version of deephaven-ib.') @click.option('--delete_venv', default=False, help='Whether to delete the virtual environment if it already exists.') -def dev(python: str, dh_version: str, dh_version_exact: str, ib_version: str, dh_ib_version: Optional[str], delete_venv: bool): +@click.option('--install_dhib', default=True, help='Whether to install deephaven-ib. If set to false, the resulting venv can be used to develop deephaven-ib in PyCharm or other development environments.') +def dev(python: str, dh_version: str, dh_version_exact: str, ib_version: str, dh_ib_version: Optional[str], delete_venv: bool, install_dhib: bool): """Create a development environment.""" logging.warning(f"Creating development environment: python={python} dh_version={dh_version}, dh_version_exact={dh_version_exact}, ib_version={ib_version}, dh_ib_version={dh_ib_version}, delete_vm_if_exists={delete_venv}") @@ -401,15 +402,16 @@ def dev(python: str, dh_version: str, dh_version_exact: str, ib_version: str, dh v.pip_install("deephaven-server", dh_version_pip) - if use_dev: - logging.warning(f"Building deephaven-ib from source: {dh_ib_version}") - dh_ib_wheel = DhIbWheel(dh_ib_version, dh_version, ib_version) - dh_ib_wheel.build(v) - dh_ib_wheel.install(v) - else: - logging.warning(f"Installing deephaven-ib from PyPI: {dh_ib_version}") - logging.warning(f"*** INSTALLED deephaven-ib MAY BE INCONSISTENT WITH INSTALLED DEPENDENCIES ***") - v.pip_install("deephaven-ib", f"=={dh_ib_version}") + if install_dhib: + if use_dev: + logging.warning(f"Building deephaven-ib from source: {dh_ib_version}") + dh_ib_wheel = DhIbWheel(dh_ib_version, dh_version, ib_version) + dh_ib_wheel.build(v) + dh_ib_wheel.install(v) + else: + logging.warning(f"Installing deephaven-ib from PyPI: {dh_ib_version}") + logging.warning(f"*** INSTALLED deephaven-ib MAY BE INCONSISTENT WITH INSTALLED DEPENDENCIES ***") + v.pip_install("deephaven-ib", f"=={dh_ib_version}") success(v)