클래식 공개 API 정리
맥락: - GUI 이식 전에 classic 패키지 루트에서 노출할 API 범위를 정리했다. - Claude Opus 4.7 xhigh 자문에서 root export 축소와 backend builder 이름 단일화를 우선 권장했다. 변경: - classic package root export를 GameState, config, env, backend, bot registry 중심으로 줄였다. - backend factory 이름을 build_backend로 단일화하고 README 사용 예시를 갱신했다. - public API smoke test를 추가하고 pyproject description 및 Cython build failure 처리를 정리했다. 확인: - uv run pytest tests/games/classic - uv run lost-cities-classic
This commit is contained in:
@@ -4,27 +4,25 @@ from setuptools import Extension, setup
|
||||
|
||||
try:
|
||||
from Cython.Build import cythonize
|
||||
except ImportError: # pragma: no cover
|
||||
cythonize = None
|
||||
except ImportError as exc: # pragma: no cover
|
||||
raise RuntimeError("Cython is required to build coolrl-lost-cities") from exc
|
||||
|
||||
|
||||
extensions: list[Extension] = []
|
||||
if cythonize is not None:
|
||||
extensions = cythonize(
|
||||
[
|
||||
Extension(
|
||||
"coolrl_lost_cities.games.classic.game",
|
||||
["src/coolrl_lost_cities/games/classic/game.pyx"],
|
||||
)
|
||||
],
|
||||
language_level=3,
|
||||
compiler_directives={
|
||||
"boundscheck": False,
|
||||
"wraparound": False,
|
||||
"cdivision": True,
|
||||
"initializedcheck": False,
|
||||
},
|
||||
)
|
||||
extensions = cythonize(
|
||||
[
|
||||
Extension(
|
||||
"coolrl_lost_cities.games.classic.game",
|
||||
["src/coolrl_lost_cities/games/classic/game.pyx"],
|
||||
)
|
||||
],
|
||||
language_level=3,
|
||||
compiler_directives={
|
||||
"boundscheck": False,
|
||||
"wraparound": False,
|
||||
"cdivision": True,
|
||||
"initializedcheck": False,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
setup(ext_modules=extensions)
|
||||
|
||||
Reference in New Issue
Block a user