Skip to content

Commit f097a0c

Browse files
python: drop Python 2 support
Python 2.7 reached the end of its life on January 1st, 2020 [1]. Since it would be a waste to ignore several Python 3.x features in master discovery implementation, we decided to drop Python 2 support here. Python 2 workaround cleanup activities are expected to be solved as part of #212 solution. 1. https://www.python.org/doc/sunset-python-2/ Part of #196
1 parent 9343e83 commit f097a0c

File tree

5 files changed

+4
-16
lines changed

5 files changed

+4
-16
lines changed

.github/workflows/testing.yml

-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
- '2.8'
2525
- '2.x-latest'
2626
python:
27-
- '2.7'
2827
- '3.5'
2928
- '3.6'
3029
- '3.7'
@@ -116,7 +115,6 @@ jobs:
116115
- '1.10'
117116
- '2.8'
118117
python:
119-
- '2.7'
120118
- '3.10'
121119

122120
steps:

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
(PR #192).
1212

1313
### Changed
14+
- **Breaking**: drop Python 2 support (PR #207).
1415
- **Breaking**: change binary types encode/decode for Python 3
1516
to support working with varbinary (PR #211, #105).
1617
With Python 2 the behavior of the connector remains the same.

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,6 @@ def find_version(*file_paths):
8484
command_options=command_options,
8585
install_requires=[
8686
'msgpack>=0.4.0',
87-
]
87+
],
88+
python_requires='>=3',
8889
)

test/suites/lib/skip.py

-9
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,3 @@ def skip_or_run_varbinary_test(func):
8080
return skip_or_run_test_tarantool(func, '2.2.1',
8181
'does not support VARBINARY type')
8282

83-
84-
def skip_or_run_mp_bin_test(func):
85-
"""Decorator to skip or run mp_bin-related tests depending on
86-
the Python version.
87-
88-
Python 2 connector do not support mp_bin.
89-
"""
90-
91-
return skip_or_run_test_python_major(func, 3, 'does not support mp_bin')

test/suites/test_encoding.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import unittest
77
import tarantool
88

9-
from .lib.skip import skip_or_run_mp_bin_test, skip_or_run_varbinary_test
9+
from .lib.skip import skip_or_run_varbinary_test
1010
from .lib.tarantool_server import TarantoolServer
1111

1212
class TestSuite_Encoding(unittest.TestCase):
@@ -99,7 +99,6 @@ def test_01_02_string_decode_for_encoding_utf8_behavior(self):
9999
resp = self.con_encoding_utf8.eval("return box.space['%s']:get('%s')" % (space, data))
100100
self.assertSequenceEqual(resp, [[data]])
101101

102-
@skip_or_run_mp_bin_test
103102
@skip_or_run_varbinary_test
104103
def test_01_03_bytes_encode_for_encoding_utf8_behavior(self):
105104
data_id = 103
@@ -111,7 +110,6 @@ def test_01_03_bytes_encode_for_encoding_utf8_behavior(self):
111110
resp = self.con_encoding_utf8.select(space, [ data ], index='varbin')
112111
self.assertSequenceEqual(resp, [[data_id, data]])
113112

114-
@skip_or_run_mp_bin_test
115113
@skip_or_run_varbinary_test
116114
def test_01_04_varbinary_decode_for_encoding_utf8_behavior(self):
117115
data_id = 104
@@ -162,7 +160,6 @@ def test_02_03_bytes_encode_for_encoding_none_behavior(self):
162160
resp = self.con_encoding_none.select(space, [data])
163161
self.assertSequenceEqual(resp, [[data]])
164162

165-
@skip_or_run_mp_bin_test
166163
@skip_or_run_varbinary_test
167164
def test_02_04_varbinary_decode_for_encoding_none_behavior(self):
168165
data_id = 204

0 commit comments

Comments
 (0)