rules/python/ruff_toolchain.js
Developer reference: this page includes exported implementation details. BUILD authors should prefer the User API reference.
RUFF_TOOL
const RUFF_TOOL
Undocumented.
ruffArtifactName()
ruffArtifactName(version, plat)
Return the ruff release archive filename for a version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
ruffDownloadUrl()
ruffDownloadUrl(version, plat)
Return the ruff release download URL for a version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
ruffCacheKey()
ruffCacheKey(version, plat)
Return the named-cache key for a ruff toolchain version and platform.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| plat | { os: string, arch: string } |
Returns: string
ruffSupportedPlatforms()
ruffSupportedPlatforms()
Undocumented.
RuffToolchain (implementation class)
class RuffToolchain
Implementation class. BUILD files should use ruffToolchain().
Undocumented.
ruffToolchain()
ruffToolchain(version, opts = {})
Declare a ruff toolchain version and optionally set it as the default. defaults to the bundled //rules/python/ruff-toolchain.lock. Point this at your own lock (regenerate via imp goal gen-lockfiles) when pinning a non-default version. matching lockfile entry (warns instead of failing).
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| [opts] | object | |
| [opts.default=false] | boolean | |
| [opts.lockfile] | string | Lockfile address pinning download SHA-256s; |
| [opts.unverified=false] | boolean | Allow downloading without a |
Returns: object Target handle for this ruff toolchain.
installRuffToolchain()
installRuffToolchain(version, source)
Install a local ruff toolchain directory into the named cache.
| Parameter | Type | Description |
|---|---|---|
| version | string | |
| source | string | Path to the directory containing the ruff binary. |
Returns: string|null Local path to the cached toolchain root.
acquireRuffToolchain
const acquireRuffToolchain
Acquire a ruff toolchain, downloading and caching it if not already installed in the named cache.
| Parameter | Type | Description |
|---|---|---|
| version | string |
Returns: Promise<string> Local path to the toolchain root.
resolveRuffToolchainVersion()
resolveRuffToolchainVersion(version)
Resolve an explicit or default ruff toolchain version.
| Parameter | Type | Description |
|---|---|---|
| [version] | string |
Returns: string|null
defaultRuffToolchainVersion()
defaultRuffToolchainVersion()
Return the currently configured default ruff toolchain version.
Returns: string|null
defaultRuffToolchain()
defaultRuffToolchain()
Return the currently configured default ruff toolchain target handle.
Returns: object|null