poetryrun

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

poetry-run

Documentation

Index

Constants

View Source
const CPython = "cpython"

CPython is the name of the python runtime dependency provided by the CPython buildpack: https://github.com/paketo-buildpacks/cpython.

View Source
const CacheLayerName = "cache"

CacheLayerName holds the poetry cache.

View Source
const Poetry = "poetry"

Poetry is the name of the dependency provided by the Poetry buildpack: https://github.com/paketo-buildpacks/poetry.

View Source
const PoetryVenv = "poetry-venv"

PoetryVenv is the name of the dependency provided by the Poetry Install buildpack.

View Source
const VenvLayerName = "poetry-venv"

VenvLayerName is the name of the layer where the venv dependencies are installed to.

Variables

This section is empty.

Functions

func Build

func Build(pyProjectParser PyProjectParser, logger scribe.Emitter) 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 <script>' where <script> is the key of the only script present for Poetry to run.

func Detect

func Detect(pyProjectParser PyProjectParser) 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 PyProjectConfig struct {
	Tool struct {
		Poetry struct {
			Scripts map[string]string `toml:"scripts"`
		} `toml:"poetry"`
	} `toml:"tool"`
}

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

type PyProjectParser

type PyProjectParser interface {
	Parse(string) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL