From 839422471707a91851d15e78b11bec2d7c0fb206 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 16 Sep 2024 14:53:23 -0700 Subject: [PATCH 1/2] deprecate 3.7 we don't have a timeline for removing support yet, but start warning --- CHANGELOG.rst | 3 +++ src/cryptography/__init__.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 75b4a55f78d3..b2e677dd219c 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 d374f752dfd5..f37370e90a71 100644 --- a/src/cryptography/__init__.py +++ b/src/cryptography/__init__.py @@ -4,6 +4,10 @@ from __future__ import annotations +import sys +import warnings + +from cryptography import utils from cryptography.__about__ import __author__, __copyright__, __version__ __all__ = [ @@ -11,3 +15,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.", + utils.CryptographyDeprecationWarning, + stacklevel=2, + ) From 1b75ef6aba62f5688e32a49f71a5f17e51171581 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 16 Sep 2024 15:18:01 -0700 Subject: [PATCH 2/2] add coverage for a 3.7 builder --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff689e808dc3..794232b08dd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -223,11 +223,11 @@ jobs: - {OS: 'macos-13', ARCH: 'x86_64'} - {OS: 'macos-14', ARCH: 'arm64'} PYTHON: - - {VERSION: "3.7", NOXSESSION: "tests-nocoverage"} + - {VERSION: "3.7", NOXSESSION: "tests"} - {VERSION: "3.12", NOXSESSION: "tests"} exclude: # We only test latest Python on arm64. py37 won't work since there's no universal2 binary - - PYTHON: {VERSION: "3.7", NOXSESSION: "tests-nocoverage"} + - PYTHON: {VERSION: "3.7", NOXSESSION: "tests"} RUNNER: {OS: 'macos-14', ARCH: 'arm64'} timeout-minutes: 15 steps: