diff --git a/.evergreen/generated_configs/variants.yml b/.evergreen/generated_configs/variants.yml index a05cc61f0..33b8e0ba0 100644 --- a/.evergreen/generated_configs/variants.yml +++ b/.evergreen/generated_configs/variants.yml @@ -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 diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 2b7d856d4..a9f2ba2b5 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -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 "$@" diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 3a386be4f..f76c0d1e0 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -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) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index f5f8c20c8..e5b36ad7d 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -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 diff --git a/justfile b/justfile index 74ebb4882..24da94a49 100644 --- a/justfile +++ b/justfile @@ -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')] diff --git a/test/asynchronous/test_monitor.py b/test/asynchronous/test_monitor.py index 55a20d764..dde8976c0 100644 --- a/test/asynchronous/test_monitor.py +++ b/test/asynchronous/test_monitor.py @@ -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") diff --git a/test/test_monitor.py b/test/test_monitor.py index 8bcdf7130..c10662c89 100644 --- a/test/test_monitor.py +++ b/test/test_monitor.py @@ -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")