Skip to content

Commit 5a66e99

Browse files
authored
PYTHON-4828 - Drop Python 3.8 support (#1902)
1 parent 006a996 commit 5a66e99

File tree

13 files changed

+56
-67
lines changed

13 files changed

+56
-67
lines changed

.evergreen/config.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,10 +2233,6 @@ axes:
22332233
values:
22342234
# Note: always display platform with python-version to avoid ambiguous display names.
22352235
# Linux
2236-
- id: "3.8"
2237-
display_name: "Python 3.8"
2238-
variables:
2239-
PYTHON_BINARY: "/opt/python/3.8/bin/python3"
22402236
- id: "3.9"
22412237
display_name: "Python 3.9"
22422238
variables:
@@ -2269,10 +2265,6 @@ axes:
22692265
- id: python-version-windows
22702266
display_name: "Python"
22712267
values:
2272-
- id: "3.8"
2273-
display_name: "Python 3.8"
2274-
variables:
2275-
PYTHON_BINARY: "C:/python/Python38/python.exe"
22762268
- id: "3.9"
22772269
display_name: "Python 3.9"
22782270
variables:
@@ -2297,10 +2289,8 @@ axes:
22972289
- id: python-version-windows-32
22982290
display_name: "Python"
22992291
values:
2300-
- id: "3.8"
2301-
display_name: "32-bit Python 3.8"
2302-
variables:
2303-
PYTHON_BINARY: "C:/python/32/Python38/python.exe"
2292+
2293+
23042294
- id: "3.9"
23052295
display_name: "32-bit Python 3.9"
23062296
variables:
@@ -2581,10 +2571,10 @@ buildvariants:
25812571
auth: "*"
25822572
ssl: "ssl"
25832573
pyopenssl: "*"
2584-
# Only test "noauth" with Python 3.8.
2574+
# Only test "noauth" with Python 3.9.
25852575
exclude_spec:
25862576
platform: rhel8
2587-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
2577+
python-version: ["3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
25882578
auth: "noauth"
25892579
ssl: "ssl"
25902580
pyopenssl: "*"
@@ -2716,7 +2706,7 @@ buildvariants:
27162706
matrix_spec:
27172707
platform: rhel7
27182708
# Python 3.10+ requires OpenSSL 1.1.1+
2719-
python-version: ["3.8", "3.9"]
2709+
python-version: ["3.9"]
27202710
auth-ssl: "*"
27212711
display_name: "OpenSSL 1.0.2 ${python-version} ${platform} ${auth-ssl}"
27222712
tasks:
@@ -2739,12 +2729,12 @@ buildvariants:
27392729
then:
27402730
add_tasks: *encryption-server-versions
27412731

2742-
# Storage engine tests on RHEL 8.4 (x86_64) with Python 3.8.
2732+
# Storage engine tests on RHEL 8.4 (x86_64) with Python 3.9.
27432733
- matrix_name: "tests-storage-engines"
27442734
matrix_spec:
27452735
platform: rhel8
27462736
storage-engine: "*"
2747-
python-version: 3.8
2737+
python-version: 3.9
27482738
display_name: "Storage ${storage-engine} ${python-version} ${platform}"
27492739
rules:
27502740
- if:
@@ -2774,12 +2764,12 @@ buildvariants:
27742764
- "test-3.6-standalone"
27752765
- "test-3.6-replica_set"
27762766

2777-
# enableTestCommands=0 tests on RHEL 8.4 (x86_64) with Python 3.8.
2767+
# enableTestCommands=0 tests on RHEL 8.4 (x86_64) with Python 3.9.
27782768
- matrix_name: "test-disableTestCommands"
27792769
matrix_spec:
27802770
platform: rhel8
27812771
disableTestCommands: "*"
2782-
python-version: "3.8"
2772+
python-version: "3.9"
27832773
display_name: "Disable test commands ${python-version} ${platform}"
27842774
tasks:
27852775
- ".latest"
@@ -2805,15 +2795,15 @@ buildvariants:
28052795
- matrix_name: "test-search-index-helpers"
28062796
matrix_spec:
28072797
platform: rhel8
2808-
python-version: "3.8"
2798+
python-version: "3.9"
28092799
display_name: "Search Index Helpers ${platform}"
28102800
tasks:
28112801
- name: "test_atlas_task_group_search_indexes"
28122802

28132803
- matrix_name: "tests-mod-wsgi"
28142804
matrix_spec:
28152805
platform: ubuntu-22.04
2816-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
2806+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
28172807
mod-wsgi-version: "*"
28182808
display_name: "${mod-wsgi-version} ${python-version} ${platform}"
28192809
tasks:
@@ -2825,15 +2815,15 @@ buildvariants:
28252815
- matrix_name: "mockupdb-tests"
28262816
matrix_spec:
28272817
platform: rhel8
2828-
python-version: 3.8
2818+
python-version: 3.9
28292819
display_name: "MockupDB Tests"
28302820
tasks:
28312821
- name: "mockupdb"
28322822

28332823
- matrix_name: "tests-doctests"
28342824
matrix_spec:
28352825
platform: rhel8
2836-
python-version: ["3.8"]
2826+
python-version: ["3.9"]
28372827
display_name: "Doctests ${python-version} ${platform}"
28382828
tasks:
28392829
- name: "doctests"
@@ -2873,7 +2863,7 @@ buildvariants:
28732863
- matrix_name: "data-lake-spec-tests"
28742864
matrix_spec:
28752865
platform: ubuntu-22.04
2876-
python-version: ["3.8", "3.10"]
2866+
python-version: ["3.9", "3.10"]
28772867
auth: "auth"
28782868
c-extensions: "*"
28792869
display_name: "Atlas Data Lake ${python-version} ${c-extensions}"
@@ -2883,7 +2873,7 @@ buildvariants:
28832873
- matrix_name: "stable-api-tests"
28842874
matrix_spec:
28852875
platform: rhel8
2886-
python-version: ["3.8", "3.10"]
2876+
python-version: ["3.9", "3.10"]
28872877
auth: "auth"
28882878
versionedApi: "*"
28892879
display_name: "Versioned API ${versionedApi} ${python-version}"
@@ -2896,7 +2886,7 @@ buildvariants:
28962886
- matrix_name: "ocsp-test"
28972887
matrix_spec:
28982888
platform: rhel8
2899-
python-version: ["3.8", "3.10", "pypy3.9", "pypy3.10"]
2889+
python-version: ["3.9", "3.10", "pypy3.9", "pypy3.10"]
29002890
mongodb-version: ["4.4", "5.0", "6.0", "7.0", "8.0", "latest"]
29012891
auth: "noauth"
29022892
ssl: "ssl"
@@ -2908,7 +2898,7 @@ buildvariants:
29082898
- matrix_name: "ocsp-test-windows"
29092899
matrix_spec:
29102900
platform: windows
2911-
python-version-windows: ["3.8", "3.10"]
2901+
python-version-windows: ["3.9", "3.10"]
29122902
mongodb-version: ["4.4", "5.0", "6.0", "7.0", "8.0", "latest"]
29132903
auth: "noauth"
29142904
ssl: "ssl"

.evergreen/utils.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ set -o xtrace
44

55
find_python3() {
66
PYTHON=""
7-
# Add a fallback system python3 if it is available and Python 3.8+.
8-
if is_python_38 "$(command -v python3)"; then
7+
# Add a fallback system python3 if it is available and Python 3.9+.
8+
if is_python_39 "$(command -v python3)"; then
99
PYTHON="$(command -v python3)"
1010
fi
1111
# Find a suitable toolchain version, if available.
@@ -14,23 +14,23 @@ find_python3() {
1414
if [ -d "/Library/Frameworks/Python.Framework/Versions/3.10" ]; then
1515
PYTHON="/Library/Frameworks/Python.Framework/Versions/3.10/bin/python3"
1616
# macos 10.14
17-
elif [ -d "/Library/Frameworks/Python.Framework/Versions/3.8" ]; then
18-
PYTHON="/Library/Frameworks/Python.Framework/Versions/3.8/bin/python3"
17+
elif [ -d "/Library/Frameworks/Python.Framework/Versions/3.9" ]; then
18+
PYTHON="/Library/Frameworks/Python.Framework/Versions/3.9/bin/python3"
1919
fi
2020
elif [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin
21-
PYTHON="C:/python/Python38/python.exe"
21+
PYTHON="C:/python/Python39/python.exe"
2222
else
23-
# Prefer our own toolchain, fall back to mongodb toolchain if it has Python 3.8+.
24-
if [ -f "/opt/python/3.8/bin/python3" ]; then
25-
PYTHON="/opt/python/3.8/bin/python3"
26-
elif is_python_38 "$(command -v /opt/mongodbtoolchain/v4/bin/python3)"; then
23+
# Prefer our own toolchain, fall back to mongodb toolchain if it has Python 3.9+.
24+
if [ -f "/opt/python/3.9/bin/python3" ]; then
25+
PYTHON="/opt/python/3.9/bin/python3"
26+
elif is_python_39 "$(command -v /opt/mongodbtoolchain/v4/bin/python3)"; then
2727
PYTHON="/opt/mongodbtoolchain/v4/bin/python3"
28-
elif is_python_38 "$(command -v /opt/mongodbtoolchain/v3/bin/python3)"; then
28+
elif is_python_39 "$(command -v /opt/mongodbtoolchain/v3/bin/python3)"; then
2929
PYTHON="/opt/mongodbtoolchain/v3/bin/python3"
3030
fi
3131
fi
3232
if [ -z "$PYTHON" ]; then
33-
echo "Cannot test without python3.8+ installed!"
33+
echo "Cannot test without python3.9+ installed!"
3434
exit 1
3535
fi
3636
echo "$PYTHON"
@@ -96,15 +96,15 @@ testinstall () {
9696
fi
9797
}
9898

99-
# Function that returns success if the provided Python binary is version 3.8 or later
99+
# Function that returns success if the provided Python binary is version 3.9 or later
100100
# Usage:
101-
# is_python_38 /path/to/python
101+
# is_python_39 /path/to/python
102102
# * param1: Python binary
103-
is_python_38() {
103+
is_python_39() {
104104
if [ -z "$1" ]; then
105105
return 1
106-
elif $1 -c "import sys; exit(sys.version_info[:2] < (3, 8))"; then
107-
# runs when sys.version_info[:2] >= (3, 8)
106+
elif $1 -c "import sys; exit(sys.version_info[:2] < (3, 9))"; then
107+
# runs when sys.version_info[:2] >= (3, 9)
108108
return 0
109109
else
110110
return 1

.github/workflows/dist.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- uses: actions/setup-python@v5
5454
with:
5555
cache: 'pip'
56-
python-version: 3.8
56+
python-version: 3.9
5757
cache-dependency-path: 'pyproject.toml'
5858
allow-prereleases: true
5959

@@ -79,13 +79,12 @@ jobs:
7979
env:
8080
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
8181
CIBW_MANYLINUX_I686_IMAGE: manylinux1
82-
CIBW_BUILD: "cp38-${{ matrix.buildplat[1] }} cp39-${{ matrix.buildplat[1] }}"
82+
CIBW_BUILD: "cp39-${{ matrix.buildplat[1] }} cp39-${{ matrix.buildplat[1] }}"
8383
run: python -m cibuildwheel --output-dir wheelhouse
8484

8585
- name: Assert all versions in wheelhouse
8686
if: ${{ ! startsWith(matrix.buildplat[1], 'macos') }}
8787
run: |
88-
ls wheelhouse/*cp38*.whl
8988
ls wheelhouse/*cp39*.whl
9089
ls wheelhouse/*cp310*.whl
9190
ls wheelhouse/*cp311*.whl
@@ -109,7 +108,7 @@ jobs:
109108
- uses: actions/setup-python@v5
110109
with:
111110
# Build sdist on lowest supported Python
112-
python-version: '3.8'
111+
python-version: '3.9'
113112

114113
- name: Build SDist
115114
run: |

.github/workflows/test-python.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323
- uses: actions/setup-python@v5
2424
with:
25-
python-version: "3.8"
25+
python-version: "3.9"
2626
cache: 'pip'
2727
cache-dependency-path: 'pyproject.toml'
2828
- name: Install Python dependencies
@@ -51,7 +51,7 @@ jobs:
5151
strategy:
5252
matrix:
5353
os: [ubuntu-20.04]
54-
python-version: ["3.8", "pypy-3.9", "3.13"]
54+
python-version: ["3.9", "pypy-3.9", "3.13"]
5555
name: CPython ${{ matrix.python-version }}-${{ matrix.os }}
5656
steps:
5757
- uses: actions/checkout@v4
@@ -87,7 +87,7 @@ jobs:
8787
- name: Setup Python
8888
uses: actions/setup-python@v5
8989
with:
90-
python-version: "3.8"
90+
python-version: "3.9"
9191
cache: 'pip'
9292
cache-dependency-path: 'pyproject.toml'
9393
- name: Install dependencies
@@ -111,7 +111,7 @@ jobs:
111111
cache: 'pip'
112112
cache-dependency-path: 'pyproject.toml'
113113
# Build docs on lowest supported Python for furo
114-
python-version: '3.8'
114+
python-version: '3.9'
115115
- name: Install dependencies
116116
run: |
117117
pip install -U pip hatch
@@ -129,7 +129,7 @@ jobs:
129129
cache: 'pip'
130130
cache-dependency-path: 'pyproject.toml'
131131
# Build docs on lowest supported Python for furo
132-
python-version: '3.8'
132+
python-version: '3.9'
133133
- name: Install dependencies
134134
run: |
135135
pip install -U pip hatch
@@ -142,7 +142,7 @@ jobs:
142142
runs-on: ubuntu-latest
143143
strategy:
144144
matrix:
145-
python: ["3.8", "3.11"]
145+
python: ["3.9", "3.11"]
146146
steps:
147147
- uses: actions/checkout@v4
148148
- uses: actions/setup-python@v5
@@ -167,7 +167,7 @@ jobs:
167167
cache: 'pip'
168168
cache-dependency-path: 'pyproject.toml'
169169
# Build sdist on lowest supported Python
170-
python-version: '3.8'
170+
python-version: '3.9'
171171
- name: Build SDist
172172
shell: bash
173173
run: |
@@ -199,7 +199,7 @@ jobs:
199199
cache: 'pip'
200200
cache-dependency-path: 'sdist/test/pyproject.toml'
201201
# Test sdist on lowest supported Python
202-
python-version: '3.8'
202+
python-version: '3.9'
203203
- name: Start MongoDB
204204
uses: supercharge/mongodb-github-action@1.11.0
205205
- name: Run connect test from sdist

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ be of interest or that has already been addressed.
1616

1717
## Supported Interpreters
1818

19-
PyMongo supports CPython 3.8+ and PyPy3.9+. Language features not
19+
PyMongo supports CPython 3.9+ and PyPy3.9+. Language features not
2020
supported by all interpreters can not be used.
2121

2222
## Style Guide

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ package that is incompatible with PyMongo.
9090

9191
## Dependencies
9292

93-
PyMongo supports CPython 3.8+ and PyPy3.9+.
93+
PyMongo supports CPython 3.9+ and PyPy3.9+.
9494

9595
Required dependencies:
9696

doc/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
Changes in Version 4.11.0
5+
-------------------------
6+
7+
.. warning:: PyMongo 4.11 drops support for Python 3.8: Python 3.9+ or PyPy 3.9+ is now required.
8+
49
Changes in Version 4.10.1
510
-------------------------
611

doc/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ they are returned to the pool.
166166
Does PyMongo support Python 3?
167167
------------------------------
168168

169-
PyMongo supports CPython 3.8+ and PyPy3.9+. See the :doc:`python3` for details.
169+
PyMongo supports CPython 3.9+ and PyPy3.9+. See the :doc:`python3` for details.
170170

171171
Does PyMongo support asynchronous frameworks like Gevent, asyncio, Tornado, or Twisted?
172172
---------------------------------------------------------------------------------------

doc/installation.rst

Lines changed: 2 additions & 2 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.8+ and PyPy3.9+.
31+
PyMongo supports CPython 3.9+ and PyPy3.9+.
3232

3333
Required dependencies
3434
.....................
@@ -140,7 +140,7 @@ See `http://bugs.python.org/issue11623 <http://bugs.python.org/issue11623>`_
140140
for a more detailed explanation.
141141

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

146146
**Xcode 5.1**: Starting with version 5.1 the version of clang that ships with

doc/python3.rst

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

7-
PyMongo supports CPython 3.8+ and PyPy3.9+.
7+
PyMongo supports CPython 3.9+ and PyPy3.9+.
88

99
Are there any PyMongo behavior changes with Python 3?
1010
-----------------------------------------------------

0 commit comments

Comments
 (0)