From 35a83abf14f72a524a14b645cf95081c3789d084 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Mon, 29 Mar 2021 18:39:50 +0200 Subject: [PATCH 1/7] always have three keys --- test/sync_handshake.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/sync_handshake.py b/test/sync_handshake.py index c928c61..45daccb 100755 --- a/test/sync_handshake.py +++ b/test/sync_handshake.py @@ -90,6 +90,8 @@ def print_msg(p): def messageToSend(msg): + assert msg.from_.address == "alice@peptest.ch" + assert msg.to[0].address == "alice@peptest.ch" msg = add_debug_info(msg) minimail.send(inbox, msg, device_name) From 47205953d359f9e6dc8eb04460cce69938c7587e Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 30 Mar 2021 02:58:08 +0200 Subject: [PATCH 2/7] Build: Make default PREFIX=$(HOME), DEBUG=1 --- Makefile.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.conf b/Makefile.conf index 126cc86..5b7890a 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -11,8 +11,8 @@ PYTHON_ARTIFACTS += ./.pytest_cache VENV_DIR = ./venv # Build config Defaults -DEBUG=0 -PREFIX= +DEBUG=1 +PREFIX=$(HOME) ######### Overrides ######### -include $(HERE)local.conf From 7fb3ef584ed964ddc4eb2d9e16d9e1b7ed97ad2e Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 30 Mar 2021 03:01:10 +0200 Subject: [PATCH 3/7] use Adapter::inject_sync_shutdown() (libpEpAdapter > 0517b9b) --- src/pEp/_pEp/pEpmodule.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pEp/_pEp/pEpmodule.cc b/src/pEp/_pEp/pEpmodule.cc index 02b9458..b08278c 100644 --- a/src/pEp/_pEp/pEpmodule.cc +++ b/src/pEp/_pEp/pEpmodule.cc @@ -161,11 +161,6 @@ namespace pEp { // Adapter::session(release); } - void _inject_sync_shutdown() { - pEpLog("injecting null event"); - Adapter::_queue_sync_event(nullptr,nullptr); - } - // TODO: Integrate this (currently SEGFAULTING) void _notifyHandshake_sync_start() { pEpLog("all targets signal: SYNC_NOTIFY_START"); @@ -251,7 +246,7 @@ namespace pEp { def("_do_protocol_step", _do_protocol_step, ""); - def("_inject_sync_shutdown", _inject_sync_shutdown, + def("_inject_sync_shutdown", Adapter::inject_sync_shutdown, ""); def("_notifyHandshake_sync_start", _notifyHandshake_sync_start, From a80a18f027581d5337358a2852148962d1d07b38 Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 30 Mar 2021 22:37:09 +0200 Subject: [PATCH 4/7] test: sync_handshake.py - add --debuglog -d option --- test/sync_handshake.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/sync_handshake.py b/test/sync_handshake.py index 45daccb..fa05121 100755 --- a/test/sync_handshake.py +++ b/test/sync_handshake.py @@ -45,6 +45,7 @@ inbox = pathlib.Path("..") / "TestInbox" device_name = "" output = print multithreaded = False +debug_log = False DONT_TRIGGER_SYNC = 0x200 SYNC_HANDSHAKE_ACCEPTED = 0 @@ -151,9 +152,10 @@ def shutdown_sync(): def run(name, color=None, imap=False, own_ident=1, leave=False): - global device_name device_name = name + + pEp.set_debug_log_enabled(debug_log) pEp.notify_handshake = this_notifyHandshake if color: @@ -250,7 +252,9 @@ if __name__=="__main__": dest="leave", help="after a successful sync run this to make the device leave the " "device group again") - + optParser.add_option("-d", "--debuglog", action="store_true", + dest="debug_log", + help="print extra verbose pEpPythonAdater debug log") options, args = optParser.parse_args() if not options.exec_for: @@ -272,4 +276,5 @@ if __name__=="__main__": raise ValueError("Multiple own identities not supported for imap mode") multithreaded = options.multithreaded + debug_log = options.debug_log run(options.exec_for, options.color, options.imap, options.own_ident, options.leave) From 3615191b1161a735058b309dc7d6e03dd6fd586a Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 30 Mar 2021 22:38:02 +0200 Subject: [PATCH 5/7] Build: python_requires = >=3.7,<3.9 (since linux and mac might be different) --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 49115b6..e856bc6 100755 --- a/setup.cfg +++ b/setup.cfg @@ -27,7 +27,7 @@ classifiers = [options] zip_safe = false include_package_data = true -python_requires = >=3.8,<3.9 +python_requires = >=3.7,<3.9 test_suite = tests install_requires = # deprecated/redundant with pyproject.toml, but lets keep both ways around for now From 89613b713e66ebf4865db443f7852a1fcd9e75dc Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 30 Mar 2021 22:45:41 +0200 Subject: [PATCH 6/7] test: sync_test.py - add --debuglog -d --- test/sync_test.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/sync_test.py b/test/sync_test.py index c55f0f3..a4332e3 100755 --- a/test/sync_test.py +++ b/test/sync_test.py @@ -22,7 +22,7 @@ import shutil import pathlib -def test_for(path, color=None, end_on=None, mt=False, imap=False, own_ident=1): +def test_for(path, color=None, end_on=None, mt=False, imap=False, debuglog=False, own_ident=1): cwd = os.getcwd(); os.chdir(path) @@ -33,7 +33,7 @@ def test_for(path, color=None, end_on=None, mt=False, imap=False, own_ident=1): if end_on: sync_handshake.end_on = end_on sync_handshake.multithreaded = mt - + sync_handshake.debug_log = debuglog sync_handshake.run(path, color, imap, own_ident) @@ -105,6 +105,9 @@ if __name__ == "__main__": optParser.add_option("-A", "--add-account-after-sync", action="store_true", dest="add_account", help="after sync add an account") + optParser.add_option("-d", "--debuglog", action="store_true", + dest="debug_log", + help="print extra verbose pEpPythonAdater debug log") options, args = optParser.parse_args() @@ -211,14 +214,14 @@ if __name__ == "__main__": # Phone runs with own_ident = 2 Phone = Process(target=test_for, args=("Phone", "red", end_on, - options.multithreaded, options.imap, 2)) + options.multithreaded, options.imap, options.debug_log, 2)) # others run with own_ident = 1 Laptop = Process(target=test_for, args=("Laptop", "green", end_on, - options.multithreaded, options.imap)) + options.multithreaded, options.imap, options.debug_log)) if options.third: Pad = Process(target=test_for, args=("Pad", "cyan", end_on, - options.multithreaded, options.imap)) + options.multithreaded, options.imap, options.debug_log)) Phone.start() Laptop.start() From bc5a080aa5774995e6e6f05fa5c94cd0b3a6dc5b Mon Sep 17 00:00:00 2001 From: htgoebel Date: Tue, 4 May 2021 21:31:26 +0200 Subject: [PATCH 7/7] setup: Unpin version requirement for package wheel. A minimum version is not required, so unpin it. --- pyproject.toml | 3 ++- setup.cfg | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a25f0cb..be74ce7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,8 @@ requires =[ "setuptools >=39.2.0", "setuptools_scm >= 4.1.2", - "wheel >= 0.35.1" ] + "wheel", + ] build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index e856bc6..c005c5f 100755 --- a/setup.cfg +++ b/setup.cfg @@ -34,7 +34,7 @@ install_requires = setup_requires = setuptools >=39.2.0 setuptools_scm >= 4.1.2 - wheel >= 0.35.1 + wheel [options.extras_require] # To install these dependencies, run pip install .[test] test =