Skip to content
Closed
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 @@ -51,7 +51,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.10"]
python-version: ["3.11", "3.12", "3.13", "3.14", "pypy3.11"]
MONGODB: [$MONGODB_4_4]
PYMONGO: [$PYMONGO_4_8]
include:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py310-plus]
args: [--py311-plus]
- repo: https://github.com/pycqa/isort
rev: 9.0.0a3
hooks:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ post to the `user group <http://groups.google.com/group/mongoengine-users>`
Supported Interpreters
----------------------

MongoEngine supports CPython 3.5 and newer as well as Pypy3.
MongoEngine supports CPython and PyPy with Python 3.11 or newer.
Language features not supported by all interpreters can not be used.

Python3 codebase
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ experience any problems with more recent MongoDB versions.

Installation
============
MongoEngine requires Python 3.10 or newer. Install it from PyPI with:
MongoEngine requires Python 3.11 or newer. Install it from PyPI with:

.. code-block:: console

Expand Down
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changelog
Development
===========
- (Fill this out as you fix issues and develop your features).
- BREAKING CHANGE: Drop support for Python 3.10. Python 3.11 or newer is required.
- Fix partial ``Document.reload()`` leaving custom ``db_field`` values marked as changed.

Changes in 1.0.0
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def get_version(version_tuple):
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down Expand Up @@ -68,7 +67,7 @@ def get_version(version_tuple):
long_description=LONG_DESCRIPTION,
platforms=["any"],
classifiers=CLASSIFIERS,
python_requires=">=3.10",
python_requires=">=3.11",
install_requires=install_require,
extras_require={
"test": tests_require,
Expand Down
16 changes: 4 additions & 12 deletions tests/fields/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ class Person(Document):
name = StringField()
age = IntField(default=30, required=False)
userid = StringField(default=lambda: "test", required=True)
created = DateTimeField(
default=lambda: datetime.datetime.now(datetime.timezone.utc)
)
created = DateTimeField(default=lambda: datetime.datetime.now(datetime.UTC))
day = DateField(default=datetime.date.today)

person = Person(name="Ross")
Expand Down Expand Up @@ -171,9 +169,7 @@ class Person(Document):
name = StringField()
age = IntField(default=30, required=False)
userid = StringField(default=lambda: "test", required=True)
created = DateTimeField(
default=lambda: datetime.datetime.now(datetime.timezone.utc)
)
created = DateTimeField(default=lambda: datetime.datetime.now(datetime.UTC))

# Trying setting values to None
person = Person(name=None, age=None, userid=None, created=None)
Expand Down Expand Up @@ -207,9 +203,7 @@ class Person(Document):
name = StringField()
age = IntField(default=30, required=False)
userid = StringField(default=lambda: "test", required=True)
created = DateTimeField(
default=lambda: datetime.datetime.now(datetime.timezone.utc)
)
created = DateTimeField(default=lambda: datetime.datetime.now(datetime.UTC))

person = Person()
person.name = None
Expand Down Expand Up @@ -277,9 +271,7 @@ class Person(Document):
name = StringField()
age = IntField(default=30, required=False)
userid = StringField(default=lambda: "test", required=True)
created = DateTimeField(
default=lambda: datetime.datetime.now(datetime.timezone.utc)
)
created = DateTimeField(default=lambda: datetime.datetime.now(datetime.UTC))

person = Person(
name="Ross",
Expand Down
4 changes: 2 additions & 2 deletions tests/queryset/test_queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ class BlogPost(Document):

BlogPost.objects.create(
title="whatever",
published_date=datetime.datetime.now(datetime.timezone.utc),
published_date=datetime.datetime.now(datetime.UTC),
)

with db_ops_tracker() as q:
Expand Down Expand Up @@ -3165,7 +3165,7 @@ class Link(Document):

Link.drop_collection()

now = datetime.datetime.now(datetime.timezone.utc)
now = datetime.datetime.now(datetime.UTC)

# Note: Test data taken from a custom Reddit homepage on
# Fri, 12 Feb 2010 14:36:00 -0600. Link ordering should
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import functools
import operator
import unittest
from datetime import datetime, timezone
from datetime import UTC, datetime

import pymongo
import pytest
Expand All @@ -18,7 +18,7 @@

def utcnow_naive() -> datetime:
"""Return the current UTC datetime without timezone information."""
return datetime.now(timezone.utc).replace(tzinfo=None)
return datetime.now(UTC).replace(tzinfo=None)


class MongoDBTestCase(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
pypy3-{mg480,mg4101,mg4141,mg4155,mg4160,mg4170}
py{310,311,312,313,314}-{mg480,mg4101,mg4141,mg4155,mg4160,mg4170}
pypy311-{mg480,mg4101,mg4141,mg4155,mg4160,mg4170}
py{311,312,313,314}-{mg480,mg4101,mg4141,mg4155,mg4160,mg4170}
skipsdist = True

[testenv]
Expand Down