From 0cf841459dbdbfb3b6961e81e0f4e4ad137641d6 Mon Sep 17 00:00:00 2001 From: Chip Kent Date: Tue, 7 May 2024 15:41:14 -0600 Subject: [PATCH] Fix actions to build IB wheels --- .github/workflows/build-and-publish.yml | 7 ++++--- dhib_env.py | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 99ce8218..18328bc5 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -24,15 +24,16 @@ jobs: uses: actions/checkout@v1 - name: Build run: | - cd ibwhl - docker-compose -f "docker-compose.yml" up --build + python3 -m pip install --upgrade pip + python3 -m pip install -r requirements_dhib_env.txt + python3 dhib_env ibwhl --ib-version ${{ env.IB_VERSION }} find . -name \*.whl - name: Archive build artifacts uses: actions/upload-artifact@v2 with: name: ib-wheels path: | - ibwhl/dist/* + dist/ib/* build-whl: diff --git a/dhib_env.py b/dhib_env.py index a9e64830..3b3740e7 100755 --- a/dhib_env.py +++ b/dhib_env.py @@ -406,6 +406,29 @@ def cli(): """A script to build Deephaven-IB virtual environments.""" pass +@click.command() +@click.option('--python', default="python3", help='The path to the Python executable to use.') +@click.option('--ib_version', default=IB_VERSION_DEFAULT, help='The version of ibapi.') +def ibwheel( + python: str, + ib_version: str, +): + """Create a development environment.""" + logging.warning(f"Creating an ib wheel: python={python}, ib_version={ib_version}") + + version_assert_format(ib_version) + + logging.warning(f"Using system python: {python}") + pyenv = Pyenv(python) + + ib_wheel = IbWheel(ib_version) + ib_wheel.build(pyenv) + + logging.warning(f"IB wheel created successfully.") + logging.warning(f"IB wheel path: {Path(f'dist/ib/ibapi-{ib_version}-py3-none-any.whl').absolute()}") + + success(pyenv) + @click.command() @click.option('--python', default="python3", help='The path to the Python executable to use.') @@ -540,6 +563,7 @@ def release( success(pyenv) +cli.add_command(ibwheel) cli.add_command(dev) cli.add_command(release)