MCPcopy Index your code
hub / github.com/go-python/gopy / genPkg

Function genPkg

gen.go:64–86  ·  view source on GitHub ↗

genPkg generates output for all the current packages that have been parsed, in the given output directory mode = gen, build, pkg, exe

(mode bind.BuildMode, cfg *BuildCfg)

Source from the content-addressed store, hash-verified

62// in the given output directory
63// mode = gen, build, pkg, exe
64func genPkg(mode bind.BuildMode, cfg *BuildCfg) error {
65 var err error
66 cfg.OutputDir, err = genOutDir(cfg.OutputDir)
67 if err != nil {
68 return err
69 }
70 if !filepath.IsAbs(cfg.VM) {
71 cfg.VM, err = exec.LookPath(cfg.VM)
72 if err != nil {
73 return errors.Wrapf(err, "could not locate absolute path to python VM")
74 }
75 }
76
77 pyvers, err := getPythonVersion(cfg.VM)
78 if err != nil {
79 return err
80 }
81 err = bind.GenPyBind(mode, libExt, extraGccArgs, pyvers, cfg.DynamicLinking, &cfg.BindCfg)
82 if err != nil {
83 log.Println(err)
84 }
85 return err
86}
87
88func loadPackage(path string, buildFirst bool, buildTags string) (*packages.Package, error) {
89 cwd, err := os.Getwd()

Callers 2

gopyRunCmdGenFunction · 0.85
runBuildFunction · 0.85

Calls 4

GenPyBindFunction · 0.92
genOutDirFunction · 0.85
getPythonVersionFunction · 0.85
PrintlnMethod · 0.80

Tested by

no test coverage detected