From ab2aead17e4bc98648ae1ca41d78df57c6ae2c47 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Sat, 23 Mar 2024 11:11:30 +0000 Subject: [PATCH] chore: updates to build on latest python/linux --- build/requirements.txt | 2 +- helpers/device_manager.py | 3 +-- package-lock.json | 24 ++++++++++++++++++++---- package.json | 2 +- presenter | 2 +- websocket_server.py | 4 ++-- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/build/requirements.txt b/build/requirements.txt index 3909025..cfd24d3 100644 --- a/build/requirements.txt +++ b/build/requirements.txt @@ -1,5 +1,5 @@ wheel -pygame==2.0.2 +pygame==2.5.2 sanic==21.9.3 sanic-Cors==2.0.1 syncer==1.3.0 diff --git a/helpers/device_manager.py b/helpers/device_manager.py index df68409..a868af7 100644 --- a/helpers/device_manager.py +++ b/helpers/device_manager.py @@ -64,8 +64,7 @@ class DeviceManager: def getAudioDevices(cls) -> List[str]: mixer.init(44100, -16, 2, 1024) is_capture = 0 # zero to request playback devices, non-zero to request recording devices - num = sdl2.get_num_audio_devices(is_capture) - names = [str(sdl2.get_audio_device_name(i, is_capture), encoding="utf-8") for i in range(num)] + names = sdl2.audio.get_audio_device_names(is_capture) mixer.quit() return names diff --git a/package-lock.json b/package-lock.json index ac7f15d..7ed808c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,29 @@ { "name": "bapsicle", "version": "3.1.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "yarn": { + "packages": { + "": { + "name": "bapsicle", + "version": "3.1.0", + "license": "ISC", + "dependencies": { + "yarn": "^1.22.15" + } + }, + "node_modules/yarn": { "version": "1.22.15", "resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.15.tgz", - "integrity": "sha512-AzoEDxj256BOS/jqDXA3pjyhmi4FRBBUMgYoTHI4EIt2EhREkvH0soPVEtnD+DQIJfU5R9bKhcZ1H9l8zPWeoA==" + "integrity": "sha512-AzoEDxj256BOS/jqDXA3pjyhmi4FRBBUMgYoTHI4EIt2EhREkvH0soPVEtnD+DQIJfU5R9bKhcZ1H9l8zPWeoA==", + "hasInstallScript": true, + "bin": { + "yarn": "bin/yarn.js", + "yarnpkg": "bin/yarn.js" + }, + "engines": { + "node": ">=4.0.0" + } } } } diff --git a/package.json b/package.json index 2d3161e..228239f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "scripts": { "presenter-install": "cd presenter && git submodule update --init && yarn --network-timeout 100000", - "presenter-make": "npm run presenter-install && (rm -r presenter-build || true) && cd presenter && yarn build-baps && cp -r build ../presenter-build && cd ../ && npm install", + "presenter-make": "npm run presenter-install && (rm -r presenter-build || true) && cd presenter && NODE_OPTIONS=--openssl-legacy-provider yarn build-baps && cp -r build ../presenter-build && cd ../ && npm install", "test": "echo \"Error: no test specified\" && exit 1", "presenter-start": "cd presenter && yarn start-baps", "lint": "./venv/bin/autopep8 -r -a -a --ignore E402,E226,E24,W50,W690 --max-line-length 127 --in-place --exclude=\"*node_modules*,*venv/*,presenter/*\" . && ./venv/bin/flake8 . --exclude=\"*node_modules*,*venv/*,presenter/*\" --count --ignore=E402,E226,E24,W50,W690 --max-complexity=25 --max-line-length=127 --statistics" diff --git a/presenter b/presenter index 238da52..537e617 160000 --- a/presenter +++ b/presenter @@ -1 +1 @@ -Subproject commit 238da52d94f9a2e1f476e5c8e155e50dd8519cb7 +Subproject commit 537e61733233b9d4e43865e5ca5ca9bd348a07ef diff --git a/websocket_server.py b/websocket_server.py index f21107e..ec8a4b9 100644 --- a/websocket_server.py +++ b/websocket_server.py @@ -92,7 +92,7 @@ class WebsocketServer: channel = int(data["channel"]) self.sendCommand(channel, data) - await asyncio.wait([conn.send(message) for conn in self.baps_clients]) + await asyncio.wait([asyncio.Task(conn.send(message)) for conn in self.baps_clients]) except websockets.exceptions.ConnectionClosedError as e: self.logger.log.error( @@ -244,7 +244,7 @@ class WebsocketServer: data = json.dumps( {"command": command, "data": message, "channel": channel} ) - await asyncio.wait([conn.send(data) for conn in self.baps_clients]) + await asyncio.wait([asyncio.Task(conn.send(data)) for conn in self.baps_clients]) except queue.Empty: continue except ValueError: