Skip to content

Commit

Permalink
Fix typing that was used and is incompatible with pymongo3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
bagerard committed Mar 7, 2024
1 parent 79dfcdb commit 2d59e54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 4 additions & 5 deletions mongoengine/connection.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import warnings

from pymongo import MongoClient, ReadPreference, uri_parser
from pymongo.common import (
_UUID_REPRESENTATIONS,
_CaseInsensitiveDictionary,
)
from pymongo.common import _UUID_REPRESENTATIONS
from pymongo.database import _check_name

# DriverInfo was added in PyMongo 3.7.
Expand Down Expand Up @@ -135,7 +132,9 @@ def _get_connection_settings(
if uri_dict.get(param):
conn_settings[param] = uri_dict[param]

uri_options: _CaseInsensitiveDictionary = uri_dict["options"]
uri_options = uri_dict[
"options"
] # uri_options is a _CaseInsensitiveDictionary
if "replicaset" in uri_options:
conn_settings["replicaSet"] = uri_options["replicaset"]
if "authsource" in uri_options:
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ envlist = pypy3-{mg34,mg36,mg39,mg311,mg312,mg4,mg432,mg441,mg460}
commands =
python setup.py test {posargs}
deps =
mg34: pymongo>=3.4,<3.5
mg36: pymongo>=3.6,<3.7
mg39: pymongo>=3.9,<3.10
mg311: pymongo>=3.11,<3.12
mg312: pymongo>=3.12,<3.13
Expand Down

0 comments on commit 2d59e54

Please sign in to comment.