MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/buildpacks / IsPyprojectEnabled

Function IsPyprojectEnabled

pkg/python/pyproject.go:534–543  ·  view source on GitHub ↗

IsPyprojectEnabled checks if the pyproject feature is enabled.

(ctx *gcp.Context)

Source from the content-addressed store, hash-verified

532 }
533 if isBothPyprojectAndRequirementsPresent(ctx) {
534 return false // Prefer requirements.txt over pyproject.toml.
535 }
536 return true
537}
538
539// IsPipPyproject checks if the application is a pip pyproject.
540func IsPipPyproject(ctx *gcp.Context) bool {
541 return isPackageManagerConfigured(pip) && IsPyprojectEnabled(ctx) && (env.IsGCP() || env.IsGCF())
542}
543
544// PipInstallPyproject installs dependencies from a pyproject.toml file in the current directory.
545func PipInstallPyproject(ctx *gcp.Context, l *libcnb.Layer) error {
546 ctx.Logf("Installing application dependencies from pyproject.toml.")

Callers 6

DetectFnFunction · 0.92
BuildFnFunction · 0.92
BuildFnFunction · 0.92
TestIsPyprojectEnabledFunction · 0.85
PackagePresentFunction · 0.85
IsPipPyprojectFunction · 0.85

Calls 2

FileExistsMethod · 0.80

Tested by 1

TestIsPyprojectEnabledFunction · 0.68