From d04dcf0433552beca904fc80ab2e3348dc97a284 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 14:11:12 +0000 Subject: [PATCH 1/4] Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yml | 2 +- .github/workflows/wheels.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c67ccf14..b569ea5c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,7 +89,7 @@ jobs: - uses: actions/checkout@v4 - name: setup python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} architecture: ${{ matrix.arch || 'x64' }} diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 31fa51df8..eef1f9468 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v4 - name: setup python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v4 - name: setup python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" @@ -155,7 +155,7 @@ jobs: - uses: actions/checkout@v4 - name: setup python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" architecture: ${{ matrix.architecture }} From 9ec053a9c54f2e9a67d695617ef1f8c2a22dc39c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 14:11:57 +0000 Subject: [PATCH 2/4] Bump actions/cache from 3 to 4 Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c67ccf14..fd9504a66 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -109,7 +109,7 @@ jobs: # preserve pip cache to speed up installation - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip # Look to see if there is a cache hit for the corresponding requirements file From 294428f5418ef739a1e2ddb98ec8b6fd3ae3faa0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:06:14 +0000 Subject: [PATCH 3/4] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](https://github.com/PyCQA/flake8/compare/6.1.0...7.0.0) - [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 859cb3ac5..e6d2f5780 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: exclude: zmq/tests/test_imports.py - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 exclude: ^buildutils/templates/ @@ -67,7 +67,7 @@ repos: name: isort (pyi) types: [pyi] - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black # don't run black twice on constants.py From a3d9f1681101ec427b92c6e547c8046fdd664a78 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:06:33 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- buildutils/config.py | 1 + buildutils/detect.py | 1 + examples/asyncio/coroutines.py | 1 + examples/asyncio/router_router.py | 1 + examples/asyncio/tornado_asyncio.py | 1 + examples/device/device.py | 1 + examples/eventloop/asyncweb.py | 1 - examples/eventloop/coroutines.py | 1 + examples/gevent/reqrep.py | 1 + zmq/_future.py | 9 +++----- zmq/eventloop/zmqstream.py | 24 +++++++-------------- zmq/log/__main__.py | 17 +++++++++------ zmq/sugar/context.py | 6 ++---- zmq/sugar/socket.py | 33 ++++++++++------------------- zmq/tests/test_asyncio.py | 1 + zmq/tests/test_imports.py | 1 + zmq/tests/test_mypy.py | 1 + zmq/utils/monitor.py | 6 ++---- zmq/utils/win32.py | 6 +++--- 19 files changed, 50 insertions(+), 63 deletions(-) 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