make wheel building work again -- switch manylinux2014 (#1522)

This commit is contained in:
holger krekel
2020-05-23 21:57:50 +02:00
committed by GitHub
parent 0ea442ca36
commit d4ddc2f9da
9 changed files with 54 additions and 14 deletions

View File

@@ -113,10 +113,10 @@ You may look at `examples <https://py.delta.chat/examples.html>`_.
.. _`deltachat-core`: https://github.com/deltachat/deltachat-core-rust
Building manylinux1 based wheels
================================
Building manylinux based wheels
====================================
Building portable manylinux1 wheels which come with libdeltachat.so
Building portable manylinux wheels which come with libdeltachat.so
can be done with docker-tooling.
using docker pull / premade images

View File

@@ -14,8 +14,11 @@ class EchoPlugin:
# unconditionally accept the chat
message.accept_sender_contact()
addr = message.get_sender_contact().addr
text = message.text
message.chat.send_text("echoing from {}:\n{}".format(addr, text))
if message.is_system_message():
message.chat.send_text("echoing system message from {}:\n{}".format(addr, message))
else:
text = message.text
message.chat.send_text("echoing from {}:\n{}".format(addr, text))
@account_hookimpl
def ac_message_delivered(self, message):

View File

@@ -28,8 +28,10 @@ class Message(object):
def __repr__(self):
c = self.get_sender_contact()
return "<Message id={} sender={}/{} outgoing={} chat={}/{}>".format(
self.id, c.id, c.addr, self.is_outgoing(), self.chat.id, self.chat.get_name())
typ = "outgoing" if self.is_outgoing() else "incoming"
return "<Message {} sys={} {} id={} sender={}/{} chat={}/{}>".format(
typ, self.is_system_message(), repr(self.text[:10]),
self.id, c.id, c.addr, self.chat.id, self.chat.get_name())
@classmethod
def from_db(cls, account, id):
@@ -94,7 +96,7 @@ class Message(object):
def is_system_message(self):
""" return True if this message is a system/info message. """
return lib.dc_msg_is_info(self._dc_msg)
return bool(lib.dc_msg_is_info(self._dc_msg))
def is_setup_message(self):
""" return True if this message is a setup message. """

View File

@@ -10,4 +10,6 @@ if __name__ == "__main__":
for relpath in os.listdir(workspacedir):
if relpath.startswith("deltachat"):
p = os.path.join(workspacedir, relpath)
subprocess.check_call(["auditwheel", "repair", p, "-w", workspacedir])
subprocess.check_call(
["auditwheel", "repair", p, "-w", workspacedir,
"--plat", "manylinux2014_x86_64"])

View File

@@ -1064,6 +1064,38 @@ class TestOnlineAccount:
assert mime.get_all("From")
assert mime.get_all("Received")
@pytest.mark.xfail(reason="core emits wrong DC_EVENT_INCOMING_MSG event")
def test_send_mark_seen_clean_incoming_events(self, acfactory, lp, data):
ac1, ac2 = acfactory.get_two_online_accounts()
chat = self.get_chat(ac1, ac2, both_created=True)
message_queue = queue.Queue()
class InPlugin:
@account_hookimpl
def ac_incoming_message(self, message):
message_queue.put(message)
ac1.add_account_plugin(InPlugin())
lp.sec("sending one message from ac1 to ac2")
chat.send_text("hello")
lp.sec("ac2: waiting to receive")
msg = ac2._evtracker.wait_next_incoming_message()
assert msg.text == "hello"
lp.sec("ac2: mark seen {}".format(msg))
msg.mark_seen()
lp.sec("ac2: send echo message")
msg.chat.send_text("world")
lp.sec("ac1: waiting for echo message")
incoming = message_queue.get(timeout=10)
assert incoming.text == "world"
assert msg.is_in_seen()
def test_send_and_receive_image(self, acfactory, lp, data):
ac1, ac2 = acfactory.get_two_online_accounts()
chat = self.get_chat(ac1, ac2)