Skip to content

Commit 3e2c57c

Browse files
authored
Merge pull request #288 from IlyaSkriblovsky/deprecation-warnings
Deprecation warnings
2 parents 90e141a + bd6a3b9 commit 3e2c57c

File tree

6 files changed

+19
-6
lines changed

6 files changed

+19
-6
lines changed

docs/source/NEWS.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
Changelog
22
=========
33

4-
Release UPCOMING (yyyy-mm-dd)
5-
-----------------------------
4+
Release 24.0.0 (2024-09-18)
5+
---------------------------
66

77
API Changes
88
^^^^^^^^^^^
99

10+
- This is the last release that supports Python <3.8 and MongoDB <4.0
1011
- PyMongo 4+ is now supported. If you will migrate from PyMongo 3 to PyMongo 4, please be sure
1112
to check their PyMongo's guide because newer version has a number of incompatible changes.
1213

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@
5151

5252
# General information about the project.
5353
project = 'TxMongo'
54-
copyright = '2021, Alexandre Fiori, Bret Curtis, Ilya Skriblovsky'
54+
copyright = '2024, Alexandre Fiori, Bret Curtis, Ilya Skriblovsky'
5555

5656
# The version info for the project you're documenting, acts as replacement for
5757
# |version| and |release|, also used in various other places throughout the
5858
# built documents.
5959
#
6060
# The short X.Y version.
61-
version = '23.0.0'
61+
version = '24.0.0'
6262
# The full version, including alpha/beta/rc tags.
6363
release = version
6464

python-txmongo.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: python-txmongo
2-
Version: 23.0.0
2+
Version: 24.0.0
33
Release: 1%{?dist}
44
Summary: Twisted driver for MongoDB
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="txmongo",
6-
version="23.0.0",
6+
version="24.0.0",
77
description="Asynchronous Python driver for MongoDB <http://www.mongodb.org>",
88
author="Alexandre Fiori, Bret Curtis",
99
author_email="fiorix@gmail.com, psi29a@gmail.com",

txmongo/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Use of this source code is governed by the Apache License that can be
44
# found in the LICENSE file.
55

6+
import sys
7+
import warnings
8+
69
from txmongo.database import Database
710
from txmongo.protocol import MongoProtocol, Query
811
from txmongo.connection import MongoConnection, MongoConnectionPool, lazyMongoConnection, \
@@ -16,3 +19,6 @@
1619
assert MongoConnectionPool
1720
assert lazyMongoConnection
1821
assert lazyMongoConnectionPool
22+
23+
if sys.version_info < (3, 8):
24+
warnings.warn("Only Python 3.8+ will be supported in the next version of TxMongo", DeprecationWarning)

txmongo/connection.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Use of this source code is governed by the Apache License that can be
33
# found in the LICENSE file.
44

5+
import warnings
6+
57
from bson.codec_options import DEFAULT_CODEC_OPTIONS
68
from pymongo.errors import AutoReconnect, ConfigurationError, OperationFailure
79
from pymongo.read_preferences import ReadPreference
@@ -119,6 +121,10 @@ def configure(self, proto):
119121
proto.set_wire_versions(config.get("minWireVersion", 0),
120122
config.get("maxWireVersion", 0))
121123

124+
# MongoDB < 4.0
125+
if proto.max_wire_version < 7:
126+
warnings.warn("MongoDB <4.0 support will be dropped in the next version of TxMongo", DeprecationWarning)
127+
122128
# Track the other hosts in the replica set.
123129
hosts = config.get("hosts")
124130
if isinstance(hosts, list) and hosts:

0 commit comments

Comments
 (0)