Skip to content

Tags: gcz/python-chess

Tags

v0.30.1

Toggle v0.30.1's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.30.1

Changes:

* Positions with more than two checkers are considered invalid and
  `board.status()` returns `chess.STATUS_TOO_MANY_CHECKERS`.
* Pawns drops in Crazyhouse are considered zeroing and reset
  `board.halfmove_clock` when played.
* Now validating file sizes when opening Syzygy tables and Polyglot opening
  books.
* Explicitly warn about untrusted tablebase files and chess engines.

Bugfixes:

* Fix Racing Kings game end detection: Black cannot catch up if their own
  pieces block the goal. White would win on the turn, so this did not
  impact the game theoretical outcome of the game.
* Fix bugs discovered by fuzzing the EPD parser: Fixed serialization of
  empty strings, reparsability of empty move lists, handling of non-finite
  floats, and handling of whitespace in opcodes.

Features:

* Added `board.checkers()`, returning a set of squares with the pieces giving
  check.

v0.30.0

Toggle v0.30.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.30.0

Changes:

* **Dropped support for Python 3.5.**
* Remove explicit loop arguments in `chess.engine` module, following
  https://bugs.python.org/issue36373.

Bugfixes:

* `chess.engine.EngineProtocol.returncode` is no longer poisoned when
  `EngineProtocol.quit()` times out.
* `chess.engine.PlayResult.info` was not always of type
  `chess.engine.InfoDict`.

Features:

* The background thread spawned by `chess.engine.SimpleEngine` is now named
  for improved debuggability, revealing the PID of the engine process.
* `chess.engine.EventLoopPolicy` now supports `asyncio.PidfdChildWatcher`
  when running on Python 3.9+ and Linux 5.3+.
* Add `chess.Board.san_and_push()`.

v0.29.0

Toggle v0.29.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.29.0

Changes:

* `chess.variant.GiveawayBoard` **now starts with castling rights**.
  `chess.variant.AntichessBoard` is the same variant without castling rights.
* UCI info parser no longer reports errors when encountering unknown tokens.
* Performance improvements for repetition detection.
* Since Python 3.8: `chess.syzygy`/`chess.polyglot` use `madvise(MADV_RANDOM)`
  to prepare table/book files for random access.

Bugfixes:

* Fix syntax error in type annotation of `chess.engine.run_in_background()`.
* Fix castling rights when king is exploded in Atomic. Mitigated by the fact
  that the game is over and that it did not affect FEN.
* Fix insufficient material with underpromoted pieces in Crazyhouse. Mitigated
  by the fact that affected positions are unreachable in Crazyhouse.

Features:

* Support `wdl` in UCI info (usually activated with `UCI_ShowWDL`).

v0.28.3

Toggle v0.28.3's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.28.3

Bugfixes:

* Follow FICS rules in Atomic castling edge cases.
* Handle self-reported errors by XBoard engines "Error: ..." or
  "Illegal move: ...".

v0.28.2

Toggle v0.28.2's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.28.2

Bugfixes:

* Fixed exception propagation, when an UCI engine sends an invalid `bestmove`.
  Thanks @fsmosca.

Changes:

* `chess.Move.from_uci()` no longer accepts moves from and to the same square,
  for example `a1a1`. `0000` is now the only valid null move notation.

v0.28.1

Toggle v0.28.1's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.28.1

Bugfixes:

* The minimum Python version is 3.5.3 (instead of 3.5.0).
* Fix `board.is_irreversible()` when capturing a rook that had castling rights.

Changes:

* `is_en_passant()`, `is_capture()`, `is_zeroing()`, `is_irreversible()`,
  `is_castling()`, `is_kingside_castling()` and `is_queenside_castling()`
  now consistently return `False` for null moves.
* Added `chess.engine.InfoDict` class with typed shorthands for common keys.
* Support `[Variant "3-check"]` (from chess.com PGNs).

v0.28.0

Toggle v0.28.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.28.0

Changes:

* Dropped support for Python 3.4 (end of life reached).
* `chess.polyglot.Entry.move` **is now a property instead of a method**.
  The raw move is now always decoded in the context of the position (relevant
  for castling moves).
* `Piece`, `Move`, `BaseBoard` and `Board` comparisons no longer support
  ducktyping.
* FENs sent to engines now always include potential en-passant squares, even if
  no legal en-passant capture exists.
* Circular SVG arrows now have a `circle` CSS class.
* Superfluous dashes (-) in EPDs are no longer treated as opcodes.
* Removed `GameCreator`, `HeaderCreator` and `BoardCreator` aliases for
  `{Game,Headers,Board}Builder`.

Bugfixes:

* Notation like `Kh1` is no longer accepted for castling moves.
* Remove stale files from wheels published on PyPI.
* Parsing Three-Check EPDs with moves was always failing.
* Some methods in `chess.variant` were returning bool-ish integers, when they
  should have returned `bool`.
* `chess.engine`: Fix line decoding when Windows line-endings arrive seperately
  in stdout buffer.
* `chess.engine`: Survive timeout in analysis.
* `chess.engine`: Survive unexpected `bestmove` sent by misbehaving UCI engines.

New features:

* **Experimental type signatures for almost all public APIs** (`typing`).
  Some modules do not yet internally pass typechecking.
* Added `Board.color_at(square)`.
* Added `chess.engine.AnalysisResult.get()` and `empty()`.
* `chess.engine`: The `UCI_AnalyseMode` option is still automatically managed,
  but can now be overwritten.
* `chess.engine.EngineProtocol` and constructors now optionally take
  an explicit `loop` argument.

v0.27.3

Toggle v0.27.3's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.27.3

Changes:

* `XBoardProtocol` will no longer raise an exception when the engine resigned.
  Instead it sets a new flag `PlayResult.resigned`. `resigned` and
  `draw_offered` are keyword-only arguments.
* Renamed `chess.pgn.{Game,Header,Board}Creator` to
  `{Game,Headers,Board}Builder`. Aliases kept in place.

Bugfixes:

* Make `XBoardProtocol` robust against engines that send a move after claiming
  a draw or resigning. Thanks @pascalgeo.
* `XBoardProtocol` no longer ignores `Hint:` sent by the engine.
* Fix handling of illegal moves in `XBoardProtocol`.
* Fix exception when engine is shut down while pondering.
* Fix unhandled internal exception and file descriptor leak when engine
  initialization fails.
* Fix `HordeBoard.status()` when black pieces are on the first rank.
  Thanks @Wisling.

New features:

* Added `chess.pgn.Game.builder()`, `chess.pgn.Headers.builder()` and
  `chess.pgn.GameNode.dangling_node()` to simplify subclassing `GameNode`.
* `EngineProtocol.communicate()` is now also available in the synchronous API.

v0.27.2

Toggle v0.27.2's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.27.2

Bugfixes:

* `chess.engine.XBoardProtocol.play()` was searching 100 times longer than
  intended when using `chess.engine.Limit.time`, and searching 100 times more
  nodes than intended when using `chess.engine.Limit.nodes`. Thanks @pascalgeo.

v0.27.1

Toggle v0.27.1's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.27.1

Bugfixes:

* `chess.engine.XBoardProtocol.play()` was raising `KeyError` when using time
  controls with increment or remaining moves.