Documentation

Overview

Package vpython contains `vpython` environment definition protobufs.

Index

Constants

const Version = "v2"

Version is a version string. It must be updated any time the text protobufs advance in a non-backwards-compatible way.

This version string is used in the generation of filenames, and must be filesystem-compatible.


Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	// A constructed VirtualEnv.
	Spec *Spec `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"`
	// The resolved runtime parameters.
	Runtime *Runtime `protobuf:"bytes,2,opt,name=runtime,proto3" json:"runtime,omitempty"`
	// The PEP425 tags that were probed for this Python environment.
	Pep425Tag            []*PEP425Tag `protobuf:"bytes,3,rep,name=pep425_tag,json=pep425Tag,proto3" json:"pep425_tag,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

Environment describes a constructed VirtualEnv.

func (*Environment) Clone

func (e *Environment) Clone() *Environment

Clone returns a deep clone of the supplied Environment.

If e is nil, a non-nil empty Environment will be returned.

func (*Environment) Descriptor

func (*Environment) Descriptor() ([]byte, []int)

func (*Environment) GetPep425Tag

func (m *Environment) GetPep425Tag() []*PEP425Tag

func (*Environment) GetRuntime

func (m *Environment) GetRuntime() *Runtime

func (*Environment) GetSpec

func (m *Environment) GetSpec() *Spec

func (*Environment) ProtoMessage

func (*Environment) ProtoMessage()

func (*Environment) Reset

func (m *Environment) Reset()

func (*Environment) String

func (m *Environment) String() string

func (*Environment) XXX_DiscardUnknown

func (m *Environment) XXX_DiscardUnknown()

func (*Environment) XXX_Marshal

func (m *Environment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Environment) XXX_Merge

func (m *Environment) XXX_Merge(src proto.Message)

func (*Environment) XXX_Size

func (m *Environment) XXX_Size() int

func (*Environment) XXX_Unmarshal

func (m *Environment) XXX_Unmarshal(b []byte) error

type PEP425Tag

type PEP425Tag struct {
	// Python is the PEP425 python tag (e.g., "cp27").
	Python string `protobuf:"bytes,1,opt,name=python,proto3" json:"python,omitempty"`
	// ABI is the PEP425 "python ABI" tag (e.g., "cp27mu", "none").
	Abi string `protobuf:"bytes,2,opt,name=abi,proto3" json:"abi,omitempty"`
	// Platform is the PEP425 "python platform" tag (e.g., "linux_x86_64",
	// "armv7l", "any").
	Platform             string   `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Represents a Python PEP425 tag.

func (*PEP425Tag) AnyPlatform

func (t *PEP425Tag) AnyPlatform() bool

AnyPlatform returns true if t declares that it works on any platform.

func (*PEP425Tag) Count

func (t *PEP425Tag) Count() (v int)

Count returns the number of populated fields in this tag.

func (*PEP425Tag) Descriptor

func (*PEP425Tag) Descriptor() ([]byte, []int)

func (*PEP425Tag) GetAbi

func (m *PEP425Tag) GetAbi() string

func (*PEP425Tag) GetPlatform

func (m *PEP425Tag) GetPlatform() string

func (*PEP425Tag) GetPython

func (m *PEP425Tag) GetPython() string

func (*PEP425Tag) HasABI

func (t *PEP425Tag) HasABI() bool

HasABI returns true if t declares that it only works with a specific ABI.

func (*PEP425Tag) IsZero

func (t *PEP425Tag) IsZero() bool

IsZero returns true if this tag is a zero value.

func (*PEP425Tag) ProtoMessage

func (*PEP425Tag) ProtoMessage()

func (*PEP425Tag) Reset

func (m *PEP425Tag) Reset()

func (*PEP425Tag) String

func (m *PEP425Tag) String() string

func (*PEP425Tag) TagString

func (t *PEP425Tag) TagString() string

