runtime

package
v0.0.0-...-0499334 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRuntimeName = "deno"

DefaultRuntimeName is the runtime used when none are specified or detected

Variables

This section is empty.

Functions

func ActivatePythonVenvIfPresent

func ActivatePythonVenvIfPresent(fs afero.Fs, os types.Os, projectDir string) (bool, error)

ActivatePythonVenvIfPresent activates a Python virtual environment if one exists in the given project directory. This sets VIRTUAL_ENV, prepends the venv bin directory to PATH, and unsets PYTHONHOME on the current process so that child processes (hook scripts) inherit the activated venv.

Types

type Runtime

type Runtime interface {
	IgnoreDirectories() []string
	InstallProjectDependencies(context.Context, string, hooks.HookExecutor, iostreams.IOStreamer, afero.Fs, types.Os) (string, error)
	Name() string
	Version() string
	SetVersion(string)
	HooksJSONTemplate() []byte
	PreparePackage(context.Context, hooks.SDKCLIConfig, hooks.HookExecutor, types.PreparePackageOpts) error
}

Runtime interface generalizes the required functionality for any runtime language. Example runtimes: Node.js, Deno, Python, Java, etc.

func New

func New(runtimeName string) (Runtime, error)

New creates a new runtime using runtimeName to choose the runtime

runtimeName uses the hosted version pattern, e.g. deno1.1, deno1.x

func NewDetectProject

func NewDetectProject(ctx context.Context, fs afero.Fs, dirPath string, sdkConfig hooks.SDKCLIConfig) (Runtime, error)

NewDetectProject returns a new Runtime based on the project type of dirPath

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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