Skip to content

Commit

Permalink
Merge branch 'master' into PYTHON-4476
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahStapp committed Jun 25, 2024
2 parents d4559b7 + ff1d903 commit 8f1fd4d
Show file tree
Hide file tree
Showing 9 changed files with 333 additions and 319 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
PRODUCT_NAME: PyMongo
# Changes per branch
SILK_ASSET_GROUP: mongodb-python-driver
EVERGREEN_PROJECT: mongodb-python-driver

defaults:
run:
Expand Down Expand Up @@ -55,7 +56,7 @@ jobs:
needs: [pre-publish]
uses: ./.github/workflows/codeql.yml
with:
ref: ${{ inputs.version }}
ref: ${{ github.ref }}

publish:
needs: [build-dist, static-scan]
Expand All @@ -82,5 +83,6 @@ jobs:
following_version: ${{ inputs.following_version }}
product_name: ${{ env.PRODUCT_NAME }}
silk_asset_group: ${{ env.SILK_ASSET_GROUP }}
evergreen_project: ${{ env.EVERGREEN_PROJECT }}
token: ${{ github.token }}
dry_run: ${{ inputs.dry_run }}
11 changes: 6 additions & 5 deletions pymongo/asynchronous/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ async def inner(*args: Any, **kwargs: Any) -> Any:
return cast(F, inner)


async def anext(cls: Any) -> Any:
"""Compatibility function until we drop 3.9 support: https://docs.python.org/3/library/functions.html#anext."""
if sys.version_info >= (3, 10):
return await builtins.anext(cls)
else:
if sys.version_info >= (3, 10):
anext = builtins.anext
else:

async def anext(cls: Any) -> Any:
"""Compatibility function until we drop 3.9 support: https://docs.python.org/3/library/functions.html#anext."""
return await cls.__anext__()
6 changes: 0 additions & 6 deletions pymongo/asynchronous/mongo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
from pymongo.write_concern import DEFAULT_WRITE_CONCERN, WriteConcern

if TYPE_CHECKING:
import sys
from types import TracebackType

from bson.objectid import ObjectId
Expand All @@ -118,11 +117,6 @@
from pymongo.response import Response
from pymongo.server_selectors import Selection

if sys.version_info[:2] >= (3, 9):
pass
else:
# Deprecated since version 3.9: collections.abc.Generator now supports [].
pass

T = TypeVar("T")

Expand Down
294 changes: 150 additions & 144 deletions pymongo/asynchronous/pool.py

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions pymongo/synchronous/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ def inner(*args: Any, **kwargs: Any) -> Any:
return cast(F, inner)


def next(cls: Any) -> Any:
"""Compatibility function until we drop 3.9 support: https://docs.python.org/3/library/functions.html#next."""
if sys.version_info >= (3, 10):
return builtins.next(cls)
else:
if sys.version_info >= (3, 10):
next = builtins.next
else:

def next(cls: Any) -> Any:
"""Compatibility function until we drop 3.9 support: https://docs.python.org/3/library/functions.html#next."""
return cls.__next__()
6 changes: 0 additions & 6 deletions pymongo/synchronous/mongo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
from pymongo.write_concern import DEFAULT_WRITE_CONCERN, WriteConcern

if TYPE_CHECKING:
import sys
from types import TracebackType

from bson.objectid import ObjectId
Expand All @@ -117,11 +116,6 @@
from pymongo.synchronous.pool import Connection
from pymongo.synchronous.server import Server

if sys.version_info[:2] >= (3, 9):
pass
else:
# Deprecated since version 3.9: collections.abc.Generator now supports [].
pass

T = TypeVar("T")

Expand Down
Loading

0 comments on commit 8f1fd4d

Please sign in to comment.