Skip to content

Commit 6360747

Browse files
authored
Drop Python 3.6, add 3.10 (#841)
* Drop Python 3.6, add 3.10 * Add line on 3.10 support to changelog
1 parent 5553d8f commit 6360747

File tree

14 files changed

+72
-88
lines changed

14 files changed

+72
-88
lines changed

.github/workflows/publish.yml

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Build wheels
5252
env:
5353
CIBW_ARCHS_LINUX: ${{matrix.arch}}
54-
CIBW_BUILD: cp36-* cp37-* cp38-* cp39-*
54+
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-*
5555
CIBW_SKIP: '*-musllinux*'
5656
CIBW_BEFORE_BUILD_LINUX: pip install -r requirements-cython.txt && yum install -y zlib-devel
5757
# On windows and mac we should have z library preinstalled
@@ -74,19 +74,14 @@ jobs:
7474

7575
strategy:
7676
matrix:
77-
python: [3.6, 3.7, 3.8, 3.9]
77+
# 3.10 is excluded because docker's dependency on pywin32==227
78+
python: ["3.7", "3.8", "3.9"]
7879
include:
79-
- python: 3.6
80-
snappy_whl: tools/python_snappy-0.5.4-cp36-cp36m-win_amd64.whl
81-
aiokafka_whl: dist/aiokafka-*-cp36-cp36m-win_amd64.whl
82-
- python: 3.7
83-
snappy_whl: tools/python_snappy-0.5.4-cp37-cp37m-win_amd64.whl
80+
- python: "3.7"
8481
aiokafka_whl: dist/aiokafka-*-cp37-cp37m-win_amd64.whl
85-
- python: 3.8
86-
snappy_whl: tools/python_snappy-0.5.4-cp38-cp38-win_amd64.whl
82+
- python: "3.8"
8783
aiokafka_whl: dist/aiokafka-*-cp38-cp38-win_amd64.whl
88-
- python: 3.9
89-
snappy_whl: tools/python_snappy-0.5.4-cp39-cp39-win_amd64.whl
84+
- python: "3.9"
9085
aiokafka_whl: dist/aiokafka-*-cp39-cp39-win_amd64.whl
9186

9287
steps:
@@ -104,7 +99,6 @@ jobs:
10499
- name: Install python dependencies
105100
run: |
106101
pip install --upgrade pip setuptools wheel
107-
pip install ${{ matrix.snappy_whl }}
108102
pip install -r requirements-win-test.txt
109103
pip install ${{ matrix.aiokafka_whl }}
110104
shell: bash
@@ -122,16 +116,16 @@ jobs:
122116

123117
strategy:
124118
matrix:
125-
python: [3.6, 3.7, 3.8, 3.9]
119+
python: ["3.7", "3.8", "3.9", "3.10"]
126120
include:
127-
- python: 3.6
128-
aiokafka_whl: dist/aiokafka-*-cp36-cp36m-macosx_10_9_x86_64.whl
129-
- python: 3.7
121+
- python: "3.7"
130122
aiokafka_whl: dist/aiokafka-*-cp37-cp37m-macosx_10_9_x86_64.whl
131-
- python: 3.8
123+
- python: "3.8"
132124
aiokafka_whl: dist/aiokafka-*-cp38-cp38-macosx_10_9_x86_64.whl
133-
- python: 3.9
125+
- python: "3.9"
134126
aiokafka_whl: dist/aiokafka-*-cp39-cp39-macosx_10_9_x86_64.whl
127+
- python: "3.10"
128+
aiokafka_whl: dist/aiokafka-*-cp310-cp310-macosx_10_9_x86_64.whl
135129

136130
steps:
137131
- uses: actions/checkout@v2
@@ -166,16 +160,16 @@ jobs:
166160

167161
strategy:
168162
matrix:
169-
python: [3.6, 3.7, 3.8.5, 3.9]
163+
python: ["3.7", "3.8", "3.9", "3.10"]
170164
include:
171-
- python: 3.6
172-
aiokafka_whl: dist/aiokafka-*-cp36-cp36m-manylinux*_x86_64.whl
173-
- python: 3.7
165+
- python: "3.7"
174166
aiokafka_whl: dist/aiokafka-*-cp37-cp37m-manylinux*_x86_64.whl
175-
- python: 3.8.5
167+
- python: "3.8"
176168
aiokafka_whl: dist/aiokafka-*-cp38-cp38-manylinux*_x86_64.whl
177-
- python: 3.9
169+
- python: "3.9"
178170
aiokafka_whl: dist/aiokafka-*-cp39-cp39-manylinux*_x86_64.whl
171+
- python: "3.10"
172+
aiokafka_whl: dist/aiokafka-*-cp310-cp310-manylinux*_x86_64.whl
179173

180174
steps:
181175
- uses: actions/checkout@v2
@@ -200,8 +194,6 @@ jobs:
200194
pip install ${{ matrix.aiokafka_whl }}
201195
202196
- name: Run Unit Tests
203-
# FIXME 3.8.6 and 3.9.0 have broken `wait_for`
204-
if: ${{ matrix.python != '3.9' }}
205197
run: |
206198
# Remove source code to be sure we use wheel code
207199
rm -rf aiokafka
@@ -217,14 +209,14 @@ jobs:
217209
strategy:
218210
matrix:
219211
include:
220-
- pyver: cp36-cp36m
221-
aiokafka_whl: dist/aiokafka-*-cp36-cp36m-manylinux*_aarch64.whl
222212
- pyver: cp37-cp37m
223213
aiokafka_whl: dist/aiokafka-*-cp37-cp37m-manylinux*_aarch64.whl
224214
- pyver: cp38-cp38
225215
aiokafka_whl: dist/aiokafka-*-cp38-cp38-manylinux*_aarch64.whl
226216
- pyver: cp39-cp39
227217
aiokafka_whl: dist/aiokafka-*-cp39-cp39-manylinux*_aarch64.whl
218+
- pyver: cp310-cp310
219+
aiokafka_whl: dist/aiokafka-*-cp310-cp310-manylinux*_aarch64.whl
228220

229221
steps:
230222
- uses: actions/checkout@v2

.github/workflows/tests.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ jobs:
7373

7474
strategy:
7575
matrix:
76-
python: [3.6, 3.7, 3.8, 3.9]
76+
# 3.10 is excluded because docker's dependency on pywin32==227
77+
python: ["3.7", "3.8", "3.9"]
7778

7879
steps:
7980
- uses: actions/checkout@v2
@@ -141,7 +142,7 @@ jobs:
141142

142143
strategy:
143144
matrix:
144-
python: [3.6, 3.7, 3.8, 3.9]
145+
python: ["3.7", "3.8", "3.9", "3.10"]
145146

146147
steps:
147148
- uses: actions/checkout@v2
@@ -214,53 +215,53 @@ jobs:
214215
strategy:
215216
matrix:
216217
include:
217-
- python: 3.9
218+
- python: "3.10"
218219
kafka: "2.8.1"
219220
scala: "2.13"
220221

221222
# Older python versions against latest broker
222-
- python: 3.6
223+
- python: "3.7"
223224
kafka: "2.8.1"
224225
scala: "2.13"
225-
- python: 3.7
226+
- python: "3.8"
226227
kafka: "2.8.1"
227228
scala: "2.13"
228-
- python: 3.8
229+
- python: "3.9"
229230
kafka: "2.8.1"
230231
scala: "2.13"
231232

232-
# Older/newer brokers against latest python version
233-
- python: 3.9
233+
# Older brokers against latest python version
234+
- python: "3.10"
234235
kafka: "0.9.0.1"
235236
scala: "2.11"
236-
- python: 3.9
237+
- python: "3.10"
237238
kafka: "0.10.2.1"
238239
scala: "2.11"
239-
- python: 3.9
240+
- python: "3.10"
240241
kafka: "0.11.0.3"
241242
scala: "2.12"
242-
- python: 3.9
243+
- python: "3.10"
243244
kafka: "1.1.1"
244245
scala: "2.12"
245-
- python: 3.9
246+
- python: "3.10"
246247
kafka: "2.1.1"
247248
scala: "2.12"
248-
- python: 3.9
249+
- python: "3.10"
249250
kafka: "2.2.2"
250251
scala: "2.12"
251-
- python: 3.9
252+
- python: "3.10"
252253
kafka: "2.3.1"
253254
scala: "2.12"
254-
- python: 3.9
255+
- python: "3.10"
255256
kafka: "2.4.1"
256257
scala: "2.12"
257-
- python: 3.9
258+
- python: "3.10"
258259
kafka: "2.5.1"
259260
scala: "2.12"
260-
- python: 3.9
261+
- python: "3.10"
261262
kafka: "2.6.3"
262263
scala: "2.12"
263-
- python: 3.9
264+
- python: "3.10"
264265
kafka: "2.7.2"
265266
scala: "2.13"
266267
fail-fast: false

CHANGES/841.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Drop support for Python 3.6, add support and pre-built packages for Python 3.10
2+
(pr #841)

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ lint:
2727
mypy --install-types --non-interactive $(FORMATTED_AREAS)
2828

2929
test: flake
30-
py.test -s --show-capture=no --docker-image $(DOCKER_IMAGE) $(FLAGS) tests
30+
pytest -s --show-capture=no --docker-image $(DOCKER_IMAGE) $(FLAGS) tests
3131

3232
vtest: flake
33-
py.test -s -v --log-level INFO --docker-image $(DOCKER_IMAGE) $(FLAGS) tests
33+
pytest -s -v --log-level INFO --docker-image $(DOCKER_IMAGE) $(FLAGS) tests
3434

3535
cov cover coverage: flake
36-
py.test -s --cov aiokafka --cov-report html --docker-image $(DOCKER_IMAGE) $(FLAGS) tests
36+
pytest -s --cov aiokafka --cov-report html --docker-image $(DOCKER_IMAGE) $(FLAGS) tests
3737
@echo "open file://`pwd`/htmlcov/index.html"
3838

3939
ci-test-unit:
40-
py.test -s --log-format="%(asctime)s %(levelname)s %(message)s" --log-level DEBUG --cov aiokafka --cov-report xml --color=yes $(FLAGS) tests
40+
pytest -s --log-format="%(asctime)s %(levelname)s %(message)s" --log-level DEBUG --cov aiokafka --cov-report xml --color=yes $(FLAGS) tests
4141

4242
ci-test-all:
43-
py.test -s -v --log-format="%(asctime)s %(levelname)s %(message)s" --log-level DEBUG --cov aiokafka --cov-report xml --color=yes --docker-image $(DOCKER_IMAGE) $(FLAGS) tests
43+
pytest -s -v --log-format="%(asctime)s %(levelname)s %(message)s" --log-level DEBUG --cov aiokafka --cov-report xml --color=yes --docker-image $(DOCKER_IMAGE) $(FLAGS) tests
4444

4545
coverage.xml: .coverage
4646
coverage xml

aiokafka/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
import os
33
from asyncio import AbstractEventLoop
4-
from typing import Awaitable, Dict, Tuple, TypeVar, Union, cast
4+
from typing import Any, Awaitable, Coroutine, Dict, Tuple, TypeVar, Union, cast
55

66
import async_timeout
77
from packaging.version import Version
@@ -21,7 +21,7 @@
2121
T = TypeVar("T")
2222

2323

24-
def create_task(coro: Awaitable[T]) -> "asyncio.Task[T]":
24+
def create_task(coro: Coroutine[Any, Any, T]) -> "asyncio.Task[T]":
2525
loop = get_running_loop()
2626
return loop.create_task(coro)
2727

pytest.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
[pytest]
22
filterwarnings =
33
error
4+
# FIXME Until we fix socket leaks in tests
5+
default:unclosed event loop:ResourceWarning
46
# https://github.com/docker/docker-py/issues/1293
57
ignore:.*docker.sock.*:ResourceWarning
6-
ignore:distutils Version classes are deprecated:DeprecationWarning:docker
8+
ignore:distutils .* deprecated:DeprecationWarning:docker
9+
# From gssapi, but with improper stack
10+
ignore:_SixMetaPathImporter.*not found:ImportWarning
711
# Actually comes from docker importing distutils on Windows
812
ignore:the imp module is deprecated in favour of importlib:DeprecationWarning:pywintypes
913
markers =
1014
ssl: Tests that require SSL certificates to run
15+
asyncio_mode = auto

requirements-ci.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
-r requirements-cython.txt
22
flake8==4.0.1
33
black==22.3.0
4-
mypy==0.910
4+
mypy==0.961
55
isort[colors]==5.10.0
6-
pytest==6.1.2
6+
pytest==7.1.2
77
pytest-cov==3.0.0
8-
pytest-asyncio==0.16.0
8+
pytest-asyncio==0.18.3
99
docker==5.0.3
10+
chardet==4.0.0 # Until fixed requests is released
1011
lz4==3.1.3
1112
xxhash==2.0.2
12-
python-snappy==0.6.0
13+
python-snappy==0.6.1
1314
docutils==0.17.1
1415
Pygments==2.10.0
15-
gssapi==1.7.2
16-
dataclasses==0.8; python_version<"3.7"
17-
async_generator==1.10; python_version<"3.7"
16+
gssapi==1.7.3
1817
async-timeout==4.0.1
1918
zstandard==0.16.0

requirements-cython.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Cython==0.29.24
1+
Cython==0.29.30

requirements-win-test.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
-r requirements-cython.txt
22
flake8==4.0.1
33
black==22.3.0
4-
mypy==0.910
4+
mypy==0.961
55
isort[colors]==5.10.0
6-
pytest==6.1.2
6+
pytest==7.1.2
77
pytest-cov==3.0.0
8-
pytest-asyncio==0.16.0
8+
pytest-asyncio==0.18.3
99
docker==5.0.3
10+
chardet==4.0.0 # Until fixed requests is released
1011
lz4==3.1.3
1112
xxhash==2.0.2
12-
python-snappy==0.6.0
13-
dataclasses==0.8; python_version<"3.7"
14-
async_generator==1.10; python_version<"3.7"
13+
python-snappy==0.6.1
1514
zstandard==0.16.0

setup.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import platform
33
import re
4-
import sys
54

65
from setuptools import Extension, setup
76
from setuptools.command.bdist_rpm import bdist_rpm as _bdist_rpm
@@ -114,15 +113,9 @@ def build_extension(self, ext):
114113
install_requires = [
115114
"async-timeout",
116115
"kafka-python>=2.0.2",
117-
"dataclasses>=0.5; python_version<'3.7'",
118116
"packaging",
119117
]
120118

121-
PY_VER = sys.version_info
122-
123-
if PY_VER < (3, 6):
124-
raise RuntimeError("aiokafka doesn't support Python earlier than 3.6")
125-
126119

127120
def read(f):
128121
return open(os.path.join(os.path.dirname(__file__), f)).read().strip()
@@ -153,10 +146,10 @@ def read_version():
153146
"License :: OSI Approved :: Apache Software License",
154147
"Intended Audience :: Developers",
155148
"Programming Language :: Python :: 3",
156-
"Programming Language :: Python :: 3.6",
157149
"Programming Language :: Python :: 3.7",
158150
"Programming Language :: Python :: 3.8",
159151
"Programming Language :: Python :: 3.9",
152+
"Programming Language :: Python :: 3.10",
160153
"Operating System :: OS Independent",
161154
"Topic :: System :: Networking",
162155
"Topic :: System :: Distributed Computing",
@@ -181,6 +174,7 @@ def read_version():
181174
download_url="https://pypi.python.org/pypi/aiokafka",
182175
license="Apache 2",
183176
packages=["aiokafka"],
177+
python_requires=">=3.7",
184178
install_requires=install_requires,
185179
extras_require=extras_require,
186180
include_package_data=True,

0 commit comments

Comments
 (0)