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

Function CheckIncompatibleDependencies

pkg/python/python.go:308–328  ·  view source on GitHub ↗

CheckIncompatibleDependencies checks for incompatible dependencies using pip check.

(ctx *gcp.Context)

Source from the content-addressed store, hash-verified

306 }
307
308 if err := compileBytecode(ctx, l.Path); err != nil {
309 return err
310 }
311
312 return CheckIncompatibleDependencies(ctx)
313}
314
315// CheckIncompatibleDependencies checks for incompatible dependencies using pip check.
316func CheckIncompatibleDependencies(ctx *gcp.Context) error {
317 ctx.Logf("Checking for incompatible dependencies.")
318 result, err := ctx.Exec([]string{"python3", "-m", "pip", "check"}, gcp.WithUserAttribution)
319 if result == nil {
320 return fmt.Errorf("pip check: %w", err)
321 }
322 if result.ExitCode == 0 {
323 return nil
324 }
325 pyVer, err := Version(ctx)
326 if err != nil {
327 return err
328 }
329 // HACK: For backwards compatibility on App Engine and Cloud Functions Python 3.7 only report a
330 // warning.
331 if strings.HasPrefix(pyVer, "Python 3.7") {

Callers 1

PIPInstallRequirementsFunction · 0.85

Calls 4

LogfMethod · 0.80
ExecMethod · 0.80
WarnfMethod · 0.80
VersionFunction · 0.70

Tested by

no test coverage detected