Skip to content

Commit

Permalink
fix:player proxy update (#40)
Browse files Browse the repository at this point in the history
* fix:player_proxy

noticed in end2end tests from OpenVoiceOS/ovos-core#621

* fix workflows
  • Loading branch information
JarbasAl authored Dec 6, 2024
1 parent ce8893b commit 130ae1e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 .
4 changes: 2 additions & 2 deletions .github/workflows/install_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,4 +31,4 @@ jobs:
python setup.py bdist_wheel
- name: Install package
run: |
pip install .[all]
uv pip install --system .
6 changes: 3 additions & 3 deletions .github/workflows/license_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion ocp_pipeline/opm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand All @@ -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"):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 130ae1e

Please sign in to comment.