You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I wrote the Python CFFI plugin for safer_ffi when I was working with @danielhenrymantilla.
You can find the package dittoffi on Pypi which uses the files generated by safer-ffi.
Notably, you should pay attention to the _ffi_build.py file, which includes most of the CFFI logic. Here is an excerpt :
fromcffiimportFFIffi=FFI()
# Mostly company internal logic to fetch the correct lib and read the headers asyncdefprepare_compilation():
withread_header_file("dittoffi.cffi") ascontent:
ffi.cdef(content)
withread_header_file("dittoffi.h") ascontent:
ffi.set_source("_ffi", content,
library_dirs= [awaitfind_ditto_path()],
libraries= ['dittoffi']
)
asyncio.run(prepare_compilation())
if__name__=="__main__":
ffi.compile(verbose=True)
Finally, beware that the build instructions are splitted between the pyproject.toml and the setup.py file due to some CFFI shenanigans.
There is a test that generates a Python cffi. Is there an example of how to actually use this file?
The text was updated successfully, but these errors were encountered: