Skip to content

Commit eef1ccc

Browse files
committed
Add python stub file
Improve IDE integration by providing a stub file.
1 parent d76e1cc commit eef1ccc

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

pyffish.pyi

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from typing import Any
2+
3+
FEN_OK: int
4+
NOTATION_DEFAULT: int
5+
NOTATION_JANGGI: int
6+
NOTATION_LAN: int
7+
NOTATION_SAN: int
8+
NOTATION_SHOGI_HODGES: int
9+
NOTATION_SHOGI_HODGES_NUMBER: int
10+
NOTATION_SHOGI_HOSKING: int
11+
NOTATION_THAI_LAN: int
12+
NOTATION_THAI_SAN: int
13+
NOTATION_XIANGQI_WXF: int
14+
VALUE_DRAW: int
15+
VALUE_MATE: int
16+
17+
class error(Exception): ...
18+
19+
def version() -> tuple[int, int, int]: ...
20+
def info() -> str: ...
21+
def variants() -> list[str]: ...
22+
def set_option(name: str, value: Any) -> None: ...
23+
def load_variant_config(config: str) -> None: ...
24+
def start_fen(variant: str) -> str: ...
25+
def two_boards(variant: str) -> bool: ...
26+
def captures_to_hand(variant: str) -> bool: ...
27+
def get_san(variant: str, fen: str, move: str, chess960: bool = False, notation: int = NOTATION_DEFAULT) -> str: ...
28+
def get_san_moves(variant: str, fen: str, movelist: list[str], chess960: bool = False, notation: int = NOTATION_DEFAULT) -> list[str]: ...
29+
def legal_moves(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> list[str]: ...
30+
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: ...
31+
def gives_check(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> bool: ...
32+
def is_capture(variant: str, fen: str, movelist: list[str], move: str, chess960: bool = False) -> bool: ...
33+
def piece_to_partner(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> str: ...
34+
def game_result(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> int: ...
35+
def is_immediate_game_end(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> tuple[bool, int]: ...
36+
def is_optional_game_end(variant: str, fen: str, movelist: list[str], chess960: bool = False, count_started: int = 0) -> tuple[bool, int]: ...
37+
def has_insufficient_material(variant: str, fen: str, movelist: list[str], chess960: bool = False) -> tuple[bool, bool]: ...
38+
def validate_fen(fen: str, variant: str, chess960: bool = False) -> int: ...
39+
def get_fog_fen(fen: str, variant: str, chess960: bool = False) -> str: ...

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@
4949
classifiers=CLASSIFIERS,
5050
url="https://github.com/gbtami/Fairy-Stockfish",
5151
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
52-
ext_modules=[pyffish_module]
52+
ext_modules=[pyffish_module],
53+
data_files=[("", ["pyffish.pyi"])]
5354
)

0 commit comments

Comments
 (0)