wheels

package
v0.16.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CogWheelEnvVar = "COG_WHEEL"

CogWheelEnvVar is the environment variable name for wheel selection

Variables

This section is empty.

Functions

func ReadCogDataclassWheel

func ReadCogDataclassWheel() (string, []byte)

ReadCogDataclassWheel returns the embedded cog-dataclass wheel.

func ReadCogWheel

func ReadCogWheel() (string, []byte)

Types

type WheelConfig

type WheelConfig struct {
	// Source indicates where the wheel comes from
	Source WheelSource
	// URL is set when Source is WheelSourceURL
	URL string
	// Path is set when Source is WheelSourceFile
	Path string
}

WheelConfig represents the configuration for which wheel to install

func GetWheelConfig

func GetWheelConfig(cogRuntimeEnabled bool) *WheelConfig

GetWheelConfig returns the WheelConfig based on COG_WHEEL env var and cog_runtime flag. Priority:

  1. COG_WHEEL env var (if set, overrides everything)
  2. cog_runtime: true -> coglet-alpha (PinnedCogletURL)
  3. cog_runtime: false (default) -> embedded cog wheel

func ParseCogWheel

func ParseCogWheel(value string) *WheelConfig

ParseCogWheel parses a COG_WHEEL value and returns the appropriate WheelConfig. Supported values:

  • "cog" - Embedded cog wheel
  • "coglet" - Embedded coglet wheel
  • "coglet-alpha" - PinnedCogletURL
  • "cog-dataclass" - Embedded cog-dataclass wheel (pydantic-less)
  • "https://..." or "http://..." - Direct wheel URL
  • "/path/to/file.whl" or "./path/to/file.whl" - Local wheel file

Returns nil if the value is empty (caller should use defaults).

type WheelSource

type WheelSource int

WheelSource represents the source type for the wheel to install

const (
	// WheelSourceCog uses the embedded cog wheel (default when cog_runtime: false)
	WheelSourceCog WheelSource = iota
	// WheelSourceCogletEmbedded uses the embedded coglet wheel
	WheelSourceCogletEmbedded
	// WheelSourceCogletAlpha uses the PinnedCogletURL (default when cog_runtime: true)
	WheelSourceCogletAlpha
	// WheelSourceCogDataclass uses the embedded cog-dataclass wheel (pydantic-less)
	WheelSourceCogDataclass
	// WheelSourceURL uses a custom URL
	WheelSourceURL
	// WheelSourceFile uses a local file path
	WheelSourceFile
)

func (WheelSource) String

func (s WheelSource) String() string

String returns the string representation of the WheelSource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL