From 7b860f7739f684d1f545c06d5c46af18f2f50207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20W=C3=B3jcik?= Date: Sat, 10 Dec 2016 13:29:31 -0500 Subject: [PATCH] Deprecate Python v2.6 (#1430) --- .travis.yml | 2 +- mongoengine/python_support.py | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d764a32..4721a086 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python python: -- '2.6' +- '2.6' # TODO remove in v0.11.0 - '2.7' - '3.3' - '3.4' diff --git a/mongoengine/python_support.py b/mongoengine/python_support.py index 5bb9038d..f4b6f20f 100644 --- a/mongoengine/python_support.py +++ b/mongoengine/python_support.py @@ -1,9 +1,22 @@ -"""Helper functions and types to aid with Python 2.5 - 3 support.""" +"""Helper functions and types to aid with Python 2.6 - 3 support.""" import sys +import warnings + import pymongo +# Show a deprecation warning for people using Python v2.6 +# TODO remove in mongoengine v0.11.0 +if sys.version_info[0] == 2 and sys.version_info[1] == 6: + warnings.warn( + 'Python v2.6 support is deprecated and is going to be dropped ' + 'entirely in the upcoming v0.11.0 release. Update your Python ' + 'version if you want to have access to the latest features and ' + 'bug fixes in MongoEngine.', + DeprecationWarning + ) + if pymongo.version_tuple[0] < 3: IS_PYMONGO_3 = False else: