Skip to main content

Distributed Fairy-Stockfish analysis for pychess.org

Project description

fairyfishnet

PyPI version

Distributed Fairy-Stockfish analysis for pychess.org.

fairyfishnet requires Python 3.8 or newer.

Installation

  1. Request a personal fairyfishnet key on the pychess Discord server.

  2. Install uv.

  3. Install the worker as an isolated command-line tool:

    uv tool install --with pip fairyfishnet
    
  4. Start the worker and follow the configuration prompts:

    fairyfishnet --auto-update
    

To upgrade manually:

uv tool upgrade fairyfishnet

The extra pip package keeps the worker's existing --auto-update behavior available inside the isolated uv tool environment.

systemd

Generate a service file after configuring the worker:

fairyfishnet systemd

The command prints a service definition that can be reviewed and installed under /etc/systemd/system/.

Docker

Build the image. The Dockerfile installs the latest released fairyfishnet package from PyPI; it does not install the current checkout:

docker build -t fairyfishnet .
docker run --rm fairyfishnet --key MY_API_KEY --auto-update

Fairy-Stockfish

fairyfishnet uses the pychess-variants build of Fairy-Stockfish.

A suitable precompiled engine is downloaded automatically. To use a locally built engine, run ./build-stockfish.sh and pass its path with --stockfish-command.

Engine lifecycle, UCI, dynamic variant, and cache invariants are documented in ENGINES.md.

Development

The repository uses a src/ package layout and keeps tests under tests/.

Create the locked development environment using the oldest supported Python:

uv sync --locked --python 3.8

Run the fast tests and quality checks:

uv run pytest -m "not engine"
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv lock --check --python 3.8
uv build

The engine integration tests download or launch Fairy-Stockfish:

uv run pytest -m engine

Apply formatting with:

uv run ruff format .

Whenever project or development dependencies change, refresh and commit the lockfile:

uv lock

Repository layout

src/fairyfishnet/__init__.py   package metadata only
src/fairyfishnet/cli.py        argument parsing, commands, signals, and worker orchestration
src/fairyfishnet/config.py     configuration loading and validation
src/fairyfishnet/engine.py     subprocess management and the UCI protocol
src/fairyfishnet/worker.py     job acquisition, move generation, and analysis
src/fairyfishnet/variants.py   server variants.ini download and scoped cache lifecycle
src/fairyfishnet/downloads.py  engine downloads and self-update handling
src/fairyfishnet/cpuid.py      low-level CPU capability probing
src/fairyfishnet/http_utils.py HTTP and release-version helpers
tests/                         focused unit tests and engine integration tests
scripts/                       release and maintenance helpers
doc/                           fishnet protocol documentation

The fast suite is intentionally split by subsystem, so a regression normally points to the module that owns the behavior. Tests marked engine download or launch Fairy-Stockfish and are therefore slower and require network access on a clean checkout.

Protocol

See doc/protocol.md for the worker/server protocol.

Sequence diagram

Releasing

Set UV_PUBLISH_TOKEN, then run:

uv run python scripts/release.py

The release helper runs tests, Ruff, Pyright, builds distributions, verifies a clean Git tree, creates the version tag, pushes it, and publishes with uv.

License

fairyfishnet is licensed under GPL-3.0-or-later. See LICENSE.txt.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fairyfishnet-1.16.69.tar.gz (166.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fairyfishnet-1.16.69-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

Details for the file fairyfishnet-1.16.69.tar.gz.

File metadata

  • Download URL: fairyfishnet-1.16.69.tar.gz
  • Upload date:
  • Size: 166.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.1

File hashes

Hashes for fairyfishnet-1.16.69.tar.gz
Algorithm Hash digest
SHA256 e24fd40cdd4a4da5093c78b389d1bc18a594b7c4b4e8aae9bc8848101b74bb92
MD5 1ee4f5f702dda2a8e92cd0ae79af9b4a
BLAKE2b-256 4700cf87ad61859e65fe0948555dbcf7aed63cef6b6d81cc7b7307db88f02445

See more details on using hashes here.

File details

Details for the file fairyfishnet-1.16.69-py3-none-any.whl.

File metadata

  • Download URL: fairyfishnet-1.16.69-py3-none-any.whl
  • Upload date:
  • Size: 49.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.1

File hashes

Hashes for fairyfishnet-1.16.69-py3-none-any.whl
Algorithm Hash digest
SHA256 6813bfcf244035e8642077b340ed614f4592184385ecb6a468c0472b65201ee2
MD5 5ac9d031bfc2e78d9c8e439dac518fa2
BLAKE2b-256 2320f1796dd2ca9c256c40cbf1c8479987c62223352eeba499a8e459ab85aaa2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page