Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2a636e95d1
commit
de654bcbb7
3 files changed
+23
-12
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
PROGRAM_NAME = "KaTrain"
|
PROGRAM_NAME = "KaTrain"
|
||||||
VERSION = "1.18.0"
|
VERSION = "1.18.1"
|
||||||
HOMEPAGE = "https://github.com/sanderland/katrain"
|
HOMEPAGE = "https://github.com/sanderland/katrain"
|
||||||
CONFIG_MIN_VERSION = "1.17.0" # keep config files from this version
|
CONFIG_MIN_VERSION = "1.17.0" # keep config files from this version
|
||||||
ANALYSIS_FORMAT_VERSION = "1.0"
|
ANALYSIS_FORMAT_VERSION = "1.0"
|
||||||
|
|||||||
+17
-10
@@ -31,16 +31,23 @@ def preload_sounds(sound_dir):
|
|||||||
if not audio_files:
|
if not audio_files:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Test if audio subsystem works by loading one sound in a subprocess
|
# SoundLoader.load() deadlocks when no audio output device is available, so
|
||||||
try:
|
# on macOS/Linux we first probe in a subprocess. We skip the probe when:
|
||||||
subprocess.run(
|
# - on Windows, where the deadlock does not occur, and
|
||||||
[sys.executable, "-c",
|
# - in frozen builds, where sys.executable is the katrain app (not python),
|
||||||
f"from kivy.core.audio import SoundLoader; SoundLoader.load({audio_files[0]!r})"],
|
# so "-c <snippet>" relaunches katrain instead of running the snippet;
|
||||||
timeout=3, capture_output=True,
|
# Kivy then misparses it as a "section:key:value" config arg and crashes.
|
||||||
)
|
# See https://github.com/sanderland/katrain/issues/824
|
||||||
except subprocess.TimeoutExpired as e:
|
if platform != "win" and not getattr(sys, "frozen", False):
|
||||||
print(f"Warning: Audio unavailable ({e}). Sounds disabled.", file=sys.stderr)
|
try:
|
||||||
return
|
subprocess.run(
|
||||||
|
[sys.executable, "-c",
|
||||||
|
f"from kivy.core.audio import SoundLoader; SoundLoader.load({audio_files[0]!r})"],
|
||||||
|
timeout=3, capture_output=True,
|
||||||
|
)
|
||||||
|
except subprocess.TimeoutExpired as e:
|
||||||
|
print(f"Warning: Audio unavailable ({e}). Sounds disabled.", file=sys.stderr)
|
||||||
|
return
|
||||||
|
|
||||||
# Audio works, preload all sounds
|
# Audio works, preload all sounds
|
||||||
for path in audio_files:
|
for path in audio_files:
|
||||||
|
|||||||
+5
-1
@@ -1,8 +1,12 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "KaTrain"
|
name = "KaTrain"
|
||||||
version = "1.18.0"
|
version = "1.18.1"
|
||||||
description = "Go/Baduk/Weiqi playing and teaching app with a variety of AIs"
|
description = "Go/Baduk/Weiqi playing and teaching app with a variety of AIs"
|
||||||
authors = [{ name = "Sander Land" }]
|
authors = [{ name = "Sander Land" }]
|
||||||
|
# Cap tracks binary-wheel availability of kivy + ffpyplayer (no cp314 wheels yet).
|
||||||
|
# Kivy 3.14 support is merged to master but unreleased (kivy/kivy#9225); ffpyplayer
|
||||||
|
# 3.14 is still in progress (matham/ffpyplayer#185). Raise the cap once both ship
|
||||||
|
# cp314 wheels. Note ffpyplayer is our direct dep (audio); kivy does not pull it.
|
||||||
requires-python = ">=3.10,<3.14"
|
requires-python = ">=3.10,<3.14"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
Reference in new issue
Block a user