Skip to content

Commit 1ae7cb6

Browse files
jlainealex
authored andcommitted
Raise minimum cryptography version to 2.2.1, drop python 2.6 (pyca#742)
1 parent 993c4e4 commit 1ae7cb6

File tree

8 files changed

+13
-47
lines changed

8 files changed

+13
-47
lines changed

.travis.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ matrix:
2020
os: osx
2121
osx_image: xcode8.3
2222
env: TOXENV=py27 OPENSSL=1.1.0
23-
- python: "2.6" # these are just to make travis's UI a bit prettier
24-
env: TOXENV=py26
25-
- python: "2.7"
23+
- python: "2.7" # these are just to make travis's UI a bit prettier
2624
env: TOXENV=py27
2725
- python: "3.4"
2826
env: TOXENV=py34
@@ -33,8 +31,6 @@ matrix:
3331
- env: TOXENV=pypy
3432

3533
# Also run the tests against cryptography master.
36-
- python: "2.6"
37-
env: TOXENV=py26-cryptographyMaster
3834
- python: "2.7"
3935
env: TOXENV=py27-cryptographyMaster
4036
- python: "3.4"
@@ -46,8 +42,6 @@ matrix:
4642
- env: TOXENV=pypy-cryptographyMaster
4743

4844
# And current minimum cryptography version.
49-
- python: "2.6"
50-
env: TOXENV=py26-cryptographyMinimum
5145
- python: "2.7"
5246
env: TOXENV=py27-cryptographyMinimum
5347
- python: "3.4"
@@ -82,7 +76,6 @@ matrix:
8276
# Let the cryptography master builds fail because they might be caused by
8377
# cryptography changes that are beyond our control.
8478
allow_failures:
85-
- env: TOXENV=py26-cryptographyMaster
8679
- env: TOXENV=py27-cryptographyMaster
8780
- env: TOXENV=py34-cryptographyMaster
8881
- env: TOXENV=py35-cryptographyMaster

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ The third digit is only for regressions.
1111
Backward-incompatible changes:
1212
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1313

14-
*none*
14+
* The minimum ``cryptography`` version is now 2.2.1.
15+
* Support for Python 2.6 has been dropped.
1516

1617

1718
Deprecations:

doc/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Other OpenSSL wrappers for Python at the time were also limited, though in diffe
1414
Later it was maintained by `Jean-Paul Calderone`_ who among other things managed to make pyOpenSSL a pure Python project which the current maintainers are *very* grateful for.
1515

1616
Over the time the standard library's ``ssl`` module improved, never reaching the completeness of pyOpenSSL's API coverage.
17-
Despite `PEP 466`_ many useful features remain Python 3-only and pyOpenSSL remains the only alternative for full-featured TLS code across all noteworthy Python versions from 2.6 through 3.5 and PyPy_.
17+
Despite `PEP 466`_ many useful features remain Python 3-only and pyOpenSSL remains the only alternative for full-featured TLS code across all noteworthy Python versions from 2.7 through 3.5 and PyPy_.
1818

1919

2020
Development

setup.cfg

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ minversion = 3.0.1
33
strict = true
44
testpaths = tests
55

6-
[sdist]
7-
# Forcibly regenerate the manifest on Python 2.6. This is default behavior on
8-
# 2.7+ making this option deprecated. This should be removed once we drop 2.6.
9-
force_manifest = 1
10-
116
[bdist_wheel]
127
# We are a pure-Python project so a single wheel is enough.
138
universal = 1

setup.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def find_meta(meta):
7777
'Operating System :: POSIX',
7878

7979
'Programming Language :: Python :: 2',
80-
'Programming Language :: Python :: 2.6',
8180
'Programming Language :: Python :: 2.7',
8281
'Programming Language :: Python :: 3',
8382
'Programming Language :: Python :: 3.4',
@@ -95,16 +94,14 @@ def find_meta(meta):
9594
package_dir={"": "src"},
9695
install_requires=[
9796
# Fix cryptographyMinimum in tox.ini when changing this!
98-
"cryptography>=2.1.4",
97+
"cryptography>=2.2.1",
9998
"six>=1.5.2"
10099
],
101100
extras_require={
102101
"test": [
103102
"flaky",
104103
"pretend",
105-
# pytest 3.3 doesn't support Python 2.6 anymore.
106-
# Remove this pin once we drop Python 2.6 too.
107-
"pytest>=3.0.1,<3.3.0",
104+
"pytest>=3.0.1",
108105
],
109106
"docs": [
110107
"sphinx",

src/OpenSSL/SSL.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,6 @@
112112
'Connection'
113113
]
114114

115-
try:
116-
_memoryview = memoryview
117-
except NameError:
118-
class _memoryview(object):
119-
pass
120-
121115
try:
122116
_buffer = buffer
123117
except NameError:
@@ -1702,7 +1696,7 @@ def send(self, buf, flags=0):
17021696
# Backward compatibility
17031697
buf = _text_to_bytes_and_warn("buf", buf)
17041698

1705-
if isinstance(buf, _memoryview):
1699+
if isinstance(buf, memoryview):
17061700
buf = buf.tobytes()
17071701
if isinstance(buf, _buffer):
17081702
buf = str(buf)
@@ -1729,7 +1723,7 @@ def sendall(self, buf, flags=0):
17291723
"""
17301724
buf = _text_to_bytes_and_warn("buf", buf)
17311725

1732-
if isinstance(buf, _memoryview):
1726+
if isinstance(buf, memoryview):
17331727
buf = buf.tobytes()
17341728
if isinstance(buf, _buffer):
17351729
buf = str(buf)
@@ -1802,12 +1796,8 @@ def recv_into(self, buffer, nbytes=None, flags=None):
18021796
# This strange line is all to avoid a memory copy. The buffer protocol
18031797
# should allow us to assign a CFFI buffer to the LHS of this line, but
18041798
# on CPython 3.3+ that segfaults. As a workaround, we can temporarily
1805-
# wrap it in a memoryview, except on Python 2.6 which doesn't have a
1806-
# memoryview type.
1807-
try:
1808-
buffer[:result] = memoryview(_ffi.buffer(buf, result))
1809-
except NameError:
1810-
buffer[:result] = _ffi.buffer(buf, result)
1799+
# wrap it in a memoryview.
1800+
buffer[:result] = memoryview(_ffi.buffer(buf, result))
18111801

18121802
return result
18131803

tests/test_ssl.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from gc import collect, get_referrers
1313
from errno import ECONNREFUSED, EINPROGRESS, EWOULDBLOCK, EPIPE, ESHUTDOWN
14-
from sys import platform, getfilesystemencoding, version_info
14+
from sys import platform, getfilesystemencoding
1515
from socket import MSG_PEEK, SHUT_RDWR, error, socket
1616
from os import makedirs
1717
from os.path import join
@@ -99,10 +99,6 @@
9999

100100

101101
skip_if_py3 = pytest.mark.skipif(PY3, reason="Python 2 only")
102-
skip_if_py26 = pytest.mark.skipif(
103-
version_info[0:2] == (2, 6),
104-
reason="Python 2.7 and later only"
105-
)
106102

107103

108104
def join_bytes_or_unicode(prefix, suffix):
@@ -2867,7 +2863,6 @@ def test_text(self):
28672863
assert count == 2
28682864
assert client.recv(2) == b'xy'
28692865

2870-
@skip_if_py26
28712866
def test_short_memoryview(self):
28722867
"""
28732868
When passed a memoryview onto a small number of bytes,
@@ -3004,15 +2999,13 @@ def test_peek(self):
30042999
assert client.recv_into(output_buffer, flags=MSG_PEEK) == 2
30053000
assert output_buffer == bytearray(b'xy\x00\x00\x00')
30063001

3007-
@skip_if_py26
30083002
def test_memoryview_no_length(self):
30093003
"""
30103004
`Connection.recv_into` can be passed a `memoryview` instance and data
30113005
in the receive buffer is written to it.
30123006
"""
30133007
self._no_length_test(_make_memoryview)
30143008

3015-
@skip_if_py26
30163009
def test_memoryview_respects_length(self):
30173010
"""
30183011
When called with a `memoryview` instance, `Connection.recv_into`
@@ -3021,7 +3014,6 @@ def test_memoryview_respects_length(self):
30213014
"""
30223015
self._respects_length_test(_make_memoryview)
30233016

3024-
@skip_if_py26
30253017
def test_memoryview_doesnt_overfill(self):
30263018
"""
30273019
When called with a `memoryview` instance, `Connection.recv_into`
@@ -3030,7 +3022,6 @@ def test_memoryview_doesnt_overfill(self):
30303022
"""
30313023
self._doesnt_overfill_test(_make_memoryview)
30323024

3033-
@skip_if_py26
30343025
def test_memoryview_really_doesnt_overfill(self):
30353026
"""
30363027
When called with a `memoryview` instance and an `nbytes` value that is
@@ -3078,7 +3069,6 @@ def test_text(self):
30783069
) == str(w[-1].message))
30793070
assert client.recv(1) == b"x"
30803071

3081-
@skip_if_py26
30823072
def test_short_memoryview(self):
30833073
"""
30843074
When passed a memoryview onto a small number of bytes,

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = {pypy,py26,py27,py34,py35,py36}{,-cryptographyMaster,-cryptographyMinimum},py27-twistedMaster,pypi-readme,check-manifest,flake8,docs,coverage-report
2+
envlist = {pypy,py27,py34,py35,py36}{,-cryptographyMaster,-cryptographyMinimum},py27-twistedMaster,pypi-readme,check-manifest,flake8,docs,coverage-report
33

44
[testenv]
55
whitelist_externals =
@@ -10,7 +10,7 @@ extras =
1010
deps =
1111
coverage>=4.2
1212
cryptographyMaster: git+https://github.com/pyca/cryptography.git
13-
cryptographyMinimum: cryptography==2.1.4
13+
cryptographyMinimum: cryptography==2.2.1
1414
setenv =
1515
# Do not allow the executing environment to pollute the test environment
1616
# with extra packages.

0 commit comments

Comments
 (0)