sbinet / go-python

naive go bindings to the CPython2 C-API
Other
1.53k stars 138 forks source link

Deployment docs #24

Open JeffSpies opened 9 years ago

JeffSpies commented 9 years ago

Great library! Do you happen to have documentation/suggestions for the optimal way to deploy a library using go-python to users? Thanks!

sbinet commented 9 years ago

ATM, with go-1.4 (and the GC toolchain), the only way is to ship a single binary (say my-python) with all the go modules linked in, and replace your standard python executable with that binary (my-python.) ie: something like the cmd/go-python executable where the go modules have been imported and registered/exposed with the PyModule_xyz functions.

with (the upcoming) go-1.5 and its c-shared buildmode, it will be possible to have dynamically loadable shared libraries, so a much more convenient modus operandi will be possible. I am working on this over there: https://github.com/go-python/gopy-gen

there, you will get a much easier user story (I hope) and one which is much more in line with what gomobile will provide for java/android and objc/ios users.

let me know whether that helps or not. -s