MCPcopy Create free account
hub / github.com/cloudfoundry/nodejs-buildpack / BootstrapPython

Method BootstrapPython

src/nodejs/supply/supply.go:199–235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197}
198
199func (s *Supplier) BootstrapPython() error {
200 dep, err := s.Manifest.DefaultVersion("python")
201 if err != nil {
202 return err
203 }
204
205 err = s.Installer.InstallDependency(dep, "/tmp/nodejs-buildpack/python")
206 if err != nil {
207 return err
208 }
209
210 path := "/tmp/nodejs-buildpack/python/bin"
211 if p, ok := os.LookupEnv("PATH"); ok {
212 path = fmt.Sprintf("%s:%s", p, path)
213 }
214 os.Setenv("PATH", path)
215
216 libraryPath := "/tmp/nodejs-buildpack/python/lib"
217 if lp, ok := os.LookupEnv("LIBRARY_PATH"); ok {
218 libraryPath = fmt.Sprintf("%s:%s", lp, libraryPath)
219 }
220 os.Setenv("LIBRARY_PATH", libraryPath)
221
222 ldLibraryPath := "/tmp/nodejs-buildpack/python/lib"
223 if lp, ok := os.LookupEnv("LD_LIBRARY_PATH"); ok {
224 ldLibraryPath = fmt.Sprintf("%s:%s", lp, ldLibraryPath)
225 }
226 os.Setenv("LD_LIBRARY_PATH", ldLibraryPath)
227
228 cpath := "/tmp/nodejs-buildpack/python/include"
229 if cp, ok := os.LookupEnv("CPATH"); ok {
230 cpath = fmt.Sprintf("%s:%s", cp, cpath)
231 }
232 os.Setenv("CPATH", cpath)
233
234 return nil
235}
236
237func (s *Supplier) WarnUnmetDependencies(deps string) {
238 unmetLogEntries := []string{UnmetDependency, UnmetPeerDependency}

Callers 1

RunFunction · 0.80

Calls 2

DefaultVersionMethod · 0.65
InstallDependencyMethod · 0.65

Tested by

no test coverage detected