Skip to content

Commit a35883d

Browse files
authored
support python 3.10 (#20)
1 parent 7520f3b commit a35883d

6 files changed

Lines changed: 31 additions & 16 deletions

File tree

.github/workflows/actions.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
matrix:
99
os: [ ubuntu-latest, macos-latest ]
10-
python-version: [3.6, 3.7, 3.8, 3.9]
10+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
1111
tarantool: ['1.10', '2.7']
1212
exclude:
1313
- os: macos-latest
@@ -40,7 +40,7 @@ jobs:
4040
python -m pip install -r requirements.txt
4141
- name: Run tests
4242
run: |
43-
if [[ "$RUNNER_OS" == "Linux" && ${{ matrix.python-version }} == "3.9" && ${{ matrix.tarantool }} == "2.7" ]]; then
43+
if [[ "$RUNNER_OS" == "Linux" && ${{ matrix.python-version }} == "3.10" && ${{ matrix.tarantool }} == "2.7" ]]; then
4444
make && make test
4545
make clean && make debug && make test PYTHON='coverage run'
4646
# coveralls
@@ -73,7 +73,7 @@ jobs:
7373
- name: Build wheels
7474
run: python -m cibuildwheel --output-dir wheelhouse
7575
env:
76-
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-*"
76+
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-*"
7777

7878
- uses: actions/upload-artifact@v2
7979
with:
@@ -97,7 +97,7 @@ jobs:
9797
- name: Set up Python
9898
uses: actions/setup-python@v2
9999
with:
100-
python-version: 3.9
100+
python-version: '3.10'
101101

102102
- name: Install dependencies
103103
run: |
@@ -139,7 +139,7 @@ jobs:
139139
- name: Set up Python
140140
uses: actions/setup-python@v2
141141
with:
142-
python-version: 3.9
142+
python-version: '3.10'
143143

144144
- name: Install dependencies
145145
run: |

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v.1.2.3
2+
* Support Python 3.10
3+
14
## v.1.2.2
25
**Bugs fixed:**
36
* Show a diag message rather than Lost connection to Tarantool when disconnected (closes #19)

asynctnt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
Iterator, Response, TarantoolTuple, PushIterator
44
)
55

6-
__version__ = '1.2.2'
6+
__version__ = '1.2.3'

asynctnt/iproto/coreproto.pyx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
cimport cpython
22
cimport cpython.dict
3+
cimport cpython.bytes
4+
cimport cpython.bytearray
35

46
from cpython.ref cimport PyObject
57

@@ -71,19 +73,26 @@ cdef class CoreProtocol:
7173
ssize_t data_len
7274
ssize_t buf_len
7375

74-
if not cpython.PyBytes_CheckExact(data):
75-
raise BufferError('_on_data_received: expected bytes object')
76-
7776
data_str = NULL
7877
data_len = 0
79-
cpython.bytes.PyBytes_AsStringAndSize(<bytes>data,
80-
&data_str,
81-
&data_len)
78+
79+
if cpython.PyBytes_CheckExact(data):
80+
cpython.bytes.PyBytes_AsStringAndSize(<bytes> data,
81+
&data_str,
82+
&data_len)
83+
self.rbuf.extend(data_str, data_len)
84+
elif cpython.bytearray.PyByteArray_CheckExact(data):
85+
data_len = cpython.bytearray.PyByteArray_Size(<bytearray> data)
86+
self.rbuf.extend(cpython.bytearray.PyByteArray_AsString(<bytearray> data), data_len)
87+
else:
88+
raise BufferError(
89+
'_on_data_received: expected bytes or bytearray object, got {}'.format(
90+
type(data),
91+
))
92+
8293
if data_len == 0:
8394
return
8495

85-
self.rbuf.extend(data_str, data_len)
86-
8796
if self.state == PROTOCOL_GREETING:
8897
if self.rbuf.use < IPROTO_GREETING_SIZE:
8998
# not enough for greeting

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PyYAML>=5.0
22
uvloop>=0.12.0
3-
Cython==0.29.21
3+
Cython==0.29.24
44
pep8==1.7.1
55
flake8==3.7.9
66
twine

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def find_version():
2525
r"""__version__\s*=\s*(['"])([^'"]+)\1""", line).group(2)
2626

2727

28-
CYTHON_VERSION = '0.29.21'
28+
CYTHON_VERSION = '0.29.24'
2929

3030

3131
class build_ext(_build_ext.build_ext):
@@ -129,6 +129,9 @@ def finalize_options(self):
129129
"Programming Language :: Python :: 3.5",
130130
"Programming Language :: Python :: 3.6",
131131
"Programming Language :: Python :: 3.7",
132+
"Programming Language :: Python :: 3.8",
133+
"Programming Language :: Python :: 3.9",
134+
"Programming Language :: Python :: 3.10",
132135
'Programming Language :: Python :: Implementation :: CPython',
133136
"Intended Audience :: Developers",
134137
"License :: OSI Approved :: Apache Software License",

0 commit comments

Comments
 (0)