맥락: - pygame GUI 이식 전에 core 설치와 GUI 의존성을 분리하고 asset 로딩 경로를 고정한다. 변경: - pyproject에 gui extra로 pygame과 pygame-gui를 추가했다. - classic resource helper를 추가해 packaged asset 경로를 importlib.resources 기반으로 읽게 했다. - theme asset resource 테스트와 README 설치 안내를 추가했다. 확인: - uv sync --extra gui - uv run pytest tests/games/classic - uv run lost-cities-classic
13 lines
293 B
Python
13 lines
293 B
Python
from __future__ import annotations
|
|
|
|
from importlib.abc import Traversable
|
|
from importlib.resources import files
|
|
|
|
|
|
def asset_path(name: str) -> Traversable:
|
|
return files(__package__).joinpath("assets", name)
|
|
|
|
|
|
def theme_path() -> Traversable:
|
|
return asset_path("pygame_pvp_theme.json")
|