Skip to content

Commit

Permalink
Merge pull request #2803 from bagerard/fix_pymongo37
Browse files Browse the repository at this point in the history
Fix pymongo37 incompatibility
  • Loading branch information
bagerard authored Mar 7, 2024
2 parents 79dfcdb + 1652b5b commit ce9e108
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", 3.11, pypy3.9]
python-version: [3.7, 3.8, 3.9, "3.10", 3.11, "pypy3.9"]
MONGODB: [$MONGODB_4_0]
PYMONGO: [$PYMONGO_3_11]
include:
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Development
===========
- (Fill this out as you fix issues and develop your features).

Changes in 0.28.2
=================
- Fix typing import incompatible with Pymongo 3.7 #2802

Changes in 0.28.1
=================
- Fix bug related with recent updates to no_dereference context manager #2799
Expand Down
2 changes: 1 addition & 1 deletion mongoengine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
)


VERSION = (0, 28, 1)
VERSION = (0, 28, 2)


def get_version():
Expand Down
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 setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ def run_tests(self):
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
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 ce9e108

Please sign in to comment.