Documentation ¶
Index ¶
- Constants
- func Build(installProcess InstallProcess, siteProcess SitePackagesProcess, ...) packit.BuildFunc
- func Detect(pipfileParser, pipfileLockParser Parser) packit.DetectFunc
- type BuildPlanMetadata
- type Executable
- type InstallProcess
- type Parser
- type PipenvInstallProcess
- type PipfileLockParser
- type PipfileParser
- type SBOMGenerator
- type SitePackagesProcess
- type SiteProcess
- type VenvDirLocator
- type VenvLocator
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 pipenv cache.
const PackagesLayerName = "packages"
The layer name for packages layer. This layer is where dependencies are installed to.
const Pipenv = "pipenv"
Pipenv is the name of the dependency provided by the Pipenv buildpack: https://github.com/paketo-buildpacks/pipenv.
const SitePackages = "site-packages"
SitePackages is the name of the dependency provided by the Pipenv Install buildpack.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build( installProcess InstallProcess, siteProcess SitePackagesProcess, venvDirLocator VenvDirLocator, 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 pipenv dependencies by using the Pipfile to a packages layer. It also makes use of a cache layer to reuse the pipenv cache.
func Detect ¶
func Detect(pipfileParser, pipfileLockParser Parser) 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 pipenv at build.
Types ¶
type BuildPlanMetadata ¶
type BuildPlanMetadata struct { // Build denotes the dependency is needed at build-time. Build bool `toml:"build"` // Version denotes the version to request. Version string `toml:"version"` // VersionSource denotes the source of version request. VersionSource string `toml:"version-source"` }
BuildPlanMetadata is the buildpack-specific data included in build plan requirements.
type Executable ¶
Executable defines the interface for invoking an executable.
type InstallProcess ¶
type InstallProcess interface {
Execute(workingDir string, targetLayer, cacheLayer packit.Layer) error
}
InstallProcess defines the interface for installing the pipenv dependencies.
type PipenvInstallProcess ¶
type PipenvInstallProcess struct {
// contains filtered or unexported fields
}
PipenvInstallProcess implements the InstallProcess interface.
func NewPipenvInstallProcess ¶
func NewPipenvInstallProcess(executable Executable, logger scribe.Emitter) PipenvInstallProcess
NewPipenvInstallProcess creates an instance of the PipenvInstallProcess given an Executable.
func (PipenvInstallProcess) Execute ¶
func (p PipenvInstallProcess) Execute(workingDir string, targetLayer, cacheLayer packit.Layer) error
Execute installs the pipenv dependencies from workingDir/Pipfile into the targetLayer. The cacheLayer is used for the pipenv cache directory.
type PipfileLockParser ¶
type PipfileLockParser struct{}
func NewPipfileLockParser ¶
func NewPipfileLockParser() PipfileLockParser
func (PipfileLockParser) ParseVersion ¶
func (p PipfileLockParser) ParseVersion(path string) (version string, err error)
type PipfileParser ¶
type PipfileParser struct{}
func NewPipfileParser ¶
func NewPipfileParser() PipfileParser
func (PipfileParser) ParseVersion ¶
func (p PipfileParser) ParseVersion(path string) (version string, err error)
type SBOMGenerator ¶ added in v0.5.0
type SitePackagesProcess ¶ added in v0.4.0
type SitePackagesProcess interface {
Execute(layerPath string) (sitePackagesPath string, err error)
}
SitePackagesProcess defines the interface for determining the site-packages path.
type SiteProcess ¶ added in v0.4.0
type SiteProcess struct {
// contains filtered or unexported fields
}
SiteProcess implements the Executable interface.
func NewSiteProcess ¶ added in v0.4.0
func NewSiteProcess(executable Executable) SiteProcess
NewSiteProcess creates an instance of the SiteProcess given an Executable that runs `python`
type VenvDirLocator ¶ added in v0.4.0
VenvDirLocator defines the interface for locating the virtual environment directory under a given path
type VenvLocator ¶ added in v0.4.0
type VenvLocator struct { }
func NewVenvLocator ¶ added in v0.4.0
func NewVenvLocator() VenvLocator
func (VenvLocator) LocateVenvDir ¶ added in v0.4.0
func (v VenvLocator) LocateVenvDir(path string) (string, error)