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.
| Variable | Key | Type | Default | Meaning |
|---|---|---|---|---|
SCOTCH_DATA | data | A path | .cache/data | The 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_RETRIES | retries | An integer from 0 | 5 | The 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_S | timeout_s | A number above 0 | 30 | The 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 gamesThe 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:
- A keyword argument passed to
Settings - The
SCOTCH_variable - The
[tool.scotch]table of the project'spyproject.toml - 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
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 ↩︎