From 583f3790ee9780c3d8677299cd315a8155965773 Mon Sep 17 00:00:00 2001 From: Ilan Schnell Date: Sun, 17 Dec 2023 11:42:44 -0600 Subject: [PATCH] deprecate support for Python 2 - add stdout message in setup.py --- CHANGE_LOG | 2 ++ setup.py | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGE_LOG b/CHANGE_LOG index 282bcf05..573b9bc3 100644 --- a/CHANGE_LOG +++ b/CHANGE_LOG @@ -7,6 +7,8 @@ * `.find()` and `.index()`: add keyword argument `right` for rightmost index * `.itersearch()`: add start and stop argument, and keyword argument `right` (for descending order - starting with rightmost match) + * deprecate support for Python 2 - Python 2 support will be removed in + bitarray version 3.0 * deprecate `util.rindex()` (will be removed in 3.0 release), use `.index(..., right=True)` instead * deprecate `util.make_endian()` (will be removed in 3.0 release), diff --git a/setup.py b/setup.py index 62718114..58287a9b 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,15 @@ import sys import platform + +if sys.version_info[0] == 2: + print("""\ +************************************************************************** +* Python 2 support of bitarray is deprecated (as of bitarray version 2.9) +* and will be removed in bitarray version 3.0. +************************************************************************** +""") + if "test" in sys.argv: import bitarray # when test was successful, return 0 (hence not)