diff --git a/buildutils/config.py b/buildutils/config.py index a38eefe36..eef097ba1 100644 --- a/buildutils/config.py +++ b/buildutils/config.py @@ -1,4 +1,5 @@ """Config functions""" + # ----------------------------------------------------------------------------- # Copyright (C) PyZMQ Developers # diff --git a/buildutils/detect.py b/buildutils/detect.py index 52a3417e4..fa94d9dfa 100644 --- a/buildutils/detect.py +++ b/buildutils/detect.py @@ -1,4 +1,5 @@ """Detect zmq version""" + # ----------------------------------------------------------------------------- # Copyright (C) PyZMQ Developers # diff --git a/examples/asyncio/coroutines.py b/examples/asyncio/coroutines.py index b7f4ef616..9d6e52e16 100644 --- a/examples/asyncio/coroutines.py +++ b/examples/asyncio/coroutines.py @@ -1,4 +1,5 @@ """Example using zmq with asyncio coroutines""" + # Copyright (c) PyZMQ Developers. # This example is in the public domain (CC-0) diff --git a/examples/asyncio/router_router.py b/examples/asyncio/router_router.py index 3dcfd2fbc..599d26a26 100644 --- a/examples/asyncio/router_router.py +++ b/examples/asyncio/router_router.py @@ -12,6 +12,7 @@ Contributed by github:jcpinto54 and github:frobnitzem """ + # Copyright (c) 2022 PyZMQ Developers. # This example is in the public domain (CC-0) diff --git a/examples/asyncio/tornado_asyncio.py b/examples/asyncio/tornado_asyncio.py index d3dbed277..5bec6dc08 100644 --- a/examples/asyncio/tornado_asyncio.py +++ b/examples/asyncio/tornado_asyncio.py @@ -1,4 +1,5 @@ """Example showing ZMQ with asyncio and tornadoweb integration.""" + # Copyright (c) PyZMQ Developers. # This example is in the public domain (CC-0) diff --git a/examples/device/device.py b/examples/device/device.py index 0d090fb91..77ebd3963 100644 --- a/examples/device/device.py +++ b/examples/device/device.py @@ -1,4 +1,5 @@ """Demonstrate using zmq.proxy device for message relay""" + # This example is placed in the Public Domain # It may also be used under the Creative Commons CC-0 License, (C) PyZMQ Developers diff --git a/examples/eventloop/asyncweb.py b/examples/eventloop/asyncweb.py index 5d4e46043..048e1a4f7 100644 --- a/examples/eventloop/asyncweb.py +++ b/examples/eventloop/asyncweb.py @@ -8,7 +8,6 @@ the event loop. """ - import asyncio import random import sys diff --git a/examples/eventloop/coroutines.py b/examples/eventloop/coroutines.py index b1613c826..4c4c2edc6 100644 --- a/examples/eventloop/coroutines.py +++ b/examples/eventloop/coroutines.py @@ -1,4 +1,5 @@ """Example using zmq with tornado coroutines""" + # Copyright (c) PyZMQ Developers. # This example is in the public domain (CC-0) diff --git a/examples/gevent/reqrep.py b/examples/gevent/reqrep.py index 33ed341a4..4ff6f450c 100644 --- a/examples/gevent/reqrep.py +++ b/examples/gevent/reqrep.py @@ -1,6 +1,7 @@ """ Complex example which is a combination of the rr* examples from the zguide. """ + from gevent import spawn import zmq.green as zmq diff --git a/zmq/_future.py b/zmq/_future.py index 067921bcc..757219db7 100644 --- a/zmq/_future.py +++ b/zmq/_future.py @@ -275,14 +275,12 @@ def get(self, key): @overload # type: ignore def recv_multipart( self, flags: int = 0, *, track: bool = False - ) -> Awaitable[List[bytes]]: - ... + ) -> Awaitable[List[bytes]]: ... @overload def recv_multipart( self, flags: int = 0, *, copy: Literal[True], track: bool = False - ) -> Awaitable[List[bytes]]: - ... + ) -> Awaitable[List[bytes]]: ... @overload def recv_multipart( @@ -293,8 +291,7 @@ def recv_multipart( @overload def recv_multipart( self, flags: int = 0, copy: bool = True, track: bool = False - ) -> Awaitable[Union[List[bytes], List[_zmq.Frame]]]: - ... + ) -> Awaitable[Union[List[bytes], List[_zmq.Frame]]]: ... def recv_multipart( self, flags: int = 0, copy: bool = True, track: bool = False diff --git a/zmq/eventloop/zmqstream.py b/zmq/eventloop/zmqstream.py index 20c1866e1..cf25375f9 100644 --- a/zmq/eventloop/zmqstream.py +++ b/zmq/eventloop/zmqstream.py @@ -178,24 +178,21 @@ def on_err(self, callback: Callable): def on_recv( self, callback: Callable[[List[bytes]], Any], - ) -> None: - ... + ) -> None: ... @overload def on_recv( self, callback: Callable[[List[bytes]], Any], copy: Literal[True], - ) -> None: - ... + ) -> None: ... @overload def on_recv( self, callback: Callable[[List[zmq.Frame]], Any], copy: Literal[False], - ) -> None: - ... + ) -> None: ... @overload def on_recv( @@ -205,8 +202,7 @@ def on_recv( Callable[[List[bytes]], Any], ], copy: bool = ..., - ): - ... + ): ... def on_recv( self, @@ -254,24 +250,21 @@ def on_recv( def on_recv_stream( self, callback: Callable[["ZMQStream", List[bytes]], Any], - ) -> None: - ... + ) -> None: ... @overload def on_recv_stream( self, callback: Callable[["ZMQStream", List[bytes]], Any], copy: Literal[True], - ) -> None: - ... + ) -> None: ... @overload def on_recv_stream( self, callback: Callable[["ZMQStream", List[zmq.Frame]], Any], copy: Literal[False], - ) -> None: - ... + ) -> None: ... @overload def on_recv_stream( @@ -281,8 +274,7 @@ def on_recv_stream( Callable[["ZMQStream", List[bytes]], Any], ], copy: bool = ..., - ): - ... + ): ... def on_recv_stream( self, diff --git a/zmq/log/__main__.py b/zmq/log/__main__.py index 230548d18..15a11e4d0 100644 --- a/zmq/log/__main__.py +++ b/zmq/log/__main__.py @@ -18,7 +18,6 @@ """ - # encoding: utf-8 # Copyright (C) PyZMQ Developers @@ -113,12 +112,16 @@ fields = { 'msg': msg.decode('utf8').strip(), - 'ts': datetime.now().strftime(args.dateformat) + ' ' - if args.timestamp - else '', - 'aligned': '.'.join(aligned_parts) - if args.align - else topic.decode('utf8').strip(), + 'ts': ( + datetime.now().strftime(args.dateformat) + ' ' + if args.timestamp + else '' + ), + 'aligned': ( + '.'.join(aligned_parts) + if args.align + else topic.decode('utf8').strip() + ), 'color': colors.get(level, ''), 'color_rst': colors.get('__RESET__', ''), 'sep': args.separator, diff --git a/zmq/sugar/context.py b/zmq/sugar/context.py index 87731797d..3201e4e45 100644 --- a/zmq/sugar/context.py +++ b/zmq/sugar/context.py @@ -86,8 +86,7 @@ class Context(ContextBase, AttributeSetter, Generic[ST]): _socket_class: Type[ST] = Socket # type: ignore @overload - def __init__(self: "Context[Socket]", io_threads: int = 1): - ... + def __init__(self: "Context[Socket]", io_threads: int = 1): ... @overload def __init__(self: "Context[Socket]", io_threads: "Context"): @@ -95,8 +94,7 @@ def __init__(self: "Context[Socket]", io_threads: "Context"): ... @overload - def __init__(self: "Context[Socket]", *, shadow: Union["Context", int]): - ... + def __init__(self: "Context[Socket]", *, shadow: Union["Context", int]): ... def __init__( self: "Context[Socket]", diff --git a/zmq/sugar/socket.py b/zmq/sugar/socket.py index 7570a74b3..32e49a3f7 100644 --- a/zmq/sugar/socket.py +++ b/zmq/sugar/socket.py @@ -109,8 +109,7 @@ def __init__( socket_type: int, *, copy_threshold: Optional[int] = None, - ): - ... + ): ... @overload def __init__( @@ -118,15 +117,13 @@ def __init__( *, shadow: Union["Socket", int], copy_threshold: Optional[int] = None, - ): - ... + ): ... @overload def __init__( self: "Socket[bytes]", ctx_or_socket: "Socket", - ): - ... + ): ... def __init__( self: "Socket[bytes]", @@ -578,8 +575,7 @@ def send( track: Literal[True], routing_id: Optional[int] = ..., group: Optional[str] = ..., - ) -> "zmq.MessageTracker": - ... + ) -> "zmq.MessageTracker": ... @overload def send( @@ -591,8 +587,7 @@ def send( track: Literal[False], routing_id: Optional[int] = ..., group: Optional[str] = ..., - ) -> None: - ... + ) -> None: ... @overload def send( @@ -603,8 +598,7 @@ def send( copy: bool = ..., routing_id: Optional[int] = ..., group: Optional[str] = ..., - ) -> None: - ... + ) -> None: ... @overload def send( @@ -615,8 +609,7 @@ def send( track: bool = ..., routing_id: Optional[int] = ..., group: Optional[str] = ..., - ) -> Optional["zmq.MessageTracker"]: - ... + ) -> Optional["zmq.MessageTracker"]: ... def send( self, @@ -755,24 +748,20 @@ def send_multipart( @overload def recv_multipart( self, flags: int = ..., *, copy: Literal[True], track: bool = ... - ) -> List[bytes]: - ... + ) -> List[bytes]: ... @overload def recv_multipart( self, flags: int = ..., *, copy: Literal[False], track: bool = ... - ) -> List[zmq.Frame]: - ... + ) -> List[zmq.Frame]: ... @overload - def recv_multipart(self, flags: int = ..., *, track: bool = ...) -> List[bytes]: - ... + def recv_multipart(self, flags: int = ..., *, track: bool = ...) -> List[bytes]: ... @overload def recv_multipart( self, flags: int = 0, copy: bool = True, track: bool = False - ) -> Union[List[zmq.Frame], List[bytes]]: - ... + ) -> Union[List[zmq.Frame], List[bytes]]: ... def recv_multipart( self, flags: int = 0, copy: bool = True, track: bool = False diff --git a/zmq/tests/test_asyncio.py b/zmq/tests/test_asyncio.py index 92f47d452..413239734 100644 --- a/zmq/tests/test_asyncio.py +++ b/zmq/tests/test_asyncio.py @@ -1,4 +1,5 @@ """Test asyncio support""" + # Copyright (c) PyZMQ Developers # Distributed under the terms of the Modified BSD License. diff --git a/zmq/tests/test_imports.py b/zmq/tests/test_imports.py index dbe262a58..1e77dfad2 100644 --- a/zmq/tests/test_imports.py +++ b/zmq/tests/test_imports.py @@ -2,6 +2,7 @@ Test Imports - the quickest test to ensure that we haven't introduced version-incompatible syntax errors. """ + # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. diff --git a/zmq/tests/test_mypy.py b/zmq/tests/test_mypy.py index 441a89cfd..48e57ba07 100644 --- a/zmq/tests/test_mypy.py +++ b/zmq/tests/test_mypy.py @@ -1,6 +1,7 @@ """ Test our typing with mypy """ + import os import sys from subprocess import PIPE, STDOUT, Popen diff --git a/zmq/utils/monitor.py b/zmq/utils/monitor.py index dbc660a8d..4b954d6c1 100644 --- a/zmq/utils/monitor.py +++ b/zmq/utils/monitor.py @@ -67,16 +67,14 @@ async def _parse_monitor_msg_async( def recv_monitor_message( socket: "zmq.asyncio.Socket", flags: int = 0, -) -> Awaitable[_MonitorMessage]: - ... +) -> Awaitable[_MonitorMessage]: ... @overload def recv_monitor_message( socket: zmq.Socket[bytes], flags: int = 0, -) -> _MonitorMessage: - ... +) -> _MonitorMessage: ... def recv_monitor_message( diff --git a/zmq/utils/win32.py b/zmq/utils/win32.py index 30e08b982..f21e57b7a 100644 --- a/zmq/utils/win32.py +++ b/zmq/utils/win32.py @@ -81,9 +81,9 @@ def _init_action(self, action): # PHANDLER_ROUTINE = WINFUNCTYPE(BOOL, DWORD) - SetConsoleCtrlHandler = ( - self._SetConsoleCtrlHandler - ) = kernel32.SetConsoleCtrlHandler + SetConsoleCtrlHandler = self._SetConsoleCtrlHandler = ( + kernel32.SetConsoleCtrlHandler + ) SetConsoleCtrlHandler.argtypes = (PHANDLER_ROUTINE, BOOL) SetConsoleCtrlHandler.restype = BOOL