Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fail_fast: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-toml
- id: check-yaml
Expand All @@ -19,20 +19,20 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/psf/black
rev: 25.1.0
rev: 25.9.0
hooks:
- id: black
args: [--config=pyproject.toml]

- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: "v0.11.4"
rev: "v0.13.2"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, "--config=pyproject.toml"] # enable autofix

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
rev: v1.18.2
hooks:
- id: mypy
args: ["--config-file=pyproject.toml"]
Expand All @@ -48,7 +48,7 @@ repos:
pass_filenames: false

- repo: https://github.com/PyCQA/bandit
rev: 1.8.3
rev: 1.8.6
hooks:
- id: bandit
args: ["--config=pyproject.toml"]
Expand Down
7 changes: 3 additions & 4 deletions chess_agent/core/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

import datetime
from enum import StrEnum
from typing import Optional

from pydantic import BaseModel, Field

PlayerInfo = dict[str, Optional[int | str | bool]]
PlayerInfo = dict[str, int | str | bool | None]


GAME_EXPLANATION = """You are the Black side in every game, meaning that you will always
Expand Down Expand Up @@ -108,8 +107,8 @@ class CreatedGamePerson(BaseModel):
id: str
url: str
status: str
challenger: dict[str, Optional[str | int]]
dest_user: dict[str, Optional[str | int]] = Field(alias="destUser")
challenger: dict[str, str | int | None]
dest_user: dict[str, str | int | None] = Field(alias="destUser")
variant: dict[str, str]
time_control: dict[str, str] = Field(alias="timeControl")
color: str
Expand Down
4 changes: 2 additions & 2 deletions chess_agent/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import logging
import os
from collections.abc import Callable
from typing import Any, Optional, cast
from typing import Any, cast

from berserk import Client, TokenSession, exceptions
from chess import Board
Expand Down Expand Up @@ -70,7 +70,7 @@ async def login() -> None:
Args:
api_key: The API key to use for logging in.
"""
api_key: Optional[str] = os.getenv("API_KEY")
api_key: str | None = os.getenv("API_KEY")
if not api_key:
raise ValueError(
"API_KEY not found in environment variables. Please set it in your .env"
Expand Down