TagString returns an underscore-separated string containing t's fields.

func (*PEP425Tag) XXX_DiscardUnknown

func (m *PEP425Tag) XXX_DiscardUnknown()

func (*PEP425Tag) XXX_Marshal

func (m *PEP425Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PEP425Tag) XXX_Merge

func (m *PEP425Tag) XXX_Merge(src proto.Message)

func (*PEP425Tag) XXX_Size

func (m *PEP425Tag) XXX_Size() int

func (*PEP425Tag) XXX_Unmarshal

func (m *PEP425Tag) XXX_Unmarshal(b []byte) error

type Runtime

type Runtime struct {
	// The absolute path to the resolved interpreter (sys.executable).
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// The SHA256 hash of the resolved interpreter.
	Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	// The resolved Python interpreter version.
	Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	// The prefix of the Python interpreter (sys.prefix).
	Prefix               string   `protobuf:"bytes,4,opt,name=prefix,proto3" json:"prefix,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Runtime is the set of resolved runtime parameters.

func (*Runtime) Descriptor

func (*Runtime) Descriptor() ([]byte, []int)

func (*Runtime) GetHash

func (m *Runtime) GetHash() string

func (*Runtime) GetPath

func (m *Runtime) GetPath() string

func (*Runtime) GetPrefix

func (m *Runtime) GetPrefix() string

func (*Runtime) GetVersion

func (m *Runtime) GetVersion() string

func (*Runtime) ProtoMessage

func (*Runtime) ProtoMessage()

func (*Runtime) Reset

func (m *Runtime) Reset()

func (*Runtime) String

func (m *Runtime) String() string

func (*Runtime) XXX_DiscardUnknown

func (m *Runtime) XXX_DiscardUnknown()

func (*Runtime) XXX_Marshal

func (m *Runtime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Runtime) XXX_Merge

func (m *Runtime) XXX_Merge(src proto.Message)

func (*Runtime) XXX_Size

func (m *Runtime) XXX_Size() int

func (*Runtime) XXX_Unmarshal

func (m *Runtime) XXX_Unmarshal(b []byte) error

type Spec

type Spec struct {
	// The Python version to use. This should be of the form:
	// "Major[.Minor[.Patch]]"
	//
	// If specified,
	// - The Major version will be enforced absolutely. Python 3 will not be
	//   preferred over Python 2 because '3' is greater than '2'.
	// - The remaining versions, if specified, will be regarded as *minimum*
	//   versions. In other words, if "2.7.4" is specified and the system has
	//   "2.7.12", that will suffice. Similarly, "2.6" would accept a "2.7"
	//   interpreter.
	//
	// If empty, the default Python interpreter ("python") will be used.
	PythonVersion string          `protobuf:"bytes,1,opt,name=python_version,json=pythonVersion,proto3" json:"python_version,omitempty"`
	Wheel         []*Spec_Package `protobuf:"bytes,2,rep,name=wheel,proto3" json:"wheel,omitempty"`
	// The VirtualEnv package.
	//
	// This should be left empty to use the `vpython` default package
	// (recommended).
	Virtualenv *Spec_Package `protobuf:"bytes,3,opt,name=virtualenv,proto3" json:"virtualenv,omitempty"`
	// Specification-provided PEP425 verification tags.
	//
	// By default, verification will be performed against a default set of
	// environment parameters. However, a given specification may offer its own
	// set of PEP425 tags representing the systems that it wants to be verified
	// against.
	VerifyPep425Tag      []*PEP425Tag `protobuf:"bytes,4,rep,name=verify_pep425_tag,json=verifyPep425Tag,proto3" json:"verify_pep425_tag,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

Spec is a "vpython" environment specification.

func (*Spec) Clone

func (s *Spec) Clone() *Spec

Clone returns a deep clone of the supplied Spec.

If e is nil, a non-nil empty Spec will be returned.

func (*Spec) Descriptor

func (*Spec) Descriptor() ([]byte, []int)

func (*Spec) GetPythonVersion

func (m *Spec) GetPythonVersion() string

func (*Spec) GetVerifyPep425Tag

func (m *Spec) GetVerifyPep425Tag() []*PEP425Tag

func (*Spec) GetVirtualenv

func (m *Spec) GetVirtualenv() *Spec_Package

func (*Spec) GetWheel

func (m *Spec) GetWheel() []*Spec_Package

func (*Spec) ProtoMessage

func (*Spec) ProtoMessage()

func (*Spec) Reset

func (m *Spec) Reset()

func (*Spec) String

func (m *Spec) String() string

func (*Spec) XXX_DiscardUnknown

func (m *Spec) XXX_DiscardUnknown()

func (*Spec) XXX_Marshal

func (m *Spec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Spec) XXX_Merge

func (m *Spec) XXX_Merge(src proto.Message)

func (*Spec) XXX_Size

func (m *Spec) XXX_Size() int

func (*Spec) XXX_Unmarshal

func (m *Spec) XXX_Unmarshal(b []byte) error

type Spec_Package

type Spec_Package struct {
	// The name of the package.
	//
	// - For CIPD, this is the package name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The package version.
	//
	// - For CIPD, this will be any recognized CIPD version (i.e., ID, tag, or
	//   ref).
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// Optional PEP425 tags to determine whether this package is included on the
	// target system. If no match tags are specified, this package will always
	// be included. If match tags are specified, the package will be included if
	// any system PEP425 tags match at least one of the match tags.
	//
	// A match will succeed if any system PEP425 tag field matches the
	// corresponding field in the PEP425 tag. If the match tag omits a field
	// (partial), that field will not be considered. For example, if a match
	// tag specifies just an ABI field, any system PEP425 tag with that ABI will
	// be considered a successful match, regardless of other field values.
	MatchTag []*PEP425Tag `protobuf:"bytes,3,rep,name=match_tag,json=matchTag,proto3" json:"match_tag,omitempty"`
	// Optional PEP425 tags to determine whether this package is NOT included on
	// the target system. This has the opposite behavior as "match_tag": if any
	// host tags match any tags in this list, the package will not be installed
	// on this host.
	//
	// A "not_match_tag" overrides a "match_tag", so if a host has tags that
	// match entries in both, the package will be not considered a match.
	NotMatchTag          []*PEP425Tag `protobuf:"bytes,4,rep,name=not_match_tag,json=notMatchTag,proto3" json:"not_match_tag,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

A definition for a remote package. The type of package depends on the configured package resolver.

func (*Spec_Package) Descriptor

func (*Spec_Package) Descriptor() ([]byte, []int)

func (*Spec_Package) GetMatchTag

func (m *Spec_Package) GetMatchTag() []*PEP425Tag

func (*Spec_Package) GetName

func (m *Spec_Package) GetName() string

func (*Spec_Package) GetNotMatchTag

func (m *Spec_Package) GetNotMatchTag() []*PEP425Tag

func (*Spec_Package) GetVersion

func (m *Spec_Package) GetVersion() string

func (*Spec_Package) ProtoMessage

func (*Spec_Package) ProtoMessage()

func (*Spec_Package) Reset

func (m *Spec_Package) Reset()

func (*Spec_Package) String

func (m *Spec_Package) String() string

func (*Spec_Package) XXX_DiscardUnknown

func (m *Spec_Package) XXX_DiscardUnknown()

func (*Spec_Package) XXX_Marshal

func (m *Spec_Package) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Spec_Package) XXX_Merge

func (m *Spec_Package) XXX_Merge(src proto.Message)

func (*Spec_Package) XXX_Size

func (m *Spec_Package) XXX_Size() int

func (*Spec_Package) XXX_Unmarshal

func (m *Spec_Package) XXX_Unmarshal(b []byte) error