One solution to this issue on pyml_bindgen GitHub.
Essentially, it is a way to embed multiple Python files/modules into your OCaml executable.
The py
directory has some Python code. Two modules mathy
and sparkles
, with submodules. interface.py
depends on both of them, and that is the file we want to generate bindings for with pyml_bindgen
.
The problem is that we don't want to have to have the user of our OCaml program care about installing these modules we made. We want it all embedded. So the stickytape program is used to generate one python script with machinery to "roll up" everything needed into one file. Then this rolled up file is embedded in the OCaml code for pyml to use.
Checkout the dune
file for the shell commands needed to set this all up.
Run the executable with dune exec ./yo.exe
and the tests with dune runtest
. After you build, feel free to move the generated executable to another directory, or another machine, it will work fine!
To the extent possible under law, Ryan M. Moore has waived all copyright and related or neighboring rights to this project.
If for whatever reason, CC0 will not work for your project, you may use MIT or the Unlicense.