Skip to content

Commit

Permalink
Merge pull request #2061 from minrk/rm-37-intel
Browse files Browse the repository at this point in the history
drop Python 3.7, stop building intel-only mac wheels
  • Loading branch information
minrk authored Feb 4, 2025
2 parents 096bb59 + 27d66b7 commit 5209041
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 190 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
continue-on-error: ${{ matrix.zmq == 'head' }}

env:
MACOSX_DEPLOYMENT_TARGET: "11.7"
MACOSX_DEPLOYMENT_TARGET: "13.7"

strategy:
fail-fast: true
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 @@ -66,7 +66,7 @@ jobs:
zmq: bundled

- os: ubuntu-22.04
python: pypy-3.7
python: pypy-3.8

- os: ubuntu-22.04
python: "3.9"
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
9 changes: 2 additions & 7 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
name: wheel-${{ matrix.name }}

env:
MACOSX_DEPLOYMENT_TARGET: "10.9"
MACOSX_DEPLOYMENT_TARGET: "10.15"
CIBW_BUILD: "${{ matrix.cibw.build || '*' }}"
CIBW_SKIP: "${{ matrix.cibw.skip || '' }}"
CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}"
Expand All @@ -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()
10 changes: 2 additions & 8 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 Expand Up @@ -166,9 +165,8 @@ before-all = "bash tools/install_libzmq.sh"
repair-wheel-command = "delocate-wheel --sanitize-rpaths --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"

[tool.cibuildwheel.macos.environment]
# note: everything here needs to also be duplicated in overrides below
ZMQ_PREFIX = "/tmp/zmq"
MACOSX_DEPLOYMENT_TARGET = "10.9"
MACOSX_DEPLOYMENT_TARGET = "10.15"

[tool.cibuildwheel.windows]
before-all = "python buildutils/bundle.py licenses"
Expand All @@ -191,10 +189,6 @@ repair-wheel-command = """\
"cmake.define.ZMQ_HAVE_IPC" = "OFF"
"cmake.define.POLLER" = "select"

# mac-arm target is 10.15
[[tool.cibuildwheel.overrides]]
select = "*macos*{universal2,arm64}*"
environment = { ZMQ_PREFIX = "/tmp/zmq", MACOSX_DEPLOYMENT_TARGET = "10.15" }

# manylinux2010 for (less) old cp37-9, pp37-8
[[tool.cibuildwheel.overrides]]
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ testpaths =
tests
# automatically run coroutine tests with asyncio
asyncio_mode = auto
asyncio_default_fixture_loop_scope = function
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
12 changes: 1 addition & 11 deletions tests/test_ioloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@

import pytest

try:
import tornado.ioloop
except ImportError:
_tornado = False
else:
_tornado = True


def setup():
if not _tornado:
pytest.skip("requires tornado")
tornado = pytest.importorskip("tornado")


def test_ioloop():
Expand Down
3 changes: 3 additions & 0 deletions tools/install_libzmq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ LICENSE_DIR="$PYZMQ_DIR/licenses"
test -d "$LICENSE_DIR" || mkdir "$LICENSE_DIR"

if [[ "$(uname)" == "Darwin" ]]; then
# make sure deployment target is set
echo "${MACOSX_DEPLOYMENT_TARGET=}"
test ! -z "${MACOSX_DEPLOYMENT_TARGET}"
# need LT_MULTI_MODULE or libtool will strip out
# all multi-arch symbols at the last step
export LT_MULTI_MODULE=1
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
Loading

0 comments on commit 5209041

Please sign in to comment.