Skip to content

Commit

Permalink
Simplify wyoming-piper config.py script
Browse files Browse the repository at this point in the history
  • Loading branch information
ms1design committed Nov 19, 2024
1 parent 10b8163 commit 438bee7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
2 changes: 0 additions & 2 deletions packages/smart-home/wyoming/piper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ HEALTHCHECK --start-period=10m \
| nc -w 1 localhost ${PIPER_PORT} \
| grep -q "piper" \
|| exit 1

CMD /init
18 changes: 3 additions & 15 deletions packages/smart-home/wyoming/piper/config.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
import requests


def get_latest_stable_version(fallback="v1.5.0") -> str:
try:
response = requests.get('https://raw.githubusercontent.com/rhasspy/wyoming-piper/master/wyoming_piper/VERSION')
if response.status_code == 200:
return f"v{response.text.strip()}"
else:
print("Failed to fetch version information. Status code:", response.status_code)
return fallback
except Exception as e:
print("An error occurred:", e)
return fallback
from jetson_containers import handle_text_request


def create_package(version, default=False) -> list:
pkg = package.copy()
wanted_version = get_latest_stable_version() if version == 'latest' else version
url = 'https://raw.githubusercontent.com/rhasspy/wyoming-piper/master/wyoming_piper/VERSION'
wanted_version = handle_text_request(url) if version == 'latest' else version
pkg['name'] = f'wyoming-piper:{version}'

pkg['build_args'] = {
Expand Down

0 comments on commit 438bee7

Please sign in to comment.