Refactor chesspp module with pyproject

This commit is contained in:
2024-01-27 21:36:46 +01:00
parent 69aa9ce2d9
commit c69b542653
12 changed files with 27 additions and 11 deletions

View File

@@ -1,11 +1,10 @@
import chess
import chess.engine
import chess.pgn
from chesspp.classic_mcts import ClassicMcts
from chesspp import engine
from chesspp import eval
from chesspp import util
from chesspp import simulation
from src.chesspp.classic_mcts import ClassicMcts
from src.chesspp import engine
from src.chesspp import util
from src.chesspp import simulation, eval
def test_simulate():

13
pyproject.toml Normal file
View File

@@ -0,0 +1,13 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "chess-pp"
version = "0.1"
dependencies = [
"chess==1.10.0",
"numpy==1.26.3",
"stockfish==3.28.0",
]
requires-python = ">= 3.10"

0
src/chesspp/__init__.py Normal file
View File

View File

@@ -1,10 +1,12 @@
import chess
import random
import eval
import util
import numpy as np
from chesspp import eval
from chesspp import util
class ClassicMcts:
def __init__(self, board: chess.Board, color: chess.Color, parent=None, move: chess.Move | None = None,

View File

@@ -1,9 +1,10 @@
from abc import ABC, abstractmethod
import chess
import chess.engine
from classic_mcts import ClassicMcts
import random
from chesspp.classic_mcts import ClassicMcts
class Engine(ABC):
color: chess.Color

View File

@@ -1,7 +1,7 @@
import chess
from abc import ABC, abstractmethod
from i_strategy import IStrategy
from typing import Dict
from chesspp.i_strategy import IStrategy
class IMcts(ABC):

View File

@@ -1,6 +1,7 @@
from lichess_bot.lib.engine_wrapper import MinimalEngine, MOVE
import chess.engine
import engine
from chesspp import engine
class ProbStockfish(MinimalEngine):

View File

@@ -6,7 +6,7 @@ from typing import Tuple, List
from enum import Enum
from dataclasses import dataclass
from engine import Engine
from chesspp.engine import Engine
class Winner(Enum):