Skip to content

Releases: niklasf/python-chess

python-chess v1.6.1

12 Jun 08:23
v1.6.1
Compare
Choose a tag to compare
Bugfixes:

* Make ``chess.engine.SimpleEngine.play(..., draw_offered=True)`` available.
  Previously only added for ``chess.engine.Protocol``.

python-chess v1.6.0

11 Jun 14:21
v1.6.0
Compare
Choose a tag to compare
New features:

* Allow offering a draw to XBoard engines using
  ``chess.engine.Protocol.play(..., draw_offered=True)``.
* Now detects insufficient material in Horde. Thanks @stevepapazis!

Changes:

* ``chess.engine.popen_engine(..., setpgrp=True)`` on Windows now merges
  ``CREATE_NEW_PROCESS_GROUP`` into ``creationflags`` instead of overriding.
  On Unix it now uses ``start_new_session`` instead of calling ``setpgrp`` in
  ``preexec_fn``.
* Declare that ``chess.svg`` produces SVG Tiny 1.2, and prepare SVG 2 forwards
  compatibility.

Bugfixes:

* Fix slightly off-center pawns in ``chess.svg``.
* Fix typing error in Python 3.10 (due to added ``int.bit_count``).

python-chess v1.5.0

07 Apr 08:47
v1.5.0
Compare
Choose a tag to compare
Bugfixes:

* Fixed typing of ``chess.pgn.Mainline.__reversed__()``. It is now a generator,
  and ``chess.pgn.ReverseMainline`` has been **removed**.
  This is a breaking change but a required bugfix.
* Implement UCI **ponderhit** for consecutive calls to
  ``chess.engine.Protocol.play(..., ponder=True)``. Previously, the pondering
  search was always stopped and restarted.
* Provide the full move stack, not just the position, for UCI pondering.
* Fixed XBoard level in sudden death games.
* Ignore trailing space after ponder move sent by UCI engine.
  Previously, such a move would be rejected.
* Prevent cancelling engine commands after they have already been cancelled or
  completed. Some internals (``chess.engine.BaseCommand``) have been changed to
  accomplish this.

New features:

* Added ``chess.Board.outcome()``.
* Implement and accept usermove feature for XBoard engines.

Special thanks to @MarkZH for many of the engine related changes in this
release!

python-chess v1.4.0

25 Jan 12:24
v1.4.0
Compare
Choose a tag to compare
New features:

* Let ``chess.pgn.GameNode.eval()`` accept PGN comments like
  ``[%eval 2.5,11]``, meaning 250 centipawns at depth 11.
  Use ``chess.pgn.GameNode.eval_depth()`` and
  ``chess.pgn.GameNode.set_eval(..., depth)`` to get and set the depth.
* Read and write PGN comments with millisecond precision like
  ``[%clk 1:23:45.678]``.

Changes:

* Recover from invalid UTF-8 sent by an UCI engine, by ignoring that
  (and only that) line.

python-chess v1.3.3

27 Dec 14:26
v1.3.3
Compare
Choose a tag to compare
Bugfixes:

* Fixed unintended collisions and optimized ``chess.Piece.__hash__()``.
* Fixed false-positive ``chess.STATUS_IMPOSSIBLE_CHECK`` if checkers are
  aligned with other king.

Changes:

* Also detect ``chess.STATUS_IMPOSSIBLE_CHECK`` if checker is aligned with
  en passant square and king.

New features:

* Implemented Lichess winning chance model for ``chess.engine.Score``:
  ``score.wdl(model="lichess")``.

python-chess v1.3.2

12 Dec 13:37
v1.3.2
Compare
Choose a tag to compare
Bugfixes:

* Added a new reason for ``board.status()`` to be invalid:
  ``chess.STATUS_IMPOSSIBLE_CHECK``. This detects positions where two sliding
  pieces are giving check while also being aligned with the king
  on the same rank, file, or diagonal. Such positions are impossible to reach,
  break Stockfish, and maybe other engines.

python-chess v1.3.1

06 Dec 12:36
v1.3.1
Compare
Choose a tag to compare
Bugfixes:

* ``chess.pgn.read_game()`` now properly detects variant games with Chess960
  castling rights (as well as mislabeled Standard Chess960 games). Previously
  all castling moves in such games were rejected.

python-chess v1.3.0

06 Nov 16:25
v1.3.0
Compare
Choose a tag to compare
Changes:

* Introduced ``chess.pgn.ChildNode``, a subclass of ``chess.pgn.GameNode``
  for all nodes other than the root node, and converted ``chess.pgn.GameNode``
  to an abstract base class. This improves ergonomics in typed code.

  The change is backwards compatible if using only documented features.
  However, a notable undocumented feature is the ability to create dangling
  nodes. This is no longer possible. If you have been using this for
  subclassing, override ``GameNode.add_variation()`` instead of
  ``GameNode.dangling_node()``. It is now the only method that creates child
  nodes.

Bugfixes:

* Removed broken ``weakref`` based caching in ``chess.pgn.GameNode.board()``.

New features:

* Added ``chess.pgn.GameNode.next()``.

python-chess v1.2.2

29 Oct 17:32
v1.2.2
Compare
Choose a tag to compare
Bugfixes:

* Fixed regression, where releases were uploaded without the ``py.typed``
  marker.

python-chess v1.2.1

26 Oct 11:39
v1.2.1
Compare
Choose a tag to compare
The primary location for the published package is now
https://pypi.org/project/chess/. Thanks to
`Kristian Glass <https://github.com/doismellburning>`_ for transferring the
namespace.

The old https://pypi.org/project/python-chess/ will remain an alias that
installs the package from the new location as a dependency (as recommended by
`PEP423 <https://www.python.org/dev/peps/pep-0423/#how-to-rename-a-project>`_).