v1.5: Python-3.9-Fix - dataclass(slots=True) entfernt, run.sh prueft Mindestversion, Versionen im Start-Log. Geprueft mit Python 3.9.25 + pygame 2.6.1: 57 Tests und Selbsttest gruen.
This commit is contained in:
1 parent
7f590a6f74
commit
37aa5c25f6
6 files changed
+27
-3
No files matched your search
@@ -10,7 +10,7 @@ Die Analyse des Altstands und die Liste der behobenen Fehler stehen in
|
||||
|
||||
## Voraussetzungen
|
||||
|
||||
* Python 3.10 oder neuer (getestet: 3.12)
|
||||
* Python **3.9 oder neuer** – getestet mit 3.9.6 (macOS, Xcode-Python) und 3.12 (Linux)
|
||||
* macOS oder Linux – sonst nichts. `pygame` bringt SDL2 selbst mit,
|
||||
Kamera-, Brew- oder Systembibliotheken werden **nicht** gebraucht.
|
||||
|
||||
|
||||
@@ -127,3 +127,19 @@ ANLEITUNG → MODUSWAHL → STARTSEQUENZ → SPIEL → ABSCHLUSS (10 s) → ANLE
|
||||
| Rückmeldung | Umsetzung |
|
||||
| --- | --- |
|
||||
| „Normal und Hard sind zu einfach, aber die Zeit für die Befehle soll bleiben" | Tempo erhöht: Normal 570 → **740** px/s (+30 %), Hard 720 → **1080** px/s (+50 %), Easy unverändert 420. Gebremst entsprechend 250 bzw. 360 px/s. Damit die Reaktionszeit nicht mitschrumpft, wurde das Snap-Fenster von 160 auf **200 px** vergrössert: rund 1,4 s (Easy), 0,8 s (Normal) und 0,55 s (Hard) zwischen „Befehl möglich" und Barriere. |
|
||||
|
||||
## 10. Python-3.9-Kompatibilität (v1.5)
|
||||
|
||||
Auf dem MacBook läuft `python3` aus den Xcode Command Line Tools: **3.9.6**.
|
||||
Der Code nutzte `@dataclass(..., slots=True)` – das gibt es erst ab Python 3.10,
|
||||
also brach der Start mit `TypeError: dataclass() got an unexpected keyword
|
||||
argument 'slots'` ab.
|
||||
|
||||
* `slots=True` in `sequences.py` und `difficulty.py` entfernt (der
|
||||
Speichervorteil ist hier irrelevant).
|
||||
* `run.sh` prüft jetzt die Python-Version und gibt bei < 3.9 eine verständliche
|
||||
Meldung mit Lösungshinweis aus, statt mit einem Traceback abzubrechen.
|
||||
* Beim Start stehen `Python x.y.z, pygame a.b.c` im Log – hilfreich bei
|
||||
Support-Fällen.
|
||||
* Verifiziert mit echtem Python 3.9.25 + pygame 2.6.1: 57 Tests grün,
|
||||
Selbsttest läuft durch.
|
||||
@@ -16,7 +16,7 @@ from __future__ import annotations
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
@dataclass(frozen=True)
|
||||
class Difficulty:
|
||||
"""Eine Stufe. ``speed_fast`` gilt bis kurz vor der Barriere, dann ``speed_slow``."""
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ from . import config
|
||||
_TRUE_VALUES = {"true", "1", "ja", "yes", "x"}
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
@dataclass(frozen=True)
|
||||
class CaseSpec:
|
||||
"""Ein Koffer aus der Sequenzdatei – bereits in Einlauf-Orientierung."""
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ def main(argv: list[str] | None = None) -> int:
|
||||
assets = Assets()
|
||||
assets.load()
|
||||
|
||||
print(f"Python {sys.version.split()[0]}, pygame {pygame.version.ver}")
|
||||
for line in controller_hint_lines():
|
||||
print(line)
|
||||
print(assets.audio_info())
|
||||
|
||||
@@ -21,6 +21,13 @@ if [ ! -x "$VENV/bin/python" ]; then
|
||||
"$PYTHON" -m venv "$VENV"
|
||||
fi
|
||||
|
||||
if ! "$VENV/bin/python" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 9) else 1)'; then
|
||||
echo "✗ Python 3.9 oder neuer wird benötigt (gefunden: $("$VENV/bin/python" -V 2>&1))"
|
||||
echo " Tipp: neueres Python installieren (z.B. brew install python@3.12) und"
|
||||
echo " die Umgebung neu anlegen: rm -rf .venv"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if command -v shasum >/dev/null 2>&1; then
|
||||
REQ_HASH="$(shasum -a 256 requirements.txt | cut -d' ' -f1)"
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user