Skip to content

Commit

Permalink
PyPy cannot do Gaviota
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Nov 30, 2016
1 parent d4c845b commit 16976ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
13 changes: 0 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,19 +290,6 @@ Features
* Probe Gaviota endgame tablebases (DTM, WDL).
`Docs <https://python-chess.readthedocs.io/en/latest/gaviota.html>`__.

.. code:: python
>>> import chess.gaviota
>>> tablebases = chess.gaviota.open_tablebases("data/gaviota")
>>> # White to move mates in 31 half moves in this KRvK endgame.
>>> board = chess.Board("8/8/8/8/4k3/8/6R1/7K w - - 0 1")
>>> tablebases.probe_dtm(board)
31
>>> tablebases.close()
* Probe Syzygy endgame tablebases (DTZ, WDL).
`Docs <https://python-chess.readthedocs.io/en/latest/syzygy.html>`__.

Expand Down
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ def dependencies():

def extra_dependencies():
extras = {}
extras["uci"] = []
extras["gaviota"] = []

if sys.version_info < (3, 2):
extras["uci"] = ["futures"]
else:
extras["uci"] = []

if sys.version_info < (3, 3):
extras["gaviota"] = ["backports.lzma"]
if platform.python_implementation() == "CPython":
if sys.version_info < (3, 3):
extras["gaviota"] = ["backports.lzma"]
else:
extras["gaviota"] = []

return extras

Expand Down
3 changes: 3 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2642,6 +2642,9 @@ def test_issue_93(self):
class NativeGaviotaTestCase(unittest.TestCase):

def setUp(self):
if platform.python_implementation() != "CPython":
self.skipTest("need CPython for native Gaviota")

try:
self.tablebases = chess.gaviota.open_tablebases_native("data/gaviota")
except (OSError, RuntimeError):
Expand Down

0 comments on commit 16976ee

Please sign in to comment.