From 130ae1efbea09a5535468d2aed8286f8b3938bcc Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Fri, 6 Dec 2024 16:06:42 +0000 Subject: [PATCH] fix:player proxy update (#40) * fix:player_proxy noticed in end2end tests from https://github.com/OpenVoiceOS/ovos-core/pull/621 * fix workflows --- .github/workflows/build_tests.yml | 8 ++------ .github/workflows/install_tests.yml | 4 ++-- .github/workflows/license_tests.yml | 6 +++--- .github/workflows/unit_tests.yml | 6 +++--- ocp_pipeline/opm.py | 3 ++- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index f204bb7..439696d 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -16,7 +16,7 @@ jobs: python-version: 3.8 - name: Install Build Tools run: | - python -m pip install build wheel + python -m pip install build wheel uv - name: Install System Dependencies run: | sudo apt-get update @@ -27,10 +27,6 @@ jobs: - name: Build Distribution Packages run: | python setup.py bdist_wheel - - name: Install tflite_runtime workaround tflit bug - run: | - pip3 install numpy - pip3 install --extra-index-url https://google-coral.github.io/py-repo/ tflite_runtime - name: Install core repo run: | - pip install .[audio-backend,mark1,stt,tts,skills_minimal,skills,gui,bus,all] + uv pip install --system . diff --git a/.github/workflows/install_tests.yml b/.github/workflows/install_tests.yml index 4aaabea..d4a9c3c 100644 --- a/.github/workflows/install_tests.yml +++ b/.github/workflows/install_tests.yml @@ -21,7 +21,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install Build Tools run: | - python -m pip install build wheel + python -m pip install build wheel uv - name: Install System Dependencies run: | sudo apt-get update @@ -31,4 +31,4 @@ jobs: python setup.py bdist_wheel - name: Install package run: | - pip install .[all] \ No newline at end of file + uv pip install --system . \ No newline at end of file diff --git a/.github/workflows/license_tests.yml b/.github/workflows/license_tests.yml index 29f4063..94f5268 100644 --- a/.github/workflows/license_tests.yml +++ b/.github/workflows/license_tests.yml @@ -19,17 +19,17 @@ jobs: python-version: 3.8 - name: Install Build Tools run: | - python -m pip install build wheel + python -m pip install build wheel uv - name: Install System Dependencies run: | sudo apt-get update sudo apt install python3-dev swig libssl-dev - name: Install core repo run: | - pip install . + uv pip install --system . - name: Get explicit and transitive dependencies run: | - pip freeze > requirements-all.txt + uv pip freeze > requirements-all.txt - name: Check python id: license_check_report uses: pilosus/action-pip-license-checker@v0.5.0 diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index fd23fc4..6969599 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -46,13 +46,13 @@ jobs: run: | sudo apt-get update sudo apt install python3-dev swig - python -m pip install build wheel + python -m pip install build wheel uv - name: Install repo run: | - pip install -e . + uv pip install --system -e . - name: Install test dependencies run: | - pip install -r tests/requirements.txt + uv pip install --system -r tests/requirements.txt - name: Run unittests run: | pytest --cov=ocp_pipeline --cov-report=xml ./tests diff --git a/ocp_pipeline/opm.py b/ocp_pipeline/opm.py index 2b1e977..5274d8c 100644 --- a/ocp_pipeline/opm.py +++ b/ocp_pipeline/opm.py @@ -785,6 +785,7 @@ def handle_m(m): LOG.warning(f"Player synchronization timed out after {timeout} seconds") return player + def get_player(self, message: Optional[Message] = None, timeout=1) -> OCPPlayerProxy: """get a PlayerProxy object, containing info such as player state and the available stream extractors from OCP this is tracked per Session, if needed requests the info from the client""" @@ -793,6 +794,7 @@ def get_player(self, message: Optional[Message] = None, timeout=1) -> OCPPlayerP player = OCPPlayerProxy(available_extractors=available_extractors(), ocp_available=False, session_id=sess.session_id) + self.update_player_proxy(player) else: player = self.ocp_sessions[sess.session_id] if not player.ocp_available and not self.config.get("legacy"): @@ -1026,7 +1028,6 @@ def legacy_play(self, results: NormalizedResultsList, phrase="", else: self.legacy_api.queue(real_uri, source_message=message) - def _handle_legacy_audio_stop(self, message: Message): player = self.get_player(message) if not player.ocp_available: