Documentation ¶
Index ¶
- Constants
- func Build(installProcess InstallProcess, siteProcess SitePackagesProcess, ...) packit.BuildFunc
- func Detect() packit.DetectFunc
- type BuildPlanMetadata
- type EntryResolver
- type Executable
- type InstallProcess
- type PipInstallProcess
- type SBOMGenerator
- type SitePackagesProcess
- 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 CacheLayerName = "cache"
The layer name for cache layer. This layer holds the pip cache.
const PackagesLayerName = "packages"
The layer name for packages layer. This layer is where dependencies are installed to.
const Pip = "pip"
Pip is the name of the dependency provided by the Pip buildpack: https://github.com/paketo-buildpacks/pip.
const SitePackages = "site-packages"
SitePackages is the name of the dependency provided by the Pip Install buildpack.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(installProcess InstallProcess, siteProcess SitePackagesProcess, sbomGenerator SBOMGenerator, clock chronos.Clock, logger scribe.Emitter) packit.BuildFunc
Build will return a packit.BuildFunc that will be invoked during the build phase of the buildpack lifecycle.
Build will install the pip dependencies by using the requirements.txt file to a packages layer. It also makes use of a cache layer to reuse the pip cache.
Types ¶
type BuildPlanMetadata ¶
type BuildPlanMetadata struct { // Build denotes the dependency is needed at build-time. Build bool `toml:"build"` }
BuildPlanMetadata is the buildpack specific data included in build plan requirements.
type EntryResolver ¶
type EntryResolver interface {
MergeLayerTypes(name string, entries []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 pip dependencies.
type PipInstallProcess ¶
type PipInstallProcess struct {
// contains filtered or unexported fields
}
PipInstallProcess implements the InstallProcess interface.
func NewPipInstallProcess ¶
func NewPipInstallProcess(executable Executable, logger scribe.Emitter) PipInstallProcess
NewPipInstallProcess creates an instance of the PipInstallProcess given an Executable.
func (PipInstallProcess) Execute ¶
func (p PipInstallProcess) Execute(workingDir, targetPath, cachePath string) error
Execute installs the pip dependencies from workingDir/requirements.txt into the targetPath. The cachePath is used for the pip cache directory.
The pip install command will install from local packages if they are found at the directory specified by `BP_PIP_DEST_PATH`, which defaults to `vendor`.
type SBOMGenerator ¶ added in v0.4.0
type SitePackagesProcess ¶
type SitePackagesProcess interface {
Execute(layerPath string) (sitePackagesPath string, err error)
}
SitePackagesProcess defines the interface for determining the site-packages path.
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`