Skip to content

Commit 4eb2d0f

Browse files
committed
Fix capture-anything config and auto-build pyffish
1 parent 52de5ca commit 4eb2d0f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/variants.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2055,5 +2055,4 @@ ironPieceTypes = p
20552055
# Chess, but you may capture your own pieces and pawns
20562056
# https://www.chess.com/terms/capture-anything-chess
20572057
[capture-anything:chess]
2058-
name = Capture Anything
20592058
selfCapture = true

test.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
# -*- coding: utf-8 -*-
22

33
import faulthandler
4+
import importlib
5+
import subprocess
6+
import sys
7+
from pathlib import Path
48
import unittest
5-
import pyffish as sf
9+
10+
try:
11+
import pyffish as sf
12+
except ModuleNotFoundError: # pragma: no cover - only runs in environments without pyffish installed
13+
repo_root = Path(__file__).resolve().parent
14+
try:
15+
import setuptools # type: ignore # noqa: F401
16+
except ModuleNotFoundError:
17+
subprocess.run([sys.executable, "-m", "ensurepip", "--upgrade"], cwd=repo_root, check=False)
18+
subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "setuptools", "wheel"], cwd=repo_root)
19+
subprocess.check_call([sys.executable, "setup.py", "build_ext", "--inplace"], cwd=repo_root)
20+
sf = importlib.import_module("pyffish")
621

722
faulthandler.enable()
823

0 commit comments

Comments
 (0)