Documentation
¶
Index ¶
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(entryResolver EntryResolver, installProcess InstallProcess, siteProcess SitePackagesProcess, 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.
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 will contribute a Build Plan that provides site-packages, and requires cpython and pip at build.
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. If the vendor directory is present, the pip install command will install from local packages.
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`