Skip to content

Update pymongo and python support #59

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

Merged
merged 2 commits into from
Feb 18, 2025
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
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ jobs:
run: |
python -m pip install -e ".[test]"
python -m unittest discover .
- name: Test min pymongo
run: |
python -m pip install pymongo==4.9
python -m unittest discover .
6 changes: 6 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog
=========

Changes in version 1.4.0 (unreleased)
-------------------------------------
- Added support for Python 3.13. Dropped support for Python versions
less than 3.9.
- Dropped support for PyMongo versions less than 4.9.

Changes in version 1.3.0
------------------------
- Added support for Python 3.11 and 3.12. Dropped support for Python versions
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dynamic = ["version"]
description = "Explainable CRUD API for PyMongo"
readme = "README.rst"
license = { file = "LICENSE" }
requires-python = ">=3.7"
requires-python = ">=3.9"
authors = [
{ name = "Julius Park" },
]
Expand All @@ -25,18 +25,17 @@ classifiers = [
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Database",
]
dependencies = [
"pymongo>=4.4",
"pymongo>=4.9",
]

[project.scripts]
Expand Down
17 changes: 9 additions & 8 deletions test/utils_spec_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,6 @@ def check_events(self, test, listener, session_ids):
event.command['getMore'] = Int64(42)
elif event.command_name == 'killCursors':
event.command['cursors'] = [Int64(42)]
elif event.command_name == 'update':
# TODO: remove this once PYTHON-1744 is done.
# Add upsert and multi fields back into expectations.
updates = expectation[event_type]['command']['updates']
for update in updates:
update.setdefault('upsert', False)
update.setdefault('multi', False)

# Replace afterClusterTime: 42 with actual afterClusterTime.
expected_cmd = expectation[event_type]['command']
Expand Down Expand Up @@ -458,7 +451,15 @@ def check_events(self, test, listener, session_ids):
self.fail("Expected key [%s] in %r" % (
key, actual))
else:
self.assertEqual(val, decode_raw(actual[key]),
actual_val = decode_raw(actual[key])
# Use the equivalent of `"$$unsetOrMatches": false` for "upsert" and "multi".
if isinstance(val, list):
for (i, j) in zip(val, actual_val):
if "multi" in j:
i.setdefault("multi", False)
if "upsert" in j:
i.setdefault("upsert", False)
self.assertEqual(val, actual_val,
"Key [%s] in %s" % (key, actual))
else:
self.assertEqual(actual, expected)
Expand Down