Python bindings for the Delta Chat Core library using CFFI against the Rust-implemented libdeltachat
Project description
This package provides bindings to the deltachat-core Rust -library which implements IMAP/SMTP/MIME/PGP e-mail standards and offers a low-level Chat/Contact/Message API to user interfaces and bots.
Installing bindings from source (Updated: 20-Jan-2020)
Install Rust and Cargo first. Deltachat needs a specific nightly version, the easiest is probably to first install Rust stable from rustup and then use this to install the correct nightly version.
Bootstrap Rust and Cargo by using rustup:
curl https://sh.rustup.rs -sSf | sh
Then GIT clone the deltachat-core-rust repo and get the actual rust- and cargo-toolchain needed by deltachat:
git clone https://github.com/deltachat/deltachat-core-rust cd deltachat-core-rust rustup show
To install the Delta Chat Python bindings make sure you have Python3 installed. E.g. on Debian-based systems apt install python3 python3-pip python3-venv should give you a usable python installation.
Ensure you are in the deltachat-core-rust/python directory, create the virtual environment and activate it in your shell:
cd python python3 -m venv venv # or: virtualenv venv source venv/bin/activate
You should now be able to build the python bindings using the supplied script:
./install_python_bindings.py
The installation might take a while, depending on your machine. The bindings will be installed in release mode but with debug symbols. The release mode is currently necessary because some tests generate RSA keys which is prohibitively slow in non-release mode.
After successful binding installation you can install a few more Python packages before running the tests:
python -m pip install pytest pytest-timeout pytest-rerunfailures requests pytest -v tests
running “live” tests with temporary accounts
If you want to run “liveconfig” functional tests you can set DCC_NEW_TMP_EMAIL to:
a particular https-url that you can ask for from the delta chat devs. This is implemented on the server side via the [mailadm](https://github.com/deltachat/mailadm) command line tool.
or the path of a file that contains two lines, each describing via “addr=… mail_pw=…” a test account login that will be used for the live tests.
With DCC_NEW_TMP_EMAIL set pytest invocations will use real e-mail accounts and run through all functional “liveconfig” tests.
Installing pre-built packages (Linux-only)
If you have a Linux system you may try to install the deltachat binary “wheel” packages without any “build-from-source” steps.
We suggest to Install virtualenv, then create a fresh Python virtual environment and activate it in your shell:
virtualenv venv # or: python -m venv source venv/bin/activate
Afterwards, invoking python or pip install only modifies files in your venv directory and leaves your system installation alone.
For Linux, we automatically build wheels for all github PR branches and push them to a python package index. To install the latest github master branch:
pip install --pre -i https://m.devpi.net/dc/master deltachat
To verify it worked:
python -c "import deltachat"
Code examples
You may look at examples.
Building manylinux1 based wheels
Building portable manylinux1 wheels which come with libdeltachat.so can be done with docker-tooling.
using docker pull / premade images
We publish a build environment under the deltachat/coredeps tag so that you can pull it from the hub.docker.com site’s “deltachat” organization:
$ docker pull deltachat/coredeps
This docker image can be used to run tests and build Python wheels for all interpreters:
$ docker run -e DCC_NEW_TMP_EMAIL \ --rm -it -v \$(pwd):/mnt -w /mnt \ deltachat/coredeps ci_scripts/run_all.sh
Optionally build your own docker image
If you want to build your own custom docker image you can do this:
$ cd deltachat-core # cd to deltachat-core checkout directory $ docker build -t deltachat/coredeps ci_scripts/docker_coredeps
This will use the ci_scripts/docker_coredeps/Dockerfile to build up docker image called deltachat/coredeps. You can afterwards find it with:
$ docker images
Troubleshooting
On more recent systems running the docker image may crash. You can fix this by adding vsyscall=emulate to the Linux kernel boot arguments commandline. E.g. on Debian you’d add this to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for deltachat-0.800.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4b5814280f2ee46e32eec94449eb61b733f20f558d875af2737e149618cc509 |
|
MD5 | db86b96f7f2b81c0d6eadff5dfdbf6d2 |
|
BLAKE2b-256 | 2749b1c7f2cff2f531ac5301717e3a49e82ae4ba1f9f9ce1c70127612df15a92 |
Hashes for deltachat-0.800.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef3d2e187fa4db58101d44e2c113851b0dfeca5d4b64f40a9c136db36efb4a1d |
|
MD5 | 57730fe40361f1a128d3d29e30ac0e6f |
|
BLAKE2b-256 | d9467ed624533db22e6e200d5fa3595e037a18ff98739c3755d088b7c35ae488 |
Hashes for deltachat-0.800.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58bfcef7221b83c0d27238548135117278b52aa12b28afd448e5c12ac941841b |
|
MD5 | f1941e826f74e3284d2fcc6cef4914ea |
|
BLAKE2b-256 | baf41146d19063b0513cf289d894772500399a607ed77606369d60081be0feb7 |
Hashes for deltachat-0.800.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f05ed4041c87839720d21cf05caebfd8fd2ac661bd6636d754b4b773caf9dd0 |
|
MD5 | 6aaf32aa5280d0be35298862922c5e3e |
|
BLAKE2b-256 | 88d032a98a4a814b4e59d02c68056ab330bf5399070919097e05e268f9c4c02c |