From: Fabian Fichter Date: Sat, 19 Jul 2025 10:50:22 +0000 (+0200) Subject: Add python stub file X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=eef1ccc875caeb147516ff78e80ce3f333883809;p=fairystockfish.git Add python stub file Improve IDE integration by providing a stub file. --- diff --git a/pyffish.pyi b/pyffish.pyi new file mode 100644 index 0000000..c955f22 --- /dev/null +++ b/pyffish.pyi @@ -0,0 +1,39 @@ +from typing import Any + +FEN_OK: int +NOTATION_DEFAULT: int +NOTATION_JANGGI: int +NOTATION_LAN: int +NOTATION_SAN: int +NOTATION_SHOGI_HODGES: int +NOTATION_SHOGI_HODGES_NUMBER: int +NOTATION_SHOGI_HOSKING: int +NOTATION_THAI_LAN: int +NOTATION_THAI_SAN: int +NOTATION_XIANGQI_WXF: int +VALUE_DRAW: int +VALUE_MATE: int + +class error(Exception): ... + +def version() -> tuple[int, int, int]: ... +def info() -> str: ... +def variants() -> list[str]: ... +def set_option(name: str, value: Any) -> None: ... +def load_variant_config(config: str) -> None: ... +def start_fen(variant: str) -> str: ... +def two_boards(variant: str) -> bool: ... +def captures_to_hand(variant: str) -> bool: ... +def get_san(variant: str, fen: str, move: str, chess960: bool = False, notation: int = NOTATION_DEFAULT) -> str: ... +def get_san_moves(variant: str, fen: str, movelist: list[str], chess960: bool = False, notation: int = NOTATION_DEFAULT) -> list[str]: ... +def legal_moves(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> list[str]: ... +def get_fen(variant: str, fen: str, movelist: list[str], chess960: bool = False, sfen: bool = False, show_promoted: bool = False, count_started: int = 0) -> str: ... +def gives_check(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> bool: ... +def is_capture(variant: str, fen: str, movelist: list[str], move: str, chess960: bool = False) -> bool: ... +def piece_to_partner(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> str: ... +def game_result(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> int: ... +def is_immediate_game_end(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> tuple[bool, int]: ... +def is_optional_game_end(variant: str, fen: str, movelist: list[str], chess960: bool = False, count_started: int = 0) -> tuple[bool, int]: ... +def has_insufficient_material(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> tuple[bool, bool]: ... +def validate_fen(fen: str, variant: str, chess960: bool = False) -> int: ... +def get_fog_fen(fen: str, variant: str, chess960: bool = False) -> str: ... diff --git a/setup.py b/setup.py index 81d4683..707042c 100644 --- a/setup.py +++ b/setup.py @@ -49,5 +49,6 @@ setup(name="pyffish", version="0.0.88", classifiers=CLASSIFIERS, url="https://github.com/gbtami/Fairy-Stockfish", python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - ext_modules=[pyffish_module] + ext_modules=[pyffish_module], + data_files=[("", ["pyffish.pyi"])] )