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 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 49115b6..c005c5f 100755 --- a/setup.cfg +++ b/setup.cfg @@ -27,14 +27,14 @@ 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 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 = 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, 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) 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()