Skip to content

Settings ​

Each scotch command reads the settings below from what Settings declares, so a change to a default goes in a SCOTCH_ variable or under the [tool.scotch] table of the project's pyproject.toml.

VariableKeyTypeDefaultMeaning
SCOTCH_DATAdataA path.cache/dataThe directory holding the store's data, with the fetched files under its downloads folder and the index under its index folder, read against the project's root where relative.
SCOTCH_RETRIESretriesAn integer from 05The number of times a request is sent again after it fails to connect, times out before the response's headers arrive, or meets a status naming a passing fault such as 503, each one at once.
SCOTCH_TIMEOUT_Stimeout_sA number above 030The seconds a request waits to connect, and then for each read of the response, before it fails.

Moving the Data ​

SCOTCH_DATA moves the store's data to another directory, such as a drive with more room, for the one command it prefixes or, once exported, for every command the shell runs after it:

bash
SCOTCH_DATA=/data/scotch scotch fetch games
export SCOTCH_DATA=/data/scotch
scotch index games

The data key under [tool.scotch] moves it for every command run inside the clone:

toml
[tool.scotch]
data = "/data/scotch"

The Read Order ​

A command takes each setting from the first of these that names it:

  1. A keyword argument passed to Settings
  2. The SCOTCH_ variable
  3. The [tool.scotch] table of the project's pyproject.toml
  4. The default the table above lists

The Root ​

A relative path is read against the project's root, so the default .cache/data lands under the clone mise run builds from, wherever a command runs inside it.

scotch.cli.settings.root reads the directory the scotch distribution was installed from, which an installer records in the direct_url.json PEP 610 specifies, or the working directory where it recorded none.1

Sources

  1. Bidoul, Stéphane, and Chris Jerdonek. 2019. "PEP 610 – Recording the Direct URL Origin of installed distributions," Specification. https://peps.python.org/pep-0610/#specification ↩︎

Built from22ebd11
CodeJybbs/scotch
GamesPGN Mentor
Crateshakmaty, GPL
FacesSIL OFL 1.1
PiecesCburnett, BSD

Scotch 0.2.0, under the GPL-3.0-or-later.