Documentation
¶
Index ¶
- Constants
- Variables
- func Build(entryResolver EntryResolver, dependencyManager DependencyManager, ...) packit.BuildFunc
- func Detect() packit.DetectFunc
- type BuildPlanMetadata
- type DependencyManager
- type EntryResolver
- type Executable
- type InstallProcess
- type PipenvInstallProcess
- type SitePackageProcess
- type SiteProcess
Constants ¶
const ( Pipenv = "pipenv" PipFileLock = "Pipfile.lock" DependencySHAKey = "dependency_sha" CPython = "cpython" Pip = "pip" )
Variables ¶
var Priorities = []interface{}{"BP_PIPENV_VERSION"}
Functions ¶
func Build ¶
func Build( entryResolver EntryResolver, dependencyManager DependencyManager, installProcess InstallProcess, siteProcess SitePackageProcess, logs scribe.Emitter, clock chronos.Clock, ) packit.BuildFunc
Build will return a packit.BuildFunc that will be invoked during the build phase of the buildpack lifecycle.
Build will find the right pipenv dependency to install, install it in a layer, and generate Bill-of-Materials. It also makes use of the checksum of the dependency to reuse the layer when possible.
func Detect ¶
func Detect() packit.DetectFunc
Detect will return a packit.DetectFunc that will be invoked during the detect phase of the buildpack lifecycle.
This buildpack always passes detection and will contribute a Build Plan that provides pipenv.
If a version is provided via the $BP_PIPENV_VERSION environment variable, that version of pipenv will be a requirement.
Types ¶
type BuildPlanMetadata ¶
type BuildPlanMetadata struct {
// VersionSource denotes where dependency version came from (e.g. an
// environment variable).
VersionSource string `toml:"version-source"`
// Version denotes the version of a dependency, if there is one.
Version string `toml:"version"`
// Build denotes the dependency is needed at build-time.
Build bool `toml:"build"`
// Launch denotes the dependency is needed at runtime.
Launch bool `toml:"launch"`
}
BuildPlanMetadata is the buildpack specific data included in build plan requirements.
type DependencyManager ¶
type DependencyManager interface {
Resolve(path, id, version, stack string) (postal.Dependency, error)
Deliver(dependency postal.Dependency, cnbPath, destPath, platformPath string) error
GenerateBillOfMaterials(dependencies ...postal.Dependency) []packit.BOMEntry
}
DependencyManager defines the interface for picking the best matching dependency and installing it.
type EntryResolver ¶
type EntryResolver interface {
Resolve(string, []packit.BuildpackPlanEntry, []interface{}) (packit.BuildpackPlanEntry, []packit.BuildpackPlanEntry)
MergeLayerTypes(string, []packit.BuildpackPlanEntry) (launch, build bool)
}
EntryResolver defines the interface for picking the most relevant entry from the Buildpack Plan entries.
type Executable ¶
Executable defines the interface for invoking an executable.
type InstallProcess ¶
InstallProcess defines the interface for installing the pipenv dependency into a layer.
type PipenvInstallProcess ¶
type PipenvInstallProcess struct {
// contains filtered or unexported fields
}
func NewPipenvInstallProcess ¶
func NewPipenvInstallProcess(executable Executable) PipenvInstallProcess
NewPipenvInstallProcess creates a PipenvInstallProcess instance.
func (PipenvInstallProcess) Execute ¶
func (p PipenvInstallProcess) Execute(srcPath, targetLayerPath string) error
Execute installs the pipenv binary from source code located in the given srcPath into the layer path designated by targetLayerPath.
type SitePackageProcess ¶
SitePackageProcess defines the interface for looking up site packages within a layer.
type SiteProcess ¶
type SiteProcess struct {
// contains filtered or unexported fields
}
SiteProcess implements the Executable interface.
func NewSiteProcess ¶
func NewSiteProcess(executable Executable) SiteProcess
NewSiteProcess creates an instance of the SiteProcess given an Executable.