Documentation
¶
Index ¶
- Constants
- Variables
- func Build(dependencies DependencyManager, installProcess InstallProcess, ...) packit.BuildFunc
- func Detect() packit.DetectFunc
- type BuildPlanMetadata
- type DependencyManager
- type Executable
- type InstallProcess
- type PipInstallProcess
- type SBOMGenerator
- type SitePackageProcess
- type SiteProcess
Constants ¶
const CPython = "cpython"
CPython is the name of the python runtime dependency provided by the CPython buildpack: https://github.com/paketo-buildpacks/cpython
const DependencyChecksumKey = "dependency_checksum"
DependencyChecksumKey is the name of the key in the pip layer TOML whose value is pip dependency's SHA256.
const Pip = "pip"
Pip is the name of the layer into which pip dependency is installed.
const PipSrc = "pip-source"
Variables ¶
var Priorities = []interface{}{"BP_PIP_VERSION"}
Priorities is a list of possible places where the buildpack could look for a specific version of Pip to install, ordered from highest to lowest priority.
Functions ¶
func Build ¶
func Build( dependencies DependencyManager, installProcess InstallProcess, siteProcess SitePackageProcess, sbomGenerator SBOMGenerator, logger 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 pip 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.
Detection always passes, and will contribute a Build Plan that provides pip, and requires cpython OR python, python_packages, and requirements.
If a version is provided via the $BP_PIP_VERSION environment variable, that version of pip will be a requirement.
Types ¶
type BuildPlanMetadata ¶
type BuildPlanMetadata struct { // 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"` // Version denotes the version of a dependency, if there is one. Version string `toml:"version"` // VersionSource denotes where dependency version came from (e.g. an environment variable). VersionSource string `toml:"version-source"` }
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, destinationPath, platformPath string) error GenerateBillOfMaterials(dependencies ...postal.Dependency) []packit.BOMEntry }
DependencyManager defines the interface for picking the best matching dependency and installing it.
type Executable ¶
Executable defines the interface for invoking an executable.
type InstallProcess ¶
InstallProcess defines the interface for installing the pip dependency into a layer.
type PipInstallProcess ¶
type PipInstallProcess struct {
// contains filtered or unexported fields
}
PipInstallProcess implements the InstallProcess interface.
func NewPipInstallProcess ¶
func NewPipInstallProcess(executable Executable) PipInstallProcess
NewPipInstallProcess creates an instance of the PipInstallProcess given an Executable that runs `python`.
func (PipInstallProcess) Execute ¶
func (p PipInstallProcess) Execute(srcPath, targetLayerPath string) error
Execute installs the pip binary from source code located in the given srcPath into the a layer path designated by targetLayerPath.
type SBOMGenerator ¶ added in v0.9.0
type SitePackageProcess ¶
SitePackageProcess defines the interface for looking 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 that runs `python`