Skip to content

Commit 1f1670c

Browse files
committed
PYTHON-1974 Drop support for Python 3.4
1 parent 521f7b9 commit 1f1670c

18 files changed

+51
-94
lines changed

.evergreen/build-mac.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rm -rf validdist
88
mkdir -p validdist
99
mv dist/* validdist || true
1010

11-
for VERSION in 3.4 3.5 3.6 3.7 3.8 3.9; do
11+
for VERSION in 3.5 3.6 3.7 3.8 3.9; do
1212
PYTHON=/Library/Frameworks/Python.framework/Versions/$VERSION/bin/python3
1313
rm -rf build
1414

.evergreen/build-manylinux-internal.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mv dist/* validdist || true
1111

1212
# Compile wheels
1313
for PYTHON in /opt/python/*/bin/python; do
14-
if [[ ! $PYTHON =~ (cp34|cp35|cp36|cp37|cp38|cp39) ]]; then
14+
if [[ ! $PYTHON =~ (cp35|cp36|cp37|cp38|cp39) ]]; then
1515
continue
1616
fi
1717
# https://github.com/pypa/manylinux/issues/49

.evergreen/build-manylinux.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ ls dist
2222

2323
# Check for any unexpected files.
2424
unexpected=$(find dist \! \( -iname dist -or \
25-
-iname '*cp34*' -or \
2625
-iname '*cp35*' -or \
2726
-iname '*cp36*' -or \
2827
-iname '*cp37*' -or \

.evergreen/build-windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rm -rf validdist
88
mkdir -p validdist
99
mv dist/* validdist || true
1010

11-
for VERSION in 34 35 36 37 38 39; do
11+
for VERSION in 35 36 37 38 39; do
1212
_pythons=(C:/Python/Python${VERSION}/python.exe \
1313
C:/Python/32/Python${VERSION}/python.exe)
1414
for PYTHON in "${_pythons[@]}"; do

.evergreen/config.yml

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,10 +1582,6 @@ axes:
15821582
display_name: "Archlinux"
15831583
run_on: archlinux-test
15841584
batchtime: 10080 # 7 days
1585-
- id: debian81
1586-
display_name: "Debian 8.1"
1587-
run_on: debian81-test
1588-
batchtime: 10080 # 7 days
15891585
- id: debian92
15901586
display_name: "Debian 9.2"
15911587
run_on: debian92-test
@@ -1607,6 +1603,9 @@ axes:
16071603
batchtime: 10080 # 7 days
16081604
variables:
16091605
libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/rhel-62-64-bit/master/latest/libmongocrypt.tar.gz
1606+
# Note that rhel70 isn't currently used since it doesn't
1607+
# have a system Python 3. We'll switch to rhel70 as our main test
1608+
# system (using /opt/python) in a future change.
16101609
- id: rhel70
16111610
display_name: "RHEL 7.0"
16121611
run_on: rhel70-small
@@ -1623,12 +1622,6 @@ axes:
16231622
batchtime: 10080 # 7 days
16241623
variables:
16251624
libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/rhel72-zseries-test/master/latest/libmongocrypt.tar.gz
1626-
- id: suse12-x86-64-test
1627-
display_name: "SUSE 12 (x86_64)"
1628-
run_on: suse12-sp5-small
1629-
batchtime: 10080 # 7 days
1630-
variables:
1631-
libmongocrypt_url: https://s3.amazonaws.com/mciuploads/libmongocrypt/suse12-64/master/latest/libmongocrypt.tar.gz
16321625
- id: ubuntu-16.04
16331626
display_name: "Ubuntu 16.04"
16341627
run_on: ubuntu1604-test
@@ -1779,10 +1772,6 @@ axes:
17791772
values:
17801773
# Note: always display platform with python-version to avoid ambiguous display names.
17811774
# Linux
1782-
- id: "3.4"
1783-
display_name: "Python 3.4"
1784-
variables:
1785-
PYTHON_BINARY: "/opt/python/3.4/bin/python3"
17861775
- id: "3.5"
17871776
display_name: "Python 3.5"
17881777
batchtime: 10080 # 7 days
@@ -1820,10 +1809,6 @@ axes:
18201809
- id: python-version-windows
18211810
display_name: "Python"
18221811
values:
1823-
- id: "3.4"
1824-
display_name: "Python 3.4"
1825-
variables:
1826-
PYTHON_BINARY: "C:/python/Python34/python.exe"
18271812
- id: "3.5"
18281813
display_name: "Python 3.5"
18291814
variables:
@@ -1848,10 +1833,6 @@ axes:
18481833
- id: python-version-windows-32
18491834
display_name: "Python"
18501835
values:
1851-
- id: "3.4"
1852-
display_name: "32-bit Python 3.4"
1853-
variables:
1854-
PYTHON_BINARY: "C:/python/32/Python34/python.exe"
18551836
- id: "3.5"
18561837
display_name: "32-bit Python 3.5"
18571838
variables:
@@ -2047,7 +2028,6 @@ buildvariants:
20472028
platform:
20482029
# OSes that support versions of MongoDB>=3.2 with SSL.
20492030
- ubuntu-16.04
2050-
- suse12-x86-64-test
20512031
- rhel71-power8-test
20522032
auth-ssl: "*"
20532033
display_name: "${platform} ${auth-ssl}"
@@ -2106,7 +2086,6 @@ buildvariants:
21062086
matrix_spec:
21072087
platform:
21082088
# OSes that support versions of MongoDB>=3.4 <4.2 with SSL.
2109-
- debian81
21102089
- ubuntu1604-power8-test
21112090
- ubuntu1604-arm64-small
21122091
auth-ssl: "*"
@@ -2147,7 +2126,7 @@ buildvariants:
21472126
matrix_spec:
21482127
platform: rhel62
21492128
# RHEL 6.2 does not support Python 3.7.x and later.
2150-
python-version: &rhel62-pythons ["3.4", "3.5", "3.6", "pypy3.5", "pypy3.6"]
2129+
python-version: &rhel62-pythons ["3.5", "3.6", "pypy3.5", "pypy3.6"]
21512130
auth: "*"
21522131
ssl: "*"
21532132
coverage: "*"
@@ -2163,14 +2142,14 @@ buildvariants:
21632142
- matrix_name: "tests-pyopenssl"
21642143
matrix_spec:
21652144
platform: ubuntu-16.04
2166-
python-version: ["3.4", "3.5", "3.6", "3.7", "3.8", "3.9"]
2145+
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9"]
21672146
auth: "*"
21682147
ssl: "ssl"
21692148
pyopenssl: "*"
21702149
# Only test "noauth" with Python 3.7.
21712150
exclude_spec:
21722151
platform: ubuntu-16.04
2173-
python-version: ["3.4", "3.5", "3.6", "3.8", "3.9"]
2152+
python-version: ["3.5", "3.6", "3.8", "3.9"]
21742153
auth: "noauth"
21752154
ssl: "ssl"
21762155
pyopenssl: "*"
@@ -2218,7 +2197,7 @@ buildvariants:
22182197
matrix_spec:
22192198
platform: rhel62
22202199
# RHEL 6.2 does not support Python 3.7.x and later.
2221-
python-version: ["3.4", "3.5", "3.6"]
2200+
python-version: ["3.5", "3.6"]
22222201
auth-ssl: noauth-nossl
22232202
# TODO: dependency error for 'coverage-report' task:
22242203
# dependency tests-python-version-rhel62-test-encryption_.../test-2.6-standalone is not present in the project config
@@ -2273,7 +2252,7 @@ buildvariants:
22732252
matrix_spec:
22742253
# Ubuntu 16.04 images have libsnappy-dev installed, and provides OpenSSL 1.0.2 for testing Python 3.7
22752254
platform: ubuntu-16.04
2276-
python-version: ["3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "pypy3.5", "pypy3.6"]
2255+
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "pypy3.5", "pypy3.6"]
22772256
c-extensions: "*"
22782257
compression: "*"
22792258
exclude_spec:
@@ -2450,7 +2429,13 @@ buildvariants:
24502429
- matrix_name: "tests-mod-wsgi"
24512430
matrix_spec:
24522431
platform: rhel62
2453-
python-version: ["3.4", "3.6"]
2432+
# The toolchain doesn't currently include mod-wsgi
2433+
# built for CPython 3.5 or 3.8, mod-wsgi doesn't yet
2434+
# claim to support 3.9. Python 3.7+ won't build on rhel6
2435+
# and we need to do some work to migrate mod-wsgi testing
2436+
# to a different OS. For now we're stuck just testing with
2437+
# Python 3.6.
2438+
python-version: ["3.6"]
24542439
mod-wsgi-version: "*"
24552440
display_name: "${mod-wsgi-version} ${python-version} ${platform}"
24562441
tasks:
@@ -2468,7 +2453,7 @@ buildvariants:
24682453
- matrix_name: "tests-doctests"
24692454
matrix_spec:
24702455
platform: rhel62
2471-
python-version: ["3.4"]
2456+
python-version: ["3.5"]
24722457
display_name: "Doctests ${python-version} ${platform}"
24732458
tasks:
24742459
- name: "doctests"
@@ -2510,7 +2495,7 @@ buildvariants:
25102495
- matrix_name: "data-lake-spec-tests"
25112496
matrix_spec:
25122497
platform: ubuntu-16.04
2513-
python-version: ["3.4", "3.8"]
2498+
python-version: ["3.5", "3.9"]
25142499
auth: "auth"
25152500
c-extensions: "*"
25162501
display_name: "Atlas Data Lake ${python-version} ${c-extensions}"
@@ -2532,7 +2517,7 @@ buildvariants:
25322517
- matrix_name: "ocsp-test"
25332518
matrix_spec:
25342519
platform: ubuntu-16.04
2535-
python-version: ["3.4", "3.8", "3.9"]
2520+
python-version: ["3.5", "3.8", "3.9"]
25362521
mongodb-version: ["4.4", "latest"]
25372522
auth: "noauth"
25382523
ssl: "ssl"
@@ -2556,7 +2541,7 @@ buildvariants:
25562541
- matrix_name: "ocsp-test-windows"
25572542
matrix_spec:
25582543
platform: windows-64-vsMulti-small
2559-
python-version-windows: ["3.4", "3.9"]
2544+
python-version-windows: ["3.5", "3.9"]
25602545
mongodb-version: ["4.4", "latest"]
25612546
auth: "noauth"
25622547
ssl: "ssl"
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
# cffi==1.14.3 was the last installable release on RHEL 6.2 with Python 3.4
2-
cffi==1.14.3;python_version=="3.4"
3-
cffi>=1.12.0,<2;python_version!="3.4"
1+
cffi>=1.12.0,<2
42
cryptography>=2,<4

.evergreen/utils.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ createvirtualenv () {
2525
# Upgrade to the latest versions of pip setuptools wheel so that
2626
# pip can always download the latest cryptography+cffi wheels.
2727
PYTHON_VERSION=$(python -c 'import sys;print("%s.%s" % sys.version_info[:2])')
28-
if [[ $PYTHON_VERSION == "3.4" ]]; then
29-
# pip 19.2 dropped support for Python 3.4.
30-
python -m pip install --upgrade 'pip<19.2'
31-
elif [[ $PYTHON_VERSION == "3.5" ]]; then
28+
if [[ $PYTHON_VERSION == "3.5" ]]; then
3229
# pip 21 will drop support for 3.5.
3330
python -m pip install --upgrade 'pip<21'
3431
else

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: python
22

33
python:
4-
- 3.4
54
- 3.5
65
- 3.6
76
- 3.7

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ that might not be of interest or that has already been addressed.
1919
Supported Interpreters
2020
----------------------
2121

22-
PyMongo supports CPython 3.4+ and PyPy3.5+. Language
22+
PyMongo supports CPython 3.5+ and PyPy3.5+. Language
2323
features not supported by all interpreters can not be used.
2424

2525
Style Guide

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ is incompatible with PyMongo.
8989
Dependencies
9090
============
9191

92-
PyMongo supports CPython 3.4+ and PyPy3.5+.
92+
PyMongo supports CPython 3.5+ and PyPy3.5+.
9393

9494
Optional dependencies:
9595

doc/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ they are returned to the pool.
134134
Does PyMongo support Python 3?
135135
------------------------------
136136

137-
PyMongo supports CPython 3.4+ and PyPy3.5+. See the :doc:`python3` for details.
137+
PyMongo supports CPython 3.5+ and PyPy3.5+. See the :doc:`python3` for details.
138138

139139
Does PyMongo support asynchronous frameworks like Gevent, asyncio, Tornado, or Twisted?
140140
---------------------------------------------------------------------------------------

doc/installation.rst

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To upgrade using pip::
2828
Dependencies
2929
------------
3030

31-
PyMongo supports CPython 3.4+ and PyPy3.5+.
31+
PyMongo supports CPython 3.5+ and PyPy3.5+.
3232

3333
Optional dependencies:
3434

@@ -133,7 +133,7 @@ See `http://bugs.python.org/issue11623 <http://bugs.python.org/issue11623>`_
133133
for a more detailed explanation.
134134

135135
**Lion (10.7) and newer** - PyMongo's C extensions can be built against
136-
versions of Python 3.4+ downloaded from python.org. In all cases Xcode must be
136+
versions of Python 3.5+ downloaded from python.org. In all cases Xcode must be
137137
installed with 'UNIX Development Support'.
138138

139139
**Xcode 5.1**: Starting with version 5.1 the version of clang that ships with
@@ -163,20 +163,10 @@ Installing from source on Windows
163163
If you want to install PyMongo with C extensions from source the following
164164
requirements apply to both CPython and ActiveState's ActivePython:
165165

166-
64-bit Windows
167-
~~~~~~~~~~~~~~
166+
Windows
167+
~~~~~~~
168168

169-
For Python 3.5 and newer install Visual Studio 2015. For Python 3.4
170-
install Visual Studio 2010. You must use the full version of Visual Studio
171-
2010 as Visual C++ Express does not provide 64-bit compilers. Make sure that
172-
you check the "x64 Compilers and Tools" option under Visual C++.
173-
174-
32-bit Windows
175-
~~~~~~~~~~~~~~
176-
177-
For Python 3.5 and newer install Visual Studio 2015.
178-
179-
For Python 3.4 install Visual C++ 2010 Express.
169+
Install Visual Studio 2015+.
180170

181171
.. _install-no-c:
182172

doc/python3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Python 3 FAQ
66
What Python 3 versions are supported?
77
-------------------------------------
88

9-
PyMongo supports CPython 3.4+ and PyPy3.5+.
9+
PyMongo supports CPython 3.5+ and PyPy3.5+.
1010

1111
Are there any PyMongo behavior changes with Python 3?
1212
-----------------------------------------------------

pymongo/pool.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,13 @@ def _set_keepalive_times(sock):
151151
])
152152

153153
if sys.platform.startswith('linux'):
154-
# platform.linux_distribution was deprecated in Python 3.5.
155-
if sys.version_info[:2] < (3, 5):
156-
# Distro name and version (e.g. Ubuntu 16.04 xenial)
157-
_name = ' '.join([part for part in
158-
platform.linux_distribution() if part])
159-
else:
160-
_name = platform.system()
154+
# platform.linux_distribution was deprecated in Python 3.5
155+
# and removed in Python 3.8. Starting in Python 3.5 it
156+
# raises DeprecationWarning
157+
# DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5
158+
_name = platform.system()
161159
_METADATA['os'] = SON([
162-
('type', platform.system()),
160+
('type', _name),
163161
('name', _name),
164162
('architecture', platform.machine()),
165163
# Kernel version (e.g. 4.4.0-17-generic).

pymongo/ssl_support.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,13 @@ def get_ssl_context(*args):
132132
if _ssl.IS_PYOPENSSL:
133133
raise ConfigurationError(
134134
"ssl_crlfile cannot be used with PyOpenSSL")
135-
if not hasattr(ctx, "verify_flags"):
136-
raise ConfigurationError(
137-
"Support for ssl_crlfile requires "
138-
"python 2.7.9+ (pypy 2.5.1+) or 3.4+")
139135
# Match the server's behavior.
140136
ctx.verify_flags = getattr(_ssl, "VERIFY_CRL_CHECK_LEAF", 0)
141137
ctx.load_verify_locations(crlfile)
142138
if ca_certs is not None:
143139
ctx.load_verify_locations(ca_certs)
144140
elif cert_reqs != CERT_NONE:
145-
# CPython 3.4+ ssl module only, doesn't exist in PyOpenSSL
141+
# CPython ssl module only, doesn't exist in PyOpenSSL
146142
if hasattr(ctx, "load_default_certs"):
147143
ctx.load_default_certs()
148144
# Always useless on Windows.

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import warnings
66

77

8-
if sys.version_info[:2] < (3, 4):
9-
raise RuntimeError("Python version >= 3.4 required.")
8+
if sys.version_info[:2] < (3, 5):
9+
raise RuntimeError("Python version >= 3.5 required.")
1010

1111

1212
# Hack to silence atexit traceback in some Python versions
@@ -322,7 +322,7 @@ def build_extension(self, ext):
322322
keywords=["mongo", "mongodb", "pymongo", "gridfs", "bson"],
323323
install_requires=[],
324324
license="Apache License, Version 2.0",
325-
python_requires=">=3.4",
325+
python_requires=">=3.5",
326326
classifiers=[
327327
"Development Status :: 5 - Production/Stable",
328328
"Intended Audience :: Developers",
@@ -331,7 +331,7 @@ def build_extension(self, ext):
331331
"Operating System :: Microsoft :: Windows",
332332
"Operating System :: POSIX",
333333
"Programming Language :: Python :: 3",
334-
"Programming Language :: Python :: 3.4",
334+
"Programming Language :: Python :: 3 :: Only",
335335
"Programming Language :: Python :: 3.5",
336336
"Programming Language :: Python :: 3.6",
337337
"Programming Language :: Python :: 3.7",

0 commit comments

Comments
 (0)