Documentation ¶
Index ¶
- Constants
- Variables
- func Build(dependencies DependencyManager, pythonInstaller PythonInstaller, ...) packit.BuildFunc
- func Detect() packit.DetectFunc
- type BuildPlanMetadata
- type CPythonInstaller
- type DependencyManager
- type Executable
- type PipCleanup
- type PythonInstaller
- type PythonPipCleanup
- type SBOMGenerator
- type VersionParser
Constants ¶
const Cpython = "cpython"
Cpython is the name of the layer into which cpython dependency is installed.
const DepKey = "dependency-sha"
DepKey is the key in the Layer Content Metadata used to determine if layer can be reused.
Variables ¶
var Priorities = []interface{}{
"BP_CPYTHON_VERSION",
"Pipfile.lock",
"Pipfile",
"pyproject.toml",
}
Priorities is a list of version-source values that may appear in the BuildpackPlan entries that the buildpack receives. The list is from highest priority to lowest priority and determines the precedence of version-sources.
Functions ¶
func Build ¶
func Build( dependencies DependencyManager, pythonInstaller PythonInstaller, pipCleanup PythonPipCleanup, 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 cpython 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.
Types ¶
type BuildPlanMetadata ¶
type BuildPlanMetadata struct { // Version denotes the version constraint to be requested in the requirements. Version string `toml:"version"` // VersionSource denotes the source of the version information. This may be // used by the consumer of the metadata to determine the priority of this // version request. VersionSource string `toml:"version-source"` // ConfigureFlags denotes the configure flags to be requested in the requirements. // This is used to run configure before make and make install. ConfigureFlags string `toml:"configure-flags"` }
BuildPlanMetadata is the buildpack specific data included in build plan requirements.
type CPythonInstaller ¶ added in v1.4.0
type CPythonInstaller struct {
// contains filtered or unexported fields
}
CPythonInstaller implements the PythonInstaller interface.
func NewCPythonInstaller ¶ added in v1.4.0
func NewCPythonInstaller( configureProcess Executable, makeProcess Executable, logger scribe.Emitter, ) CPythonInstaller
NewCPythonInstaller creates an instance of the CPythonInstaller given a scribe.Emitter.
func (CPythonInstaller) Install ¶ added in v1.4.0
func (i CPythonInstaller) Install( sourcePath string, workingDir string, entry packit.BuildpackPlanEntry, dependency postal.Dependency, layerPath string, ) error
Installs python from source code located in the given sourcePath into the layer path designated by layerPath.
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 installing it, and generating a BOM.
type Executable ¶ added in v1.4.0
Executable defines the interface for invoking an executable.
type PipCleanup ¶ added in v1.12.0
type PipCleanup struct {
// contains filtered or unexported fields
}
PipCleanup implements the PythonPipCleanup interface.
func NewPipCleanup ¶ added in v1.12.0
func NewPipCleanup(pythonProcess Executable, logger scribe.Emitter) PipCleanup
NewPipCleanup creates an instance of PipCleanup given a python Executable and a scribe.Emitter.
type PythonInstaller ¶ added in v1.4.0
type PythonInstaller interface { Install( sourcePath string, workingDir string, entry packit.BuildpackPlanEntry, dependency postal.Dependency, layerPath string, ) error }
PythonInstaller defines the interface for installing python from source
type PythonPipCleanup ¶ added in v1.12.0
PythonPipCleanup defines the interface for cleaning up pip after a python installation
type SBOMGenerator ¶ added in v0.10.0
type VersionParser ¶
VersionParser defines the interface for determining the version of Cpython.