From 3a536e184309f04a4ffe9dff446207e7267f2f99 Mon Sep 17 00:00:00 2001 From: tpavelchak Date: Fri, 18 Oct 2019 16:21:47 +0300 Subject: Update print, xrange and unicode functions for python 2/3 compatibility --- bin/logwatcher.py | 2 +- eventmq/subscriber.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/logwatcher.py b/bin/logwatcher.py index dd2860f..1abeb4a 100644 --- a/bin/logwatcher.py +++ b/bin/logwatcher.py @@ -13,4 +13,4 @@ while True: if events.get(s) == zmq.POLLIN: msg = s.recv_multipart() - print msg # noqa + print(msg) # noqa diff --git a/eventmq/subscriber.py b/eventmq/subscriber.py index f585572..ef1aa0b 100644 --- a/eventmq/subscriber.py +++ b/eventmq/subscriber.py @@ -1,6 +1,7 @@ """ derp subscriber """ +from past.builtins import xrange import zmq @@ -18,4 +19,4 @@ if __name__ == "__main__": # block until something comes in. normally you'd do something with # this in another thread or something for s in sockets: - print s.recv_multipart() # noqa + print(s.recv_multipart()) # noqa -- cgit v1.2.1 From 6a827f5a77ffb3b4a7f1bd245211110d54f29d9d Mon Sep 17 00:00:00 2001 From: tpavelchak Date: Fri, 18 Oct 2019 16:34:13 +0300 Subject: Replace parameter named async to async_ --- eventmq/client/jobs.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/eventmq/client/jobs.py b/eventmq/client/jobs.py index 9ec9a07..bd9db58 100644 --- a/eventmq/client/jobs.py +++ b/eventmq/client/jobs.py @@ -59,7 +59,7 @@ class Job(object): s.sendmail('me@gmail.com', [recipient,], msg.as_string()) s.quit() """ - def __init__(self, broker_addr=None, queue=None, async=True, *args, + def __init__(self, broker_addr=None, queue=None, async_=True, *args, **kwargs): """ Args: @@ -69,20 +69,20 @@ class Job(object): address is given then the value of the environment variable ``EMQ_BROKER_ADDR`` will be used, If that is undefined a warning will be emitted and the job will be run synchronously. - async (bool): If you want to run all executions of a particular job - synchronously but still decorate it with the job decorator you - can set this to False. This is useful for unit tests. + async_ (bool): If you want to run all executions of a particular + job synchronously but still decorate it with the job decorator + you can set this to False. This is useful for unit tests. """ # conf.BROKER_ADDR isn't used because /etc/eventmq.conf is for the # daemons. self.broker_addr = broker_addr or os.environ.get(ENV_BROKER_ADDR) self.queue = queue - self.async = async + self.async_ = async_ def __call__(self, f): def delay(*args, **kwargs): - if self.async and self.broker_addr: + if self.async_ and self.broker_addr: socket = Sender() socket.connect(addr=self.broker_addr) @@ -91,7 +91,7 @@ class Job(object): return msgid else: - if self.async and not self.broker_addr: + if self.async_ and not self.broker_addr: logger.warning('No EMQ_BROKER_ADDR defined. Running ' 'function `{}` synchronously'.format( f.__name__)) @@ -101,13 +101,13 @@ class Job(object): return f -def job(func, broker_addr=None, queue=None, async=True, *args, +def job(func, broker_addr=None, queue=None, async_=True, *args, **kwargs): """ Functional decorator helper for creating a deferred eventmq job. See :class:`Job` for more information. """ - decorator = Job(queue=queue, broker_addr=broker_addr, async=async) + decorator = Job(queue=queue, broker_addr=broker_addr, async_=async_) if callable(func): return decorator(func) -- cgit v1.2.1 From d4c119bbd264559def2460a6f11e41bc97111c39 Mon Sep 17 00:00:00 2001 From: tpavelchak Date: Fri, 18 Oct 2019 16:35:04 +0300 Subject: Version bump 0.3.11 --- eventmq/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventmq/__init__.py b/eventmq/__init__.py index 1515f24..77bbe4a 100644 --- a/eventmq/__init__.py +++ b/eventmq/__init__.py @@ -1,5 +1,5 @@ __author__ = 'EventMQ Contributors' -__version__ = '0.3.10' +__version__ = '0.3.11' PROTOCOL_VERSION = 'eMQP/1.0' -- cgit v1.2.1 From 8ddcb39d55ed99e0da9df894e990cb56e3fae1bb Mon Sep 17 00:00:00 2001 From: tpavelchak Date: Fri, 18 Oct 2019 17:05:27 +0300 Subject: Update pyzmq lib --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 61af985..1137322 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setup( description='EventMQ job execution and messaging system based on ZeroMQ', packages=find_packages(), install_requires=[ - 'pyzmq==15.4.0', + 'pyzmq==18.1.0', 'six==1.10.0', 'monotonic==0.4', 'croniter==0.3.10', -- cgit v1.2.1 From 06c1993646618d750e27aa3b7f9d80c4226e1924 Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 25 Oct 2019 10:38:02 -0600 Subject: add test support for python 3.7 --- .circleci/config.yml | 6 ++++++ setup.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 46dab22..7c144ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,3 +41,9 @@ workflows: - test: name: "python 3.5" version: "3.5" + - test: + name: "python 3.6" + version: "3.5" + - test: + name: "python 3.7" + version: "3.5" diff --git a/setup.py b/setup.py index 1137322..b4adf1d 100644 --- a/setup.py +++ b/setup.py @@ -60,6 +60,8 @@ setup( # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', ], scripts=[ 'bin/emq-cli', -- cgit v1.2.1