diff --git a/.gitignore b/.gitignore index f5283a1e..11b363d4 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,8 @@ po/*.insert-header # ignore other files .DS_Store +capi.abi3.so # ignore build directory builddir/ +python/build diff --git a/python/src/deltachat/_build.py b/python/src/deltachat/_build.py index 47ac424c..95969699 100644 --- a/python/src/deltachat/_build.py +++ b/python/src/deltachat/_build.py @@ -10,7 +10,7 @@ def ffibuilder(): builder.set_source( 'deltachat.capi', """ - #include + #include """, libraries=['deltachat'], ) @@ -21,7 +21,7 @@ def ffibuilder(): cc = distutils.ccompiler.new_compiler(force=True) distutils.sysconfig.customize_compiler(cc) with tempfile.NamedTemporaryFile(mode='w', suffix='.h') as src_fp: - src_fp.write('#include ') + src_fp.write('#include ') src_fp.flush() with tempfile.NamedTemporaryFile(mode='r') as dst_fp: cc.preprocess(source=src_fp.name, diff --git a/python/tests/test_mrmailbox.py b/python/tests/test_mrmailbox.py index 1978094d..b7fa398e 100644 --- a/python/tests/test_mrmailbox.py +++ b/python/tests/test_mrmailbox.py @@ -5,12 +5,6 @@ import pytest from deltachat import capi -@pytest.fixture -def tmppath(tmpdir): - return pathlib.Path(tmpdir.strpath) - - -def test_new(): - mbox = capi.lib.mrmailbox_new(capi.ffi.NULL, capi.ffi.NULL, capi.ffi.NULL) - capi.lib.mrmailbox_close(mbox) - assert 0 +def test_empty_context(): + ctx = capi.lib.dc_context_new(capi.ffi.NULL, capi.ffi.NULL, capi.ffi.NULL) + capi.lib.dc_close(ctx) diff --git a/src/deltachat.h b/src/deltachat.h index 1ed3b24b..341cee35 100644 --- a/src/deltachat.h +++ b/src/deltachat.h @@ -27,8 +27,10 @@ extern "C" { #endif +#ifndef PY_CFFI #include #include +#endif #define DC_VERSION_STR "0.19.0"