diff --git a/Makefile b/Makefile index afa8c93..cb08dab 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,12 @@ serve: # Lint lint: fmt - uvx ruff check chess_pressure/ + uvx ruff check src/chess_pressure/ # Format fmt: - uvx ruff format chess_pressure/ - uvx ruff check --fix chess_pressure/ + uvx ruff format src/chess_pressure/ + uvx ruff check --fix src/chess_pressure/ help: @echo "chess-pressure" diff --git a/pyproject.toml b/pyproject.toml index 76057ea..ba330ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,3 +12,10 @@ dependencies = [ [project.scripts] chess-pressure = "chess_pressure.app:main" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["src/chess_pressure"] diff --git a/__init__.py b/src/chess_pressure/__init__.py similarity index 100% rename from __init__.py rename to src/chess_pressure/__init__.py diff --git a/app.py b/src/chess_pressure/app.py similarity index 96% rename from app.py rename to src/chess_pressure/app.py index 482027f..e25ad47 100644 --- a/app.py +++ b/src/chess_pressure/app.py @@ -13,7 +13,7 @@ from pydantic import BaseModel from .engine import make_move, parse_pgn from .games import get_game_list, get_game_pgn -STATIC = Path(__file__).resolve().parent.parent / "static" +STATIC = Path(__file__).resolve().parent / "static" app = FastAPI(title="Chess Pressure", docs_url=None, redoc_url=None) diff --git a/engine.py b/src/chess_pressure/engine.py similarity index 100% rename from engine.py rename to src/chess_pressure/engine.py diff --git a/games.py b/src/chess_pressure/games.py similarity index 100% rename from games.py rename to src/chess_pressure/games.py diff --git a/static/app.js b/src/chess_pressure/static/app.js similarity index 100% rename from static/app.js rename to src/chess_pressure/static/app.js diff --git a/static/gif.js b/src/chess_pressure/static/gif.js similarity index 100% rename from static/gif.js rename to src/chess_pressure/static/gif.js diff --git a/static/gif.worker.js b/src/chess_pressure/static/gif.worker.js similarity index 100% rename from static/gif.worker.js rename to src/chess_pressure/static/gif.worker.js diff --git a/static/img/chesspieces/wikipedia/bB.png b/src/chess_pressure/static/img/chesspieces/wikipedia/bB.png similarity index 100% rename from static/img/chesspieces/wikipedia/bB.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/bB.png diff --git a/static/img/chesspieces/wikipedia/bK.png b/src/chess_pressure/static/img/chesspieces/wikipedia/bK.png similarity index 100% rename from static/img/chesspieces/wikipedia/bK.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/bK.png diff --git a/static/img/chesspieces/wikipedia/bN.png b/src/chess_pressure/static/img/chesspieces/wikipedia/bN.png similarity index 100% rename from static/img/chesspieces/wikipedia/bN.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/bN.png diff --git a/static/img/chesspieces/wikipedia/bP.png b/src/chess_pressure/static/img/chesspieces/wikipedia/bP.png similarity index 100% rename from static/img/chesspieces/wikipedia/bP.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/bP.png diff --git a/static/img/chesspieces/wikipedia/bQ.png b/src/chess_pressure/static/img/chesspieces/wikipedia/bQ.png similarity index 100% rename from static/img/chesspieces/wikipedia/bQ.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/bQ.png diff --git a/static/img/chesspieces/wikipedia/bR.png b/src/chess_pressure/static/img/chesspieces/wikipedia/bR.png similarity index 100% rename from static/img/chesspieces/wikipedia/bR.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/bR.png diff --git a/static/img/chesspieces/wikipedia/wB.png b/src/chess_pressure/static/img/chesspieces/wikipedia/wB.png similarity index 100% rename from static/img/chesspieces/wikipedia/wB.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/wB.png diff --git a/static/img/chesspieces/wikipedia/wK.png b/src/chess_pressure/static/img/chesspieces/wikipedia/wK.png similarity index 100% rename from static/img/chesspieces/wikipedia/wK.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/wK.png diff --git a/static/img/chesspieces/wikipedia/wN.png b/src/chess_pressure/static/img/chesspieces/wikipedia/wN.png similarity index 100% rename from static/img/chesspieces/wikipedia/wN.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/wN.png diff --git a/static/img/chesspieces/wikipedia/wP.png b/src/chess_pressure/static/img/chesspieces/wikipedia/wP.png similarity index 100% rename from static/img/chesspieces/wikipedia/wP.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/wP.png diff --git a/static/img/chesspieces/wikipedia/wQ.png b/src/chess_pressure/static/img/chesspieces/wikipedia/wQ.png similarity index 100% rename from static/img/chesspieces/wikipedia/wQ.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/wQ.png diff --git a/static/img/chesspieces/wikipedia/wR.png b/src/chess_pressure/static/img/chesspieces/wikipedia/wR.png similarity index 100% rename from static/img/chesspieces/wikipedia/wR.png rename to src/chess_pressure/static/img/chesspieces/wikipedia/wR.png diff --git a/static/index.html b/src/chess_pressure/static/index.html similarity index 100% rename from static/index.html rename to src/chess_pressure/static/index.html diff --git a/static/style.css b/src/chess_pressure/static/style.css similarity index 100% rename from static/style.css rename to src/chess_pressure/static/style.css