Documentation ¶
Index ¶
- Constants
- func Build(pyProjectParser PyProjectParser, logger scribe.Emitter, reloader Reloader) packit.BuildFunc
- func Detect(pyProjectParser PyProjectParser, reloader Reloader) packit.DetectFunc
- type BuildPlanMetadata
- type PyProjectConfig
- type PyProjectConfigParser
- type PyProjectParser
- type Reloader
Constants ¶
const CPython = "cpython"
CPython is the name of the python runtime dependency provided by the CPython buildpack: https://github.com/initializ-buildpacks/cpython.
const CacheLayerName = "cache"
CacheLayerName holds the poetry cache.
const Poetry = "poetry"
Poetry is the name of the dependency provided by the Poetry buildpack: https://github.com/initializ-buildpacks/poetry.
const PoetryVenv = "poetry-venv"
PoetryVenv is the name of the dependency provided by the Poetry Install buildpack.
const VenvLayerName = "poetry-venv"
VenvLayerName is the name of the layer where the venv dependencies are installed to.
const Watchexec = "watchexec"
Watchexec is the name of the dependency provided by the Watchexec buildpack: https://github.com/initializ-buildpacks/watchexec
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(pyProjectParser PyProjectParser, logger scribe.Emitter, reloader Reloader) packit.BuildFunc
Build will return a packit.BuildFunc that will be invoked during the build phase of the buildpack lifecycle.
Build assigns the image a launch process of 'poetry run <target>' where <target> is the key of a poetry script or system executable. This can be set via `BP_POETRY_RUN_TARGET` or inferred from pyproject.toml when there is exactly one script.
func Detect ¶
func Detect(pyProjectParser PyProjectParser, reloader Reloader) 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.
Detection is contingent on there being one or more scripts to run defined in the pyproject.toml under [tool.poetry.scripts]
Types ¶
type BuildPlanMetadata ¶
type BuildPlanMetadata struct { // Build denotes the dependency is needed at build-time. Launch bool `toml:"launch"` }
BuildPlanMetadata is the buildpack specific data included in build plan requirements.
type PyProjectConfig ¶
type PyProjectConfigParser ¶
type PyProjectConfigParser struct { }
func NewPyProjectConfigParser ¶
func NewPyProjectConfigParser() PyProjectConfigParser
func (PyProjectConfigParser) Parse ¶
func (p PyProjectConfigParser) Parse(filepath string) (string, error)
Parse returns the name of the script for Poetry to execute If there is no file, no script to run, or multiple scripts to run, Parse returns an empty string and a nil error If there is an error reading the file, Parse returns an error