Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pymongo37 incompatibility #2803

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading