1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-04 18:29:19 +02:00

Update python bindings to new headers naming

This fixes the python bindings build to work with the new layout of
the header files and new names.
This commit is contained in:
Floris Bruynooghe 2018-07-19 20:15:54 +02:00
parent 437bb33131
commit 3aeec2202a
4 changed files with 9 additions and 11 deletions

2
.gitignore vendored
View file

@ -45,6 +45,8 @@ po/*.insert-header
# ignore other files # ignore other files
.DS_Store .DS_Store
capi.abi3.so
# ignore build directory # ignore build directory
builddir/ builddir/
python/build

View file

@ -10,7 +10,7 @@ def ffibuilder():
builder.set_source( builder.set_source(
'deltachat.capi', 'deltachat.capi',
""" """
#include <deltachat/mrmailbox.h> #include <deltachat/deltachat.h>
""", """,
libraries=['deltachat'], libraries=['deltachat'],
) )
@ -21,7 +21,7 @@ def ffibuilder():
cc = distutils.ccompiler.new_compiler(force=True) cc = distutils.ccompiler.new_compiler(force=True)
distutils.sysconfig.customize_compiler(cc) distutils.sysconfig.customize_compiler(cc)
with tempfile.NamedTemporaryFile(mode='w', suffix='.h') as src_fp: with tempfile.NamedTemporaryFile(mode='w', suffix='.h') as src_fp:
src_fp.write('#include <deltachat/mrmailbox.h>') src_fp.write('#include <deltachat/deltachat.h>')
src_fp.flush() src_fp.flush()
with tempfile.NamedTemporaryFile(mode='r') as dst_fp: with tempfile.NamedTemporaryFile(mode='r') as dst_fp:
cc.preprocess(source=src_fp.name, cc.preprocess(source=src_fp.name,

View file

@ -5,12 +5,6 @@ import pytest
from deltachat import capi from deltachat import capi
@pytest.fixture def test_empty_context():
def tmppath(tmpdir): ctx = capi.lib.dc_context_new(capi.ffi.NULL, capi.ffi.NULL, capi.ffi.NULL)
return pathlib.Path(tmpdir.strpath) capi.lib.dc_close(ctx)
def test_new():
mbox = capi.lib.mrmailbox_new(capi.ffi.NULL, capi.ffi.NULL, capi.ffi.NULL)
capi.lib.mrmailbox_close(mbox)
assert 0

View file

@ -27,8 +27,10 @@ extern "C" {
#endif #endif
#ifndef PY_CFFI
#include <stdint.h> #include <stdint.h>
#include <time.h> #include <time.h>
#endif
#define DC_VERSION_STR "0.19.0" #define DC_VERSION_STR "0.19.0"