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

replace travis with circle-ci, cleanup of build steps (#639)

Travis is getting slower and was already hard to debug. This commit: 

- moves from travis to Circle-CI
- has a ci-scripts/README.md which explains what is contained there
- puts all build and CI scripts into "ci_scripts" directory
- allows to run full ci runs locally
- trims down the base Docker image where tests/docs/wheels are run from 4.4GB to 1.7GB
- fixes #628

Using circle-ci also means that we can probably integrate Mac-OS build steps more easily.

I am sure that my initial circle-ci config (helped by kind hints from @dignifiedquire ) can be improved.
This commit is contained in:
holger krekel 2019-04-01 09:45:56 +02:00 committed by GitHub
parent 7f3bf1f528
commit 515e5ebba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 608 additions and 309 deletions

View file

@ -1,3 +1,9 @@
0.9.1-dev
---------
- use docker image for building wheels
- fix code documentation links
0.9.0
-----

View file

@ -10,9 +10,9 @@ high level API reference
other classes)
- :class:`deltachat.chatting.Contact`
- :class:`deltachat.chatting.Chat`
- :class:`deltachat.chatting.Message`
- :class:`deltachat.chatting.MessageType`
- :class:`deltachat.chatting.MessageState`
- :class:`deltachat.message.Message`
- :class:`deltachat.message.MessageType`
- :class:`deltachat.message.MessageState`
Account
-------
@ -36,19 +36,19 @@ Chat
Message
-------
.. autoclass:: deltachat.chatting.Message
.. autoclass:: deltachat.message.Message
:members:
MessageType
------------
.. autoclass:: deltachat.chatting.MessageType
.. autoclass:: deltachat.message.MessageType
:members:
MessageState
------------
.. autoclass:: deltachat.chatting.MessageState
.. autoclass:: deltachat.message.MessageState
:members:

View file

@ -2,7 +2,7 @@ from deltachat import capi, const
from deltachat.capi import ffi
from deltachat.account import Account # noqa
__version__ = "0.9.0"
__version__ = "0.9.1dev1"
_DC_CALLBACK_MAP = {}

View file

@ -141,7 +141,7 @@ class Account(object):
:param view_type: a string specifying "text", "video",
"image", "audio" or "file".
:returns: :class:`deltachat.chatting.Message` instance.
:returns: :class:`deltachat.message.Message` instance.
"""
return Message.new(self._dc_context, view_type)
@ -167,7 +167,7 @@ class Account(object):
whose name or e-mail matches query.
:param only_verified: if true only return verified contacts.
:param with_self: if true the self-contact is also returned.
:returns: list of :class:`deltachat.chatting.Message` objects.
:returns: list of :class:`deltachat.message.Message` objects.
"""
flags = 0
query = as_dc_charpointer(query)
@ -256,7 +256,7 @@ class Account(object):
def forward_messages(self, messages, chat):
""" Forward list of messages to a chat.
:param messages: list of :class:`deltachat.chatting.Message` object.
:param messages: list of :class:`deltachat.message.Message` object.
:param chat: :class:`deltachat.chatting.Chat` object.
:returns: None
"""
@ -266,7 +266,7 @@ class Account(object):
def delete_messages(self, messages):
""" delete messages (local and remote).
:param messages: list of :class:`deltachat.chatting.Message` object.
:param messages: list of :class:`deltachat.message.Message` object.
:returns: None
"""
msg_ids = [msg.id for msg in messages]

View file

