From fab5a9289d9689da823a18300bd957fd6bad7f72 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Mon, 22 Aug 2022 16:43:28 +0200 Subject: [PATCH] Deprecate Python 3.6 (#1017) * Rename CI workflow to a more meaningful name * News fragment --- changelog.d/1017.deprecation.rst | 2 ++ changelog.d/988.breaking.rst | 3 --- src/attr/__init__.py | 11 +++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 changelog.d/1017.deprecation.rst diff --git a/changelog.d/1017.deprecation.rst b/changelog.d/1017.deprecation.rst new file mode 100644 index 00000000..3cef161c --- /dev/null +++ b/changelog.d/1017.deprecation.rst @@ -0,0 +1,2 @@ +Python 3.6 is now deprecated and is slated for removal in the next release. +If that would affect you, please `let us know `_. diff --git a/changelog.d/988.breaking.rst b/changelog.d/988.breaking.rst index b804658f..58c1dbde 100644 --- a/changelog.d/988.breaking.rst +++ b/changelog.d/988.breaking.rst @@ -1,4 +1 @@ Python 3.5 is not supported anymore. - -We're considering to drop 3.6 soon too. -If that would affect you, please `let us know `_. diff --git a/src/attr/__init__.py b/src/attr/__init__.py index 92e8920b..c3f0937e 100644 --- a/src/attr/__init__.py +++ b/src/attr/__init__.py @@ -1,5 +1,8 @@ # SPDX-License-Identifier: MIT +import sys +import warnings + from functools import partial from . import converters, exceptions, filters, setters, validators @@ -21,6 +24,14 @@ from ._next_gen import define, field, frozen, mutable from ._version_info import VersionInfo +if sys.version_info < (3, 7): # pragma: no cover + warnings.warn( + "Running attrs on Python 3.6 is deprecated & we intend to drop " + "support soon. If that's a problem for you, please let us know why & " + "we MAY re-evaluate: ", + DeprecationWarning, + ) + __version__ = "22.2.0.dev0" __version_info__ = VersionInfo._from_version_string(__version__)