python

package
v0.0.0-...-8241c8d Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateVenvIfPresent

func ActivateVenvIfPresent(fs afero.Fs, osClient types.Os, projectDir string) (bool, error)

ActivateVenvIfPresent sets the process environment variables that a Python virtual environment's activate script would set, so that child processes (hook scripts) inherit the activated venv. This is a no-op when no .venv directory exists in projectDir.

The three env vars (VIRTUAL_ENV, PATH, PYTHONHOME) are the stable contract defined by PEP 405 (Python 3.3, 2012). Other tools (Poetry, tox, pipx) use the same approach. Sourcing the shell-specific activate script (activate, activate.fish, Activate.ps1) would be higher maintenance because it varies by shell.

func IsRuntimeForProject

func IsRuntimeForProject(ctx context.Context, fs afero.Fs, dirPath string, sdkConfig hooks.SDKCLIConfig) bool

IsRuntimeForProject returns true if dirPath is a Python project

Types

type Python

type Python struct {
}

Python runtime type

func New

func New() *Python

New creates a new Python runtime

func (*Python) HooksJSONTemplate

func (p *Python) HooksJSONTemplate() []byte

HooksJSONTemplate returns the default hooks.json template

func (*Python) IgnoreDirectories

func (p *Python) IgnoreDirectories() []string

IgnoreDirectories is a list of directories to ignore when packaging the runtime for deployment.

func (*Python) InstallProjectDependencies

func (p *Python) InstallProjectDependencies(ctx context.Context, projectDirPath string, hookExecutor hooks.HookExecutor, ios iostreams.IOStreamer, fs afero.Fs, os types.Os) (output string, err error)

InstallProjectDependencies creates a virtual environment and installs project dependencies.

func (*Python) Name

func (p *Python) Name() string

Name prints the name of the runtime

func (*Python) PreparePackage

func (p *Python) PreparePackage(ctx context.Context, sdkConfig hooks.SDKCLIConfig, hookExecutor hooks.HookExecutor, opts types.PreparePackageOpts) error

PreparePackage will prepare and copy the app in projectDirPath to tmpDirPath as a release-ready bundle.

func (*Python) SetVersion

func (p *Python) SetVersion(version string)

SetVersion sets the Version value

func (*Python) Version

func (p *Python) Version() string

Version is the runtime version used by the hosted app deployment

Jump to

Keyboard shortcuts

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