@ -113,7 +113,7 @@ class Chat(object):
:param msg: unicode text
:raises: ValueError if message can not be send/chat does not exist.
:returns: the resulting :class:`deltachat.chatting.Message` instance
:returns: the resulting :class:`deltachat.message.Message` instance
"""
msg = as_dc_charpointer(text)
msg_id = lib.dc_send_text_msg(self._dc_context, self.id, msg)
@ -127,7 +127,7 @@ class Chat(object):
:param path: path to the file.
:param mime_type: the mime-type of this file, defaults to application/octet-stream.
:raises: ValueError if message can not be send/chat does not exist.
:returns: the resulting :class:`deltachat.chatting.Message` instance
:returns: the resulting :class:`deltachat.message.Message` instance
"""
path = as_dc_charpointer(path)
mtype = as_dc_charpointer(mime_type)
@ -143,7 +143,7 @@ class Chat(object):
:param path: path to an image file.
:raises: ValueError if message can not be send/chat does not exist.
:returns: the resulting :class:`deltachat.chatting.Message` instance
:returns: the resulting :class:`deltachat.message.Message` instance
"""
if not os.path.exists(path):
raise ValueError("path does not exist: {!r}".format(path))
@ -179,7 +179,7 @@ class Chat(object):
:param message: a :class:`Message` instance previously returned by
:meth:`prepare_file`.
:raises: ValueError if message can not be sent.
:returns: a :class:`deltachat.chatting.Message` instance with updated state
:returns: a :class:`deltachat.message.Message` instance with updated state
"""
msg_id = lib.dc_send_msg(self._dc_context, 0, message._dc_msg)
if msg_id == 0:
@ -189,7 +189,7 @@ class Chat(object):
def get_messages(self):
""" return list of messages in this chat.
:returns: list of :class:`deltachat.chatting.Message` objects for this chat.
:returns: list of :class:`deltachat.message.Message` objects for this chat.
"""
dc_array = ffi.gc(
lib.dc_get_chat_msgs(self._dc_context, self.id, 0, 0),

View file

@ -51,7 +51,7 @@ class Message(object):
def get_state(self):
""" get the message in/out state.
:returns: :class:`deltachat.chatting.MessageState`
:returns: :class:`deltachat.message.MessageState`
"""
return MessageState(self)
@ -89,7 +89,7 @@ class Message(object):
def view_type(self):
"""the view type of this message.
:returns: a :class:`deltachat.chatting.MessageType` instance.
:returns: a :class:`deltachat.message.MessageType` instance.
"""
return MessageType(lib.dc_msg_get_viewtype(self._dc_msg))

View file

@ -0,0 +1,13 @@
import os
import sys
import subprocess
if __name__ == "__main__":
assert len(sys.argv) == 2
workspacedir = sys.argv[1]
for relpath in os.listdir(workspacedir):
if relpath.startswith("deltachat"):
p = os.path.join(workspacedir, relpath)
subprocess.check_call(["auditwheel", "repair", p, "-w", workspacedir])

View file

@ -4,15 +4,25 @@ envlist =
py27
py35
lint
auditwheels
[testenv]
commands = pytest -rsXx {posargs:tests}
commands =
pytest -rsXx {posargs:tests}
pip wheel . -w {toxworkdir}/wheelhouse
passenv = TRAVIS
deps =
pytest
pytest-faulthandler
pdbpp
[testenv:auditwheels]
skipsdist = True
commands =
python tests/auditwheels.py {toxworkdir}/wheelhouse
[testenv:lint]
skipsdist = True
usedevelop = True
@ -28,14 +38,13 @@ commands =
rst-lint --encoding 'utf-8' README.rst
[testenv:doc]
usedevelop = True
deps =
sphinx
sphinx==1.8.5
breathe
changedir = doc
commands =
sphinx-build -b html . _build/html
sphinx-build -w docker-toxdoc-warnings.log -b html . _build/html
[pytest]

View file

@ -1,123 +0,0 @@
FROM quay.io/pypa/manylinux1_x86_64
# Configure ld.so/ldconfig and pkg-config
RUN echo /usr/local/lib64 > /etc/ld.so.conf.d/local.conf && \
echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf
ENV PKG_CONFIG_PATH /usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig
# Install meson and ninja
ENV NINJA_VERSION v1.8.2
ENV NINJA_SHA256 d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07
RUN curl -L -o ninja-linux-$NINJA_VERSION.zip https://github.com/ninja-build/ninja/releases/download/${NINJA_VERSION}/ninja-linux.zip
RUN echo "${NINJA_SHA256} ninja-linux-${NINJA_VERSION}.zip" | sha256sum -c -
RUN unzip ninja-linux-${NINJA_VERSION}.zip
RUN mv ninja /usr/bin/ninja
RUN /opt/python/cp37-cp37m/bin/pip install meson
RUN cd /usr/bin && ln -s /opt/_internal/cpython-3.7.*/bin/meson
# Install a recent zlib, needed by libetpan
ENV ZLIB_VERSION 1.2.11
ENV ZLIB_SHA256 c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
RUN curl -O https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz
RUN echo "${ZLIB_SHA256} zlib-${ZLIB_VERSION}.tar.gz" | sha256sum -c -
RUN tar xzf zlib-${ZLIB_VERSION}.tar.gz
RUN cd zlib-${ZLIB_VERSION} && ./configure
RUN cd zlib-${ZLIB_VERSION} && make
RUN cd zlib-${ZLIB_VERSION} && make install
RUN ldconfig -v
# Install a recent Perl, needed to install OpenSSL
ENV PERL_VERSION 5.28.0
ENV PERL_SHA256 7e929f64d4cb0e9d1159d4a59fc89394e27fa1f7004d0836ca0d514685406ea8
RUN curl -O https://www.cpan.org/src/5.0/perl-${PERL_VERSION}.tar.gz
RUN echo "${PERL_SHA256} perl-${PERL_VERSION}.tar.gz" | sha256sum -c -
RUN tar xzf perl-${PERL_VERSION}.tar.gz
RUN cd perl-${PERL_VERSION} && ./Configure -de
RUN cd perl-${PERL_VERSION} && make
RUN cd perl-${PERL_VERSION} && make install
# Install OpenSSL
ENV OPENSSL_VERSION 1.1.1a
ENV OPENSSL_SHA256 fc20130f8b7cbd2fb918b2f14e2f429e109c31ddd0fb38fc5d71d9ffed3f9f41
RUN curl -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
RUN echo "${OPENSSL_SHA256} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c -
RUN tar xzf openssl-${OPENSSL_VERSION}.tar.gz
RUN cd openssl-${OPENSSL_VERSION} && \
./config shared no-ssl2 no-ssl3 -fPIC --prefix=/usr/local
RUN cd openssl-${OPENSSL_VERSION} && \
sed -i "s/^SHLIB_MAJOR=.*/SHLIB_MAJOR=200/" Makefile && \
sed -i "s/^SHLIB_MINOR=.*/SHLIB_MINOR=0.0/" Makefile && \
sed -i "s/^SHLIB_VERSION_NUMBER=.*/SHLIB_VERSION_NUMBER=200.0.0/" Makefile
RUN cd openssl-${OPENSSL_VERSION} && make depend
RUN cd openssl-${OPENSSL_VERSION} && make
RUN cd openssl-${OPENSSL_VERSION} && make install_sw install_ssldirs
RUN ldconfig -v
# Install cyrus-sasl
ENV SASL_VERSION 2.1.27
ENV SASL_SHA256 26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5
RUN curl -O https://www.cyrusimap.org/releases/cyrus-sasl-${SASL_VERSION}.tar.gz
RUN echo "${SASL_SHA256} cyrus-sasl-${SASL_VERSION}.tar.gz" | sha256sum -c -
RUN tar zxf cyrus-sasl-${SASL_VERSION}.tar.gz
RUN cd cyrus-sasl-${SASL_VERSION} && \
./configure --disable-silent-rules \
--disable-cmulocal \
--disable-sample \
--disable-obsolete_cram_attr \
--disable-obsolete_digest_attr \
--disable-staticdlopen \
--disable-java \
--disable-alwaystrue \
--enable-checkapop \
--enable-cram \
--enable-digest \
--enable-scram \
--disable-otp \
--disable-srp \
--disable-srp-setpass \
--disable-krb4 \
--disable-gssapi \
--disable-gss_mutexes \
--disable-sia \
--disable-auth-sasldb \
--disable-httpform \
--enable-plain \
--enable-anon \
--enable-login \
--disable-ntlm \
--disable-passdss \
--disable-sql \
--disable-ldapdb \
--disable-macos-framework
RUN cd cyrus-sasl-${SASL_VERSION} && make
RUN cd cyrus-sasl-${SASL_VERSION} && make install
RUN ldconfig -v
# Install libetpan
ENV ETPAN_VERSION 1.9.1
ENV ETPAN_SHA256 f5e354ccf1014c6ee313ade1009b8a82f28043d2504655e388bb4c1328700fcd
RUN curl -L -o libetpan-${ETPAN_VERSION}.tar.gz \
https://github.com/dinhviethoa/libetpan/archive/${ETPAN_VERSION}.tar.gz
RUN echo "${ETPAN_SHA256} libetpan-${ETPAN_VERSION}.tar.gz" | sha256sum -c -
RUN tar xzf libetpan-${ETPAN_VERSION}.tar.gz
RUN cd libetpan-${ETPAN_VERSION} && \
./autogen.sh && \
./configure --enable-ipv6 \
--enable-iconv --disable-db \
--with-openssl --with-sasl --with-zlib \
--without-curl --without-expat
RUN cd libetpan-${ETPAN_VERSION} && make
RUN cd libetpan-${ETPAN_VERSION} && make install
RUN ldconfig -v
# Install Rust nightly
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y
ENV PATH=/root/.cargo/bin:$PATH
RUN rustc --version
# Install RPGP from github -- this currently downloads 500MB
# see reported issue: https://github.com/dignifiedquire/rpgp/issues/30
RUN true \
&& git clone https://github.com/dignifiedquire/rpgp.git \
&& cd rpgp/pgp-ffi \
&& make install

View file

@ -1,27 +0,0 @@
#!/bin/bash
set -e -x
## Build the library
meson -Drpgp=true /builddir /io
pushd /builddir
ninja
ninja install
ldconfig -v
popd
## Compile wheels
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install cffi requests attrs six pytest
"${PYBIN}/pip" wheel /io/python -w wheelhouse/
done
## Bundle external shared libraries into the wheels
for whl in wheelhouse/deltachat*.whl; do
auditwheel repair "$whl" -w /io/python/wheelhouse/
done
## Install packages (and test)
for PYBIN in /opt/python/*/bin/; do
"${PYBIN}/pip" install deltachat --no-index -f /io/python/wheelhouse
# (cd "$HOME"; "${PYBIN}/pytest" /io/python/tests)
done