Skip to content

Commit

Permalink
PYTHON-2386 Drop support for Python 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
behackett committed Feb 4, 2021
1 parent 0217ba3 commit 9138603
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .evergreen/build-mac.sh
Expand Up @@ -8,7 +8,7 @@ rm -rf validdist
mkdir -p validdist
mv dist/* validdist || true

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

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/build-manylinux-internal.sh
Expand Up @@ -11,7 +11,7 @@ mv dist/* validdist || true

# Compile wheels
for PYTHON in /opt/python/*/bin/python; do
if [[ ! $PYTHON =~ (cp35|cp36|cp37|cp38|cp39) ]]; then
if [[ ! $PYTHON =~ (cp36|cp37|cp38|cp39) ]]; then
continue
fi
# https://github.com/pypa/manylinux/issues/49
Expand Down
1 change: 0 additions & 1 deletion .evergreen/build-manylinux.sh
Expand Up @@ -19,7 +19,6 @@ ls dist

# Check for any unexpected files.
unexpected=$(find dist \! \( -iname dist -or \
-iname '*cp35*' -or \
-iname '*cp36*' -or \
-iname '*cp37*' -or \
-iname '*cp38*' -or \
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/build-windows.sh
Expand Up @@ -8,7 +8,7 @@ rm -rf validdist
mkdir -p validdist
mv dist/* validdist || true

for VERSION in 35 36 37 38 39; do
for VERSION in 36 37 38 39; do
_pythons=(C:/Python/Python${VERSION}/python.exe \
C:/Python/32/Python${VERSION}/python.exe)
for PYTHON in "${_pythons[@]}"; do
Expand Down
49 changes: 16 additions & 33 deletions .evergreen/config.yml
Expand Up @@ -1762,11 +1762,6 @@ axes:
values:
# Note: always display platform with python-version to avoid ambiguous display names.
# Linux
- id: "3.5"
display_name: "Python 3.5"
batchtime: 10080 # 7 days
variables:
PYTHON_BINARY: "/opt/python/3.5/bin/python3"
- id: "3.6"
display_name: "Python 3.6"
variables:
Expand All @@ -1783,10 +1778,6 @@ axes:
display_name: "Python 3.9"
variables:
PYTHON_BINARY: "/opt/python/3.9/bin/python3"
- id: "pypy3.5"
display_name: "PyPy 3.5"
variables:
PYTHON_BINARY: "/opt/python/pypy3.5/bin/pypy3"
- id: "pypy3.6"
display_name: "PyPy 3.6"
variables:
Expand All @@ -1799,10 +1790,6 @@ axes:
- id: python-version-windows
display_name: "Python"
values:
- id: "3.5"
display_name: "Python 3.5"
variables:
PYTHON_BINARY: "C:/python/Python35/python.exe"
- id: "3.6"
display_name: "Python 3.6"
variables:
Expand All @@ -1823,10 +1810,6 @@ axes:
- id: python-version-windows-32
display_name: "Python"
values:
- id: "3.5"
display_name: "32-bit Python 3.5"
variables:
PYTHON_BINARY: "C:/python/32/Python35/python.exe"
- id: "3.6"
display_name: "32-bit Python 3.6"
variables:
Expand Down Expand Up @@ -2116,7 +2099,7 @@ buildvariants:
matrix_spec:
platform: rhel62
# RHEL 6.2 does not support Python 3.7.x and later.
python-version: &rhel62-pythons ["3.5", "3.6", "pypy3.5", "pypy3.6"]
python-version: &rhel62-pythons ["3.6", "pypy3.6"]
auth: "*"
ssl: "*"
coverage: "*"
Expand All @@ -2132,14 +2115,14 @@ buildvariants:
- matrix_name: "tests-pyopenssl"
matrix_spec:
platform: ubuntu-16.04
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9"]
python-version: ["3.6", "3.7", "3.8", "3.9"]
auth: "*"
ssl: "ssl"
pyopenssl: "*"
# Only test "noauth" with Python 3.7.
exclude_spec:
platform: ubuntu-16.04
python-version: ["3.5", "3.6", "3.8", "3.9"]
python-version: ["3.6", "3.8", "3.9"]
auth: "noauth"
ssl: "ssl"
pyopenssl: "*"
Expand All @@ -2152,7 +2135,7 @@ buildvariants:
- matrix_name: "tests-pyopenssl-pypy"
matrix_spec:
platform: debian92
python-version: ["pypy3.5", "pypy3.6"]
python-version: ["pypy3.6"]
auth: "auth"
ssl: "ssl"
pyopenssl: "*"
Expand Down Expand Up @@ -2187,7 +2170,7 @@ buildvariants:
matrix_spec:
platform: rhel62
# RHEL 6.2 does not support Python 3.7.x and later.
python-version: ["3.5", "3.6"]
python-version: ["3.6"]
auth-ssl: noauth-nossl
# TODO: dependency error for 'coverage-report' task:
# dependency tests-python-version-rhel62-test-encryption_.../test-2.6-standalone is not present in the project config
Expand All @@ -2199,7 +2182,7 @@ buildvariants:
- matrix_name: "tests-pypy-debian-test-encryption"
matrix_spec:
platform: debian92
python-version: ["pypy3.5", "pypy3.6"]
python-version: ["pypy3.6"]
auth-ssl: noauth-nossl
encryption: "*"
display_name: "Encryption ${python-version} ${platform} ${auth-ssl}"
Expand All @@ -2215,7 +2198,7 @@ buildvariants:
exclude_spec:
# These interpreters are always tested without extensions.
- platform: rhel62
python-version: ["pypy3.5", "pypy3.6"]
python-version: ["pypy3.6"]
c-extensions: "*"
auth-ssl: "*"
coverage: "*"
Expand All @@ -2242,13 +2225,13 @@ buildvariants:
matrix_spec:
# Ubuntu 16.04 images have libsnappy-dev installed, and provides OpenSSL 1.0.2 for testing Python 3.7
platform: ubuntu-16.04
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "pypy3.5", "pypy3.6"]
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3.6"]
c-extensions: "*"
compression: "*"
exclude_spec:
# These interpreters are always tested without extensions.
- platform: ubuntu-16.04
python-version: ["pypy3.5", "pypy3.6"]
python-version: ["pypy3.6"]
c-extensions: "with-c-extensions"
compression: "*"
# PYTHON-2365 Some tests fail with CPython 3.8+ and python-snappy
Expand Down Expand Up @@ -2281,7 +2264,7 @@ buildvariants:
exclude_spec:
# Don't test green frameworks on these Python versions.
- platform: rhel62
python-version: ["pypy3.5", "pypy3.6"]
python-version: ["pypy3.6"]
green-framework: "*"
auth-ssl: "*"
display_name: "${green-framework} ${python-version} ${platform} ${auth-ssl}"
Expand Down Expand Up @@ -2420,7 +2403,7 @@ buildvariants:
matrix_spec:
platform: rhel62
# The toolchain doesn't currently include mod-wsgi
# built for CPython 3.5 or 3.8, mod-wsgi doesn't yet
# built for CPython 3.8, mod-wsgi doesn't yet
# claim to support 3.9. Python 3.7+ won't build on rhel6
# and we need to do some work to migrate mod-wsgi testing
# to a different OS. For now we're stuck just testing with
Expand All @@ -2443,7 +2426,7 @@ buildvariants:
- matrix_name: "tests-doctests"
matrix_spec:
platform: rhel62
python-version: ["3.5"]
python-version: ["3.6"]
display_name: "Doctests ${python-version} ${platform}"
tasks:
- name: "doctests"
Expand Down Expand Up @@ -2485,7 +2468,7 @@ buildvariants:
- matrix_name: "data-lake-spec-tests"
matrix_spec:
platform: ubuntu-16.04
python-version: ["3.5", "3.9"]
python-version: ["3.6", "3.9"]
auth: "auth"
c-extensions: "*"
display_name: "Atlas Data Lake ${python-version} ${c-extensions}"
Expand All @@ -2507,7 +2490,7 @@ buildvariants:
- matrix_name: "ocsp-test"
matrix_spec:
platform: ubuntu-16.04
python-version: ["3.5", "3.8", "3.9"]
python-version: ["3.6", "3.9"]
mongodb-version: ["4.4", "latest"]
auth: "noauth"
ssl: "ssl"
Expand All @@ -2519,7 +2502,7 @@ buildvariants:
- matrix_name: "ocsp-test-pypy"
matrix_spec:
platform: debian92
python-version: ["pypy3.5", "pypy3.6"]
python-version: ["pypy3.6"]
mongodb-version: ["4.4", "latest"]
auth: "noauth"
ssl: "ssl"
Expand All @@ -2531,7 +2514,7 @@ buildvariants:
- matrix_name: "ocsp-test-windows"
matrix_spec:
platform: windows-64-vsMulti-small
python-version-windows: ["3.5", "3.9"]
python-version-windows: ["3.6", "3.9"]
mongodb-version: ["4.4", "latest"]
auth: "noauth"
ssl: "ssl"
Expand Down
10 changes: 1 addition & 9 deletions .evergreen/utils.sh
Expand Up @@ -22,15 +22,7 @@ createvirtualenv () {
else
. $VENVPATH/bin/activate
fi
# Upgrade to the latest versions of pip setuptools wheel so that
# pip can always download the latest cryptography+cffi wheels.
PYTHON_VERSION=$(python -c 'import sys;print("%s.%s" % sys.version_info[:2])')
if [[ $PYTHON_VERSION == "3.5" ]]; then
# pip 21 will drop support for 3.5.
python -m pip install --upgrade 'pip<21'
else
python -m pip install --upgrade pip
fi
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
}

Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
@@ -1,11 +1,9 @@
language: python

python:
- 3.5
- 3.6
- 3.7
- 3.8
- pypy3.5

services:
- mongodb
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Expand Up @@ -19,7 +19,7 @@ that might not be of interest or that has already been addressed.
Supported Interpreters
----------------------

PyMongo supports CPython 3.5+ and PyPy3.5+. Language
PyMongo supports CPython 3.6+ and PyPy3.6+. Language
features not supported by all interpreters can not be used.

Style Guide
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -89,7 +89,7 @@ is incompatible with PyMongo.
Dependencies
============

PyMongo supports CPython 3.5+ and PyPy3.5+.
PyMongo supports CPython 3.6+ and PyPy3.6+.

Optional dependencies:

Expand Down
2 changes: 1 addition & 1 deletion doc/faq.rst
Expand Up @@ -134,7 +134,7 @@ they are returned to the pool.
Does PyMongo support Python 3?
------------------------------

PyMongo supports CPython 3.5+ and PyPy3.5+. See the :doc:`python3` for details.
PyMongo supports CPython 3.6+ and PyPy3.6+. See the :doc:`python3` for details.

Does PyMongo support asynchronous frameworks like Gevent, asyncio, Tornado, or Twisted?
---------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions doc/installation.rst
Expand Up @@ -28,7 +28,7 @@ To upgrade using pip::
Dependencies
------------

PyMongo supports CPython 3.5+ and PyPy3.5+.
PyMongo supports CPython 3.6+ and PyPy3.6+.

Optional dependencies:

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

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

**Xcode 5.1**: Starting with version 5.1 the version of clang that ships with
Expand Down
2 changes: 1 addition & 1 deletion doc/python3.rst
Expand Up @@ -6,7 +6,7 @@ Python 3 FAQ
What Python 3 versions are supported?
-------------------------------------

PyMongo supports CPython 3.5+ and PyPy3.5+.
PyMongo supports CPython 3.6+ and PyPy3.6+.

Are there any PyMongo behavior changes with Python 3?
-----------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions pymongo/ssl_context.py
Expand Up @@ -38,7 +38,4 @@
# making it the obvious version to start using SSLConext.check_hostname.
# Python 3.6 might have been a good version, but it suffers
# from https://bugs.python.org/issue32185.
# We'll use our bundled match_hostname for older Python
# versions, which also supports IP address matching
# with Python < 3.5.
CHECK_HOSTNAME_SAFE = _sys.version_info[:2] >= (3, 7)
7 changes: 3 additions & 4 deletions setup.py
Expand Up @@ -5,8 +5,8 @@
import warnings


if sys.version_info[:2] < (3, 5):
raise RuntimeError("Python version >= 3.5 required.")
if sys.version_info[:2] < (3, 6):
raise RuntimeError("Python version >= 3.6 required.")


# Hack to silence atexit traceback in some Python versions
Expand Down Expand Up @@ -327,7 +327,7 @@ def build_extension(self, ext):
keywords=["mongo", "mongodb", "pymongo", "gridfs", "bson"],
install_requires=[],
license="Apache License, Version 2.0",
python_requires=">=3.5",
python_requires=">=3.6",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All @@ -337,7 +337,6 @@ def build_extension(self, ext):
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down
5 changes: 0 additions & 5 deletions test/test_encryption.py
Expand Up @@ -504,11 +504,6 @@ def maybe_skip_scenario(self, test):
desc = test['description'].lower()
if 'type=symbol' in desc:
self.skipTest('PyMongo does not support the symbol type')
if desc == 'explain a find with deterministic encryption':
# PyPy and Python 3.6+ have ordered dict.
if sys.version_info[:2] < (3, 6) and 'PyPy' not in sys.version:
self.skipTest(
'explain test does not work without ordered dict')

def setup_scenario(self, scenario_def):
"""Override a test's setup."""
Expand Down

0 comments on commit 9138603

Please sign in to comment.