Skip to content

Commit

Permalink
Don't use venvstarter for interactor harpoon
Browse files Browse the repository at this point in the history
  • Loading branch information
delfick committed Dec 26, 2024
1 parent 7726cde commit 871da11
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 17 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/release-interactor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ jobs:
with:
python-version: 3.12

- run: python3 -m pip install venvstarter

- id: build
run: cd apps/interactor && ../../tools/uv build -o dist

Expand Down Expand Up @@ -103,7 +101,7 @@ jobs:
set -e
mkdir staging
cd staging
../apps/interactor/docker/harpoon get_docker_context lifx-photons-interactor
../dev interactor-docker get_docker_context lifx-photons-interactor
tar xf context_lifx-photons-interactor.tar
rm context_lifx-photons-interactor.tar
Expand Down
1 change: 1 addition & 0 deletions apps/interactor/docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.venv
1 change: 1 addition & 0 deletions apps/interactor/docker/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use via ``./dev interactor-docker``
14 changes: 0 additions & 14 deletions apps/interactor/docker/harpoon

This file was deleted.

7 changes: 7 additions & 0 deletions apps/interactor/docker/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[project]
name = "lifx-photons-interactor-docker"
version = "0.1"
requires-python = ">= 3.12"
dependencies = [
"docker-harpoon==0.19.0",
]
219 changes: 219 additions & 0 deletions apps/interactor/docker/uv.lock

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions tools/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,26 @@ def interactor_tests(args: list[str]) -> None:
run("run_photons_core_tests", *ags, env=env, cwd=cwd)


@cli.command(context_settings=dict(ignore_unknown_options=True))
@click.argument("args", nargs=-1, type=click.UNPROCESSED)
def interactor_docker(args: list[str]) -> None:
"""
Run harpoon for the interactor
"""
harpoon_folder = here / ".." / "apps" / "interactor" / "docker"
os.chdir(harpoon_folder)

def run(*ags: str) -> None:
try:
subprocess.run(["/bin/bash", str(here / "uv"), "--directory", str(harpoon_folder), *ags], cwd=str(harpoon_folder), check=True)
except subprocess.CalledProcessError as e:
sys.exit(e.returncode)

os.environ["VIRTUAL_ENV"] = ""

run("sync")
run("run", "harpoon", *args)


if __name__ == "__main__":
cli()

0 comments on commit 871da11

Please sign in to comment.