From 47a7eb1727552010d72c5ec3ba7a57c91e4a0b05 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 16 Sep 2024 14:53:23 -0700 Subject: [PATCH] deprecate 3.7 we don't have a timeline for removing support yet, but start warning --- CHANGELOG.rst | 3 +++ src/cryptography/__init__.py | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 75b4a55f78d33..b2e677dd219ce 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,9 @@ Changelog .. note:: This version is not yet released and is under active development. +* Deprecated Python 3.7 support. Python 3.7 is no longer supported by the + Python core team. Support for Python 3.7 will be removed in a future + ``cryptography`` release. * Enforce the :rfc:`5280` requirement that extended key usage extensions must not be empty. * Added support for timestamp extraction to the diff --git a/src/cryptography/__init__.py b/src/cryptography/__init__.py index d374f752dfd53..66ca71dd12e5b 100644 --- a/src/cryptography/__init__.py +++ b/src/cryptography/__init__.py @@ -4,6 +4,9 @@ from __future__ import annotations +import sys +import warnings + from cryptography.__about__ import __author__, __copyright__, __version__ __all__ = [ @@ -11,3 +14,12 @@ "__copyright__", "__version__", ] + +if sys.version_info[:2] == (3, 7): + warnings.warn( + "Python 3.7 is no longer supported by the Python core team " + "and support for it is deprecated in cryptography. A future " + "release of cryptography will remove support for Python 3.7.", + CryptographyDeprecationWarning, + stacklevel=2, + )