2019-06-01 17:47:13 +00:00
|
|
|
# Python bindings for enry
|
|
|
|
|
2019-11-17 14:13:41 +00:00
|
|
|
Python bindings through cFFI (API, out-of-line) for calling enry Go functions exposed by CGo wrapper.
|
2019-06-01 17:47:13 +00:00
|
|
|
|
|
|
|
## Build
|
|
|
|
|
|
|
|
```
|
2020-08-12 12:38:56 +00:00
|
|
|
$ pushd .. && make static && popd
|
2020-11-14 21:29:53 +00:00
|
|
|
$ pip install -r requirements.txt
|
2019-11-17 14:13:41 +00:00
|
|
|
$ python build_enry.py
|
2019-06-01 17:47:13 +00:00
|
|
|
```
|
|
|
|
|
2019-11-17 14:13:41 +00:00
|
|
|
Will build a static library for Cgo wrapper `libenry`, then generate and build `enry.c` - a CPython extension that provides actual bindings.
|
2019-06-01 17:47:13 +00:00
|
|
|
|
|
|
|
## Run
|
|
|
|
|
|
|
|
Example for single exposed API function is provided.
|
|
|
|
|
|
|
|
```
|
|
|
|
$ python enry.py
|
|
|
|
```
|
|
|
|
|
|
|
|
## TODOs
|
2019-11-17 14:13:41 +00:00
|
|
|
- [x] helpers for sending/receiving Go slices to C
|
2020-08-10 21:12:43 +00:00
|
|
|
- [x] read `libenry.h` and generate `ffibuilder.cdef(...)` content
|
|
|
|
- [x] cover the rest of enry API
|
|
|
|
- [x] add `setup.py`
|
2019-11-17 14:13:41 +00:00
|
|
|
- [ ] build/release automation on CI (publish on pypi)
|
2020-11-14 21:29:53 +00:00
|
|
|
- [ ] try ABI mode, to avoid dependency on C compiler on install (+perf test?)
|