supply

package
v1.8.33 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const EnvPipVersion = "BP_PIP_VERSION"

Variables

This section is empty.

Functions

func Run

func Run(s *Supplier) error

func RunPython

func RunPython(s *Supplier) error

Types

type Command

type Command interface {
	Execute(dir string, stdout io.Writer, stderr io.Writer, program string, args ...string) error
	Output(dir string, program string, args ...string) (string, error)
	RunWithOutput(cmd *exec.Cmd) ([]byte, error)
}

type Installer added in v1.6.16

type Installer interface {
	InstallDependency(dep libbuildpack.Dependency, outputDir string) error
	InstallOnlyVersion(depName, installDir string) error
}

type Manifest

type Manifest interface {
	AllDependencyVersions(depName string) []string
	DefaultVersion(depName string) (libbuildpack.Dependency, error)
	IsCached() bool
}

type Reqs added in v1.7.50

type Reqs interface {
	FindAnyPackage(buildDir string, searchedPackages ...string) (bool, error)
	FindStalePackages(oldRequirementsPath, newRequirementsPath string, excludedPackages ...string) ([]string, error)
}

type Stager

type Stager interface {
	BuildDir() string
	CacheDir() string
	DepDir() string
	DepsIdx() string
	LinkDirectoryInDepDir(destDir, destSubDir string) error
	WriteEnvFile(envVar, envVal string) error
	WriteProfileD(scriptName, scriptContents string) error
}

type Supplier

type Supplier struct {
	PythonVersion string
	Manifest      Manifest
	Installer     Installer
	Stager        Stager
	Command       Command
	Log           *libbuildpack.Logger
	Logfile       *os.File
	HasNltkData   bool

	Requirements Reqs
	// contains filtered or unexported fields
}

func (*Supplier) CopyRuntimeTxt added in v1.6.24

func (s *Supplier) CopyRuntimeTxt() error

func (*Supplier) CreateDefaultEnv

func (s *Supplier) CreateDefaultEnv() error

func (*Supplier) DownloadNLTKCorpora

func (s *Supplier) DownloadNLTKCorpora() error

func (*Supplier) HandleFfi

func (s *Supplier) HandleFfi() error

func (*Supplier) HandlePipfile

func (s *Supplier) HandlePipfile() error

func (*Supplier) HandlePylibmc

func (s *Supplier) HandlePylibmc() error

func (*Supplier) HandleRequirementstxt

func (s *Supplier) HandleRequirementstxt() error

func (*Supplier) InstallCommonBuildDependencies added in v1.8.26

func (s *Supplier) InstallCommonBuildDependencies() error

sdist packages have 2 kinds of dependencies: build-time deps and runtime-deps. Before PEP-517, there was no standard to specify a package's build-time deps, but with PEP-517, a package defines its build-time deps in its pyproject.toml. In an online install, pip reads it and downloads build-time deps and builds the sdist. In a vendored (offline) install, this is not possible because "pip download" is not smart enough to download build-time deps during vendoring (pypa/pip issue#8302). Before pip 23.1, when build-time deps were missing, pip fell back to using the legacy 'setup.py install' method. pip 23.1 started enforcing PEP 517. Therefore, for vendored apps with sdists, we install the 2 most common build-time dependencies - wheel and setuptools. These are packaged by the dependency pipeline within the "pip" dependency.

func (*Supplier) InstallPip

func (s *Supplier) InstallPip() error

func (*Supplier) InstallPipEnv

func (s *Supplier) InstallPipEnv() error

func (*Supplier) InstallPython

func (s *Supplier) InstallPython() error

func (*Supplier) RewriteShebangs

func (s *Supplier) RewriteShebangs() error

func (*Supplier) RunPipUnvendored added in v1.6.29

func (s *Supplier) RunPipUnvendored() error

func (*Supplier) RunPipVendored added in v1.6.29

func (s *Supplier) RunPipVendored() error

func (*Supplier) SetupCacheDir

func (s *Supplier) SetupCacheDir() error

func (*Supplier) UninstallUnusedDependencies

func (s *Supplier) UninstallUnusedDependencies() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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