Skip to content

Commit

Permalink
drop Python 3.7, stop building intel-only mac wheels
Browse files Browse the repository at this point in the history
stick with universal2

removes some dead code for handling 3.7
  • Loading branch information
minrk committed Jan 30, 2025
1 parent 096bb59 commit b6cf49a
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 170 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
matrix:
include:
- os: macos-13
python: "3.7"
python: "3.8"

- os: macos-14
python: "3.12"
Expand All @@ -57,7 +57,7 @@ jobs:
zmq: bundled

- os: ubuntu-20.04
python: "3.7"
python: "3.8"
zmq: bundled
tornado: none

Expand All @@ -77,9 +77,6 @@ jobs:

- os: ubuntu-22.04
python: "3.11"

- os: ubuntu-22.04
python: "3.8"
zmq: head

- os: ubuntu-22.04
Expand All @@ -93,11 +90,11 @@ jobs:
free_threading: free_threading

- os: windows-2022
python: "3.7"
python: "3.8"
arch: x86

- os: windows-2022
python: "3.9"
python: "3.11"
arch: x64

- os: windows-2022
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,13 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
name: mac-cpython
cibw:
build: "cp*"

- os: macos-13
name: mac-pypy
cibw:
build: "pp*"

- os: macos-14
name: mac-arm
name: mac-cpython
cibw:
arch: universal2
build: "cp*"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This package contains Python bindings for [ZeroMQ](https://zeromq.org).
ØMQ is a lightweight and fast messaging implementation.

PyZMQ should work with any reasonable version of Python (≥ 3.7), as well as PyPy.
PyZMQ should work with any reasonable version of Python (≥ 3.8), as well as PyPy.
The Cython backend used by CPython supports libzmq ≥ 2.1.4 (including 3.2.x and 4.x),
but the CFFI backend used by PyPy only supports libzmq ≥ 3.2.2 (including 4.x).

Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ an overview of what the ØMQ API looks like in Python. For information on how to
ØMQ in general, see the many examples in the excellent [ØMQ Guide], all of which
have a version in Python.

PyZMQ works with Python 3 (≥ 3.7), as well as PyPy via CFFI.
PyZMQ works with Python 3 (≥ 3.8), as well as PyPy via CFFI.

Please don't hesitate to report pyzmq-specific issues to our [tracker] on GitHub.
General questions about ØMQ are better sent to the [ØMQ tracker] or [mailing list].
Expand Down
7 changes: 0 additions & 7 deletions examples/security/asyncio-ironhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,3 @@ async def run() -> None:
logging.basicConfig(level=level, format="[%(levelname)s] %(message)s")

asyncio.run(run())

# Note: asyncio.run() was added in Python 3.7.
# For earlier Python versions, you can use:
#
# loop = asyncio.get_event_loop()
# loop.run_until_complete(run())
# loop.close()
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ authors = [
{ name = "Min Ragan-Kelley" },
]
license = { file = "LICENSE.md" }
requires-python = ">=3.7"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All @@ -32,7 +32,6 @@ classifiers = [
"Topic :: System :: Networking",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down
7 changes: 2 additions & 5 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
black; platform_python_implementation != "PyPy"
# gevent wheels on mac cause Illegal Instruction
codecov
# coverage 5 has issues with Cython: https://github.com/cython/cython/issues/3515
coverage<5; python_version < "3.7"
coverage>=7.1; python_version >= "3.7"
coverage>=7.1
cython; platform_python_implementation != "PyPy" # required for Cython tests
cython>=3.0.0b3; platform_python_implementation != "PyPy" and python_version >= "3.12" # required for Cython tests
flake8
gevent; platform_python_implementation != "PyPy" and sys_platform != "win32" and sys_platform != "darwin" and python_version < "3.11"
mypy; platform_python_implementation != "PyPy"
pymongo
pytest
pytest-asyncio>=0.16; python_version < "3.7"
pytest-asyncio>=0.17; python_version >= "3.7"
pytest-asyncio>=0.17
# pytest-cov 2.11 requires coverage 5, which still doesn't work with Cython
pytest-cov==2.10.*
pytest-rerunfailures
Expand Down
10 changes: 2 additions & 8 deletions tests/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import json
import os
import sys
from concurrent.futures import CancelledError
from multiprocessing import Process

import pytest
Expand Down Expand Up @@ -121,13 +120,8 @@ async def test_recv_json_cancelled(push_pull):
await asyncio.sleep(0)
obj = dict(a=5)
await a.send_json(obj)
# CancelledError change in 3.8 https://bugs.python.org/issue32528
if sys.version_info < (3, 8):
with pytest.raises(CancelledError):
recvd = await f
else:
with pytest.raises(asyncio.exceptions.CancelledError):
recvd = await f
with pytest.raises(asyncio.CancelledError):
recvd = await f
assert f.done()
# give it a chance to incorrectly consume the event
events = await b.poll(timeout=5)
Expand Down
4 changes: 0 additions & 4 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,6 @@ def make_auth(self):
return ThreadAuthenticator(self.context)


@pytest.mark.skipif(
sys.platform == 'win32' and sys.version_info < (3, 8),
reason="flaky event loop cleanup on windows+py<38",
)
class TestAsyncioAuthentication(AuthTest):
"""Test authentication running in a thread"""

Expand Down
97 changes: 0 additions & 97 deletions tools/run_with_env.cmd

This file was deleted.

19 changes: 0 additions & 19 deletions zmq/_typing.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
from __future__ import annotations

import sys
from typing import Any, Dict

if sys.version_info >= (3, 8):
from typing import Literal, TypedDict
else:
# avoid runtime dependency on typing_extensions on py37
try:
from typing_extensions import Literal, TypedDict # type: ignore
except ImportError:

class _Literal:
def __getitem__(self, key):
return Any

Literal = _Literal() # type: ignore

class TypedDict(Dict): # type: ignore
pass


if sys.version_info >= (3, 10):
from typing import TypeAlias
Expand Down
6 changes: 1 addition & 5 deletions zmq/backend/cffi/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@


def strerror(errno):
s = ffi.string(C.zmq_strerror(errno))
if not isinstance(s, str):
# py3
s = s.decode()
return s
return ffi.string(C.zmq_strerror(errno)).decode()


zmq_errno = C.zmq_errno
Expand Down
3 changes: 1 addition & 2 deletions zmq/eventloop/zmqstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
import pickle
import warnings
from queue import Queue
from typing import Any, Awaitable, Callable, Sequence, cast, overload
from typing import Any, Awaitable, Callable, Literal, Sequence, cast, overload

from tornado.ioloop import IOLoop
from tornado.log import gen_log

import zmq
import zmq._future
from zmq import POLLIN, POLLOUT
from zmq._typing import Literal
from zmq.utils import jsonapi


Expand Down
4 changes: 1 addition & 3 deletions zmq/sugar/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ class Context(ContextBase, AttributeSetter, Generic[_SocketType]):
def __init__(self: SyncContext, io_threads: int = 1): ...

@overload
def __init__(self: SyncContext, io_threads: Context):
# this should be positional-only, but that requires 3.8
...
def __init__(self: SyncContext, io_threads: Context, /): ...

@overload
def __init__(self: SyncContext, *, shadow: Context | int): ...
Expand Down
3 changes: 2 additions & 1 deletion zmq/sugar/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
Callable,
Generic,
List,
Literal,
Sequence,
TypeVar,
Union,
Expand All @@ -23,7 +24,7 @@
from warnings import warn

import zmq
from zmq._typing import Literal, TypeAlias
from zmq._typing import TypeAlias
from zmq.backend import Socket as SocketBase
from zmq.error import ZMQBindError, ZMQError
from zmq.utils import jsonapi
Expand Down
3 changes: 1 addition & 2 deletions zmq/utils/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
from __future__ import annotations

import struct
from typing import Awaitable, overload
from typing import Awaitable, TypedDict, overload

import zmq
import zmq.asyncio
from zmq._typing import TypedDict
from zmq.error import _check_version


Expand Down

0 comments on commit b6cf49a

Please sign in to comment.