diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07225be..1be52ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: pip install --upgrade pip pip --version pip install build setuptools wheel - pip install -r requirements.txt + pip install -r requirements_CI.txt chmod +x ./*.sh # needed for bb_create e2e test diff --git a/install-dev.sh b/install-dev.sh index 0898c33..8d07b6a 100755 --- a/install-dev.sh +++ b/install-dev.sh @@ -3,7 +3,14 @@ # fail on any error set -e -python -m pip install -r requirements.txt +# if running on the CI server, we want to install the dependencies from requirements_CI.txt instead of requirements.txt +if [ "$CI" = "true" ]; then + echo "Running on CI server, installing dependencies from requirements_CI.txt" + python -m pip install -r requirements_CI.txt +else + echo "Running locally, installing dependencies from requirements.txt" + python -m pip install -r requirements.txt +fi ./build.sh python -m pip install --editable . diff --git a/pyproject.toml b/pyproject.toml index 545bcd1..b4fb943 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,8 +12,7 @@ dependencies = [ # WebRTC dependencies "aiohttp", "aiohttp_cors", - # 1.11.0 currently fails to build on CI - "aiortc==1.10.1", + "aiortc", "build", "cachetools", "flask-cors", diff --git a/requirements.txt b/requirements.txt index 77f2b45..9d07a56 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,30 +1,6 @@ -# these are build dependencies for basic_bot itself - -build -cachetools -flake8 -mkdocs -mkdocs-material -mypy -opencv-stubs -pydoc-markdown -pytest -setuptools>=57.0 - -# types -types-Flask-Cors -types-jsonschema -types-psutil -types-PyYAML -types-requests - -# Runtime dependencies needed for mypy type checking +-r requirements_base.txt +aiortc>=1.11.0 aiohttp aiohttp_cors -aiortc==1.10.1 av -numpy -Pillow -websocket-client -websockets==10.4 diff --git a/requirements_CI.txt b/requirements_CI.txt new file mode 100644 index 0000000..588f01f --- /dev/null +++ b/requirements_CI.txt @@ -0,0 +1,4 @@ +-r requirements_base.txt +aiortc==1.10.1 +aiohttp +aiohttp_cors diff --git a/requirements_base.txt b/requirements_base.txt new file mode 100644 index 0000000..ab9da72 --- /dev/null +++ b/requirements_base.txt @@ -0,0 +1,26 @@ +# these are build dependencies for basic_bot itself + +build +cachetools +flake8 +mkdocs +mkdocs-material +mypy +opencv-stubs +pydoc-markdown +pytest +setuptools>=57.0 + +# types +types-Flask-Cors +types-jsonschema +types-psutil +types-PyYAML +types-requests + +# Runtime dependencies needed for mypy type checking +numpy +Pillow +websocket-client +websockets==10.4 + diff --git a/src/basic_bot/commons/webrtc_server.py b/src/basic_bot/commons/webrtc_server.py index b229db2..bcf6382 100644 --- a/src/basic_bot/commons/webrtc_server.py +++ b/src/basic_bot/commons/webrtc_server.py @@ -230,7 +230,11 @@ async def respond_to_ice_candidate(self, request: web.Request) -> web.Response: try: await pc.addIceCandidate(self.create_RTCIceCandidate(candidate)) log.debug(f"Added ICE candidate for client_id={client_id}") - return web.Response(status=200, text="ICE candidate added") + return web.Response( + status=200, + content_type="application/json", + text=json.dumps({"text": "ICE candidate added"}), + ) except Exception as e: log.error(f"Error adding ICE candidate for client_id={client_id}: {e}") return web.Response(status=500, text="Failed to add ICE candidate")