View Source
const (
	// VirtualEnvRootENV is an environment variable that, if set, will be used
	// as the default VirtualEnv root.
	// This value overrides the default (~/.vpython), but can be overridden by the
	// "-root" flag.
	// Like "-root", if this value is present but empty, a tempdir will be used
	// for the VirtualEnv root.

	// DefaultSpecENV is an enviornment variable that, if set, will be used as the
	// default VirtualEnv spec file if none is provided or found through probing.


This section is empty.


This section is empty.


type Config

type Config struct {
	// PackageLoader is the package loader to use.
	PackageLoader venv.PackageLoader

	// VENVPackage is the VirtualEnv package to use for bootstrap generation.
	VENVPackage vpythonAPI.Spec_Package

	// BaseWheels is the set of wheels to include in the spec. These will always
	// be merged into the runtime spec and normalized, such that any duplicate
	// wheels will be deduplicated.
	BaseWheels []*vpythonAPI.Spec_Package

	// RelativePathOverride is a series of forward-slash-delimited paths to
	// directories relative to the "vpython" executable that will be checked
	// for Python targets prior to checking PATH. This allows bundles (e.g., CIPD)
	// that include both the wrapper and a real implementation, to force the
	// wrapper to use the bundled implementation if present.
	// See ""'s
	// RelativePathOverride member for more information.
	RelativePathOverride []string

	// PruneThreshold, if > 0, is the maximum age of a VirtualEnv before it
	// becomes candidate for pruning. If <= 0, no pruning will be performed.
	// See venv.Config's PruneThreshold.
	PruneThreshold time.Duration
	// MaxPrunesPerSweep, if > 0, is the maximum number of VirtualEnv that should
	// be pruned passively. If <= 0, no limit will be applied.
	// See venv.Config's MaxPrunesPerSweep.
	MaxPrunesPerSweep int

	// MaxScriptPathLen, if > 0, is the maximum generated script path lengt. If
	// a generated script is expected to exist longer than this, we will error.
	// See venv.Config's MaxScriptPathLen.
	MaxScriptPathLen int

	// WithVerificationConfig, if not nil, runs the supplied callback with
	// a Config instance to use for verification and the set of default
	// verification scenarios.
	// If nil, verification will only include the validation of the spec protobuf.
	WithVerificationConfig func(context.Context, func(Config, []*vpythonAPI.PEP425Tag) error) error

    Config is an application's default configuration.

    func (*Config) Main

    func (cfg *Config) Main(c context.Context) int

      Main is the main application entry point.

      type ReturnCodeError

      type ReturnCodeError int

        ReturnCodeError is an error wrapping a return code value.

        func (ReturnCodeError) Error

        func (err ReturnCodeError) Error() string

        type VerificationFunc

        type VerificationFunc func(context.Context, string, venv.PackageLoader, *vpythonAPI.Environment)

          VerificationFunc is a function used in environment verification.

          VerificationFunc will be invoked with a PackageLoader and an Environment to use for verification.