Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 0426415

Browse files
authored
Update to support PyMongo 4.11 (#218)
* Bump to Python 3.9+ support * fix import * debug * debug * fix * undo changes * test branch * use setup and teardown * restore branch * fix tests
1 parent 70be171 commit 0426415

File tree

7 files changed

+23
-22
lines changed

7 files changed

+23
-22
lines changed

.evergreen/config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ functions:
5454
continue_on_err: true
5555
command: |
5656
cat /etc/resolv.conf
57-
# Create virtualenv using a CPython 3.8+ binary.
57+
# Create virtualenv using a CPython 3.9+ binary.
5858
- command: subprocess.exec
5959
type: setup
6060
params:
@@ -757,22 +757,22 @@ axes:
757757
run_on: windows-64-vsMulti-small
758758
batchtime: 10080 # 7 days
759759
variables:
760-
PYTHON3_BINARY: "C:/python/Python38/python.exe"
760+
PYTHON3_BINARY: "C:/python/Python39/python.exe"
761761
PYTHON_BIN_DIR: "Scripts"
762762

763763
# The 'runtime' axis specifies the language runtime to use.
764764
# Runtimes SHOULD specify language and platform-specific variables needed by driver scripts.
765765
- id: runtime
766766
display_name: runtime
767767
values:
768-
- id: python39
768+
- id: python3-linux
769769
display_name: CPython-3
770770
variables:
771771
PYTHON_BINARY: "/opt/python/3.9/bin/python3"
772-
- id: python38-windows
773-
display_name: CPython-3.8-Windows
772+
- id: python3-windows
773+
display_name: CPython-3-Windows
774774
variables:
775-
PYTHON_BINARY: "C:/python/Python38/python.exe"
775+
PYTHON_BINARY: "C:/python/Python39/python.exe"
776776
- id: ruby-32
777777
display_name: Ruby 3.2
778778
variables:
@@ -864,15 +864,15 @@ buildvariants:
864864
matrix_spec:
865865
driver: ["pymongo-master"]
866866
platform: ["ubuntu-22.04"]
867-
runtime: ["python39"]
867+
runtime: ["python3-linux"]
868868
display_name: "${driver} ${platform} ${runtime}"
869869
tasks:
870870
- ".all"
871871
- matrix_name: "tests-python-windows"
872872
matrix_spec:
873873
driver: ["pymongo-master"]
874874
platform: ["windows-64"]
875-
runtime: ["python38-windows"]
875+
runtime: ["python3-windows"]
876876
display_name: "${driver} ${platform} ${runtime}"
877877
tasks:
878878
# Kind tasks can't run on Windows, so exclude them.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ API](https://docs.atlas.mongodb.com/api/) via a fluent interface. The
1818
`atlasclient` and also contains the test harnesses necessary to run
1919
Atlas Planned Maintenance specification tests.
2020

21-
Astrolabe supports Python 3.8+.
21+
Astrolabe supports Python 3.9+.
2222

2323
## Installation
2424

@@ -36,7 +36,7 @@ python -m pip install .
3636

3737
## Dependencies
3838

39-
Astrolabe supports CPython 3.8+.
39+
Astrolabe supports CPython 3.9+.
4040

4141
Astrolabe requires [Click](https://pypi.org/project/click/),
4242
[requests](https://pypi.org/project/requests/),

docs/installing-running-locally.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Kubernetes test scenarios.
1010

1111
`astrolabe` runs on Linux, OSX and Windows.
1212

13-
Running `astrolabe` requires Python 3.8 or later. To check the version
13+
Running `astrolabe` requires Python 3.9 or later. To check the version
1414
of Python you are running, do:
1515

1616
``` bash

docs/integration-guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,14 @@ systems are **strongly advised** to use the custom
153153
distro for running their tests. See `faq-why-custom-distro` for details.
154154

155155
The Atlas Planned Maintenance tests can be run on all platforms which
156-
have a Python 3.8+ binary installed. Each entry to the `platform` axis
156+
have a Python 3.9+ binary installed. Each entry to the `platform` axis
157157
has the following fields:
158158

159159
- `id` (required): unique identifier for this `platform` axis entry.
160160
- `display_name` (optional): plaintext name for this platform that will
161161
be used to display test runs.
162162
- `run_on` (required): evergreen distro name for this platform
163-
- `variables.PYTHON3_BINARY` (required): path to the Python 3.8+ binary
163+
- `variables.PYTHON3_BINARY` (required): path to the Python 3.9+ binary
164164
on the distro. This is used to run `astrolabe`.
165165
- `variables.PYTHON_BIN_DIR` (required): name of directory in which
166166
Python install executables. This is always `bin` on \*nix systems and
@@ -172,11 +172,11 @@ platform:
172172
- id: platform
173173
display_name: OS
174174
values:
175-
- id: ubuntu-16.04
176-
display_name: "Ubuntu 16.04"
177-
run_on: ubuntu1604-test
175+
- id: ubuntu-20.04
176+
display_name: "Ubuntu 20.04"
177+
run_on: ubuntu2004-test
178178
variables:
179-
PYTHON3_BINARY: "/opt/python/3.8/bin/python3"
179+
PYTHON3_BINARY: "/opt/python/3.9/bin/python3"
180180
PYTHON_BIN_DIR: "bin"
181181

182182
To encourage re-use of `platform` entries across driver projects, it is

integrations/python/pymongo/install-driver.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ set -o xtrace
33

44
"$PYTHON_BINARY" --version
55
"$PYTHON_BINARY" -m virtualenv "$PYMONGO_VIRTUALENV_NAME"
6-
"$PYMONGO_VIRTUALENV_NAME/$PYTHON_BIN_DIR/pip" install -e mongo-python-driver/[srv]
7-
"$PYMONGO_VIRTUALENV_NAME/$PYTHON_BIN_DIR/pip" install certifi # TODO: remove this once BUILD-10841 is done.
6+
"$PYMONGO_VIRTUALENV_NAME/$PYTHON_BIN_DIR/pip" install -e mongo-python-driver

integrations/python/pymongo/workload-executor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def interrupt_handler(signum, frame):
3131

3232
def workload_runner(mongodb_uri, test_workload):
3333
runner = UnifiedSpecTestMixinV1()
34+
# Note: we cannot use setUpClass or tearDownClass since we're overriding the client for the tests.
3435
runner.TEST_SPEC = test_workload
3536
UnifiedSpecTestMixinV1.TEST_SPEC = test_workload
3637
runner.setUp()
@@ -45,6 +46,8 @@ def workload_runner(mongodb_uri, test_workload):
4546
runner.entity_map["errors"] = [
4647
{"error": str(exc), "time": time.time(), "type": type(exc).__name__}
4748
]
49+
finally:
50+
runner.tearDown()
4851
entity_map = defaultdict(list, runner.entity_map._entities)
4952
for entity_type in ["successes", "iterations"]:
5053
if entity_type not in entity_map:

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "Command-line utility for testing Drivers against MongoDB Atlas <https://www.mongodb.com/cloud/atlas>"
99
readme = "README.rst"
1010
license = {file="LICENSE"}
11-
requires-python = ">=3.8"
11+
requires-python = ">=3.9"
1212
authors = [
1313
{ name = "Prashant Mital", email = "[email protected]" },
1414
]
@@ -23,8 +23,7 @@ classifiers = [
2323
"Intended Audience :: Developers",
2424
"License :: OSI Approved :: Apache Software License",
2525
"Operating System :: OS Independent",
26-
"Programming Language :: Python :: 3.8",
27-
"Programming Language :: Python :: 3.9",
26+
"Programming Language :: Python :: 3",
2827
"Programming Language :: Python :: Implementation :: CPython",
2928
"Topic :: Software Development :: Testing",
3029
]

0 commit comments

Comments
 (0)