Merge branch 'master' of github.com:mongodb/mongo-python-driver

This commit is contained in:
Steven Silvester 2025-08-27 14:07:42 -05:00
commit 222877cc01
No known key found for this signature in database
GPG Key ID: B1BF5EC3A8B32F91
7 changed files with 30 additions and 22 deletions

View File

@ -332,7 +332,7 @@ buildvariants:
# Green framework tests
- name: green-eventlet-rhel8
tasks:
- name: .test-standard .standalone-noauth-nossl .python-3.9 .sync
- name: .test-standard .python-3.9 .sync
display_name: Green Eventlet RHEL8
run_on:
- rhel87-small
@ -340,7 +340,7 @@ buildvariants:
GREEN_FRAMEWORK: eventlet
- name: green-gevent-rhel8
tasks:
- name: .test-standard .standalone-noauth-nossl .sync
- name: .test-standard .sync
display_name: Green Gevent RHEL8
run_on:
- rhel87-small

View File

@ -26,12 +26,9 @@ else
fi
# List the packages.
uv sync ${UV_ARGS} --reinstall
uv sync ${UV_ARGS} --reinstall --quiet
uv pip list
# Ensure we go back to base environment after the test.
trap "uv sync" EXIT HUP
# Start the test runner.
uv run ${UV_ARGS} .evergreen/scripts/run_tests.py "$@"

View File

@ -301,11 +301,11 @@ def create_green_framework_variants():
variants = []
host = DEFAULT_HOST
for framework in ["eventlet", "gevent"]:
tasks = [".test-standard .standalone-noauth-nossl .sync"]
tasks = [".test-standard .sync"]
if framework == "eventlet":
# Eventlet has issues with dnspython > 2.0 and newer versions of CPython
# https://jira.mongodb.org/browse/PYTHON-5284
tasks = [".test-standard .standalone-noauth-nossl .python-3.9 .sync"]
tasks = [".test-standard .python-3.9 .sync"]
expansions = dict(GREEN_FRAMEWORK=framework)
display_name = get_variant_name(f"Green {framework.capitalize()}", host)
variant = create_variant(tasks, display_name, host=host, expansions=expansions)

View File

@ -41,6 +41,7 @@ jobs:
- [ubuntu-latest, "manylinux_i686", "cp3*-manylinux_i686"]
- [windows-2022, "win_amd6", "cp3*-win_amd64"]
- [windows-2022, "win32", "cp3*-win32"]
- [windows-11-arm, "win_arm64", "cp3*-win_arm64"]
- [macos-14, "macos", "cp*-macosx_*"]
steps:
@ -54,7 +55,7 @@ jobs:
- uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: 3.9
python-version: 3.11
cache-dependency-path: 'pyproject.toml'
allow-prereleases: true

View File

@ -2,7 +2,7 @@
set shell := ["bash", "-c"]
# Commonly used command segments.
uv_run := "uv run --isolated --frozen "
uv_run := "uv run --frozen "
typing_run := uv_run + "--group typing --extra aws --extra encryption --extra ocsp --extra snappy --extra test --extra zstd"
docs_run := uv_run + "--extra docs"
doc_build := "./doc/_build"
@ -13,51 +13,55 @@ mypy_args := "--install-types --non-interactive"
default:
@just --list
[private]
resync:
@uv sync --quiet --frozen
install:
bash .evergreen/scripts/setup-dev-env.sh
[group('docs')]
docs:
docs: && resync
{{docs_run}} sphinx-build -W -b html doc {{doc_build}}/html
[group('docs')]
docs-serve:
docs-serve: && resync
{{docs_run}} sphinx-autobuild -W -b html doc --watch ./pymongo --watch ./bson --watch ./gridfs {{doc_build}}/serve
[group('docs')]
docs-linkcheck:
docs-linkcheck: && resync
{{docs_run}} sphinx-build -E -b linkcheck doc {{doc_build}}/linkcheck
[group('typing')]
typing:
typing: && resync
just typing-mypy
just typing-pyright
[group('typing')]
typing-mypy:
typing-mypy: && resync
{{typing_run}} mypy {{mypy_args}} bson gridfs tools pymongo
{{typing_run}} mypy {{mypy_args}} --config-file mypy_test.ini test
{{typing_run}} mypy {{mypy_args}} test/test_typing.py test/test_typing_strict.py
[group('typing')]
typing-pyright:
typing-pyright: && resync
{{typing_run}} pyright test/test_typing.py test/test_typing_strict.py
{{typing_run}} pyright -p strict_pyrightconfig.json test/test_typing_strict.py
[group('lint')]
lint:
lint: && resync
{{uv_run}} pre-commit run --all-files
[group('lint')]
lint-manual:
lint-manual: && resync
{{uv_run}} pre-commit run --all-files --hook-stage manual
[group('test')]
test *args="-v --durations=5 --maxfail=10":
test *args="-v --durations=5 --maxfail=10": && resync
{{uv_run}} --extra test pytest {{args}}
[group('test')]
run-tests *args:
run-tests *args: && resync
bash ./.evergreen/run-tests.sh {{args}}
[group('test')]

View File

@ -28,7 +28,7 @@ from test.asynchronous import AsyncIntegrationTest, async_client_context, connec
from test.asynchronous.utils import (
async_wait_until,
)
from test.utils_shared import ServerAndTopologyEventListener
from test.utils_shared import ServerAndTopologyEventListener, gevent_monkey_patched
from pymongo.periodic_executor import _EXECUTORS
@ -58,6 +58,9 @@ class TestMonitor(AsyncIntegrationTest):
return client
@unittest.skipIf("PyPy" in sys.version, "PYTHON-5283 fails often on PyPy")
@unittest.skipIf(
gevent_monkey_patched(), "PYTHON-5516 Resources are not cleared when using gevent"
)
async def test_cleanup_executors_on_client_del(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")

View File

@ -28,7 +28,7 @@ from test import IntegrationTest, client_context, connected, unittest
from test.utils import (
wait_until,
)
from test.utils_shared import ServerAndTopologyEventListener
from test.utils_shared import ServerAndTopologyEventListener, gevent_monkey_patched
from pymongo.periodic_executor import _EXECUTORS
@ -58,6 +58,9 @@ class TestMonitor(IntegrationTest):
return client
@unittest.skipIf("PyPy" in sys.version, "PYTHON-5283 fails often on PyPy")
@unittest.skipIf(
gevent_monkey_patched(), "PYTHON-5516 Resources are not cleared when using gevent"
)
def test_cleanup_executors_on_client_del(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")