From 141b134bec99a735f524103481c4c54020cfd212 Mon Sep 17 00:00:00 2001 From: Manodeep Sinha Date: Tue, 6 Aug 2024 13:57:36 +1000 Subject: [PATCH] Reinstate py2.7 support for patch release (before completely dropping py2) --- common.mk | 16 ++++++++-------- setup.py | 11 ++++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/common.mk b/common.mk index a38b66f4..9e5773ef 100644 --- a/common.mk +++ b/common.mk @@ -375,7 +375,7 @@ ifeq ($(DO_CHECKS), 1) endif # Check if using clang on Apple with M1/M1 Max/M2 etc - # if so, remove -march=native from CFLAGS and + # if so, remove -march=native from CFLAGS and # then add -mcpu=apple-m1 -mtune=apple-m1 # ARCH := $(shell uname -m) # $(info ARCH is $(ARCH)) @@ -400,12 +400,12 @@ ifeq ($(DO_CHECKS), 1) #### MS: 3rd May 2023 ### For reasons unknown to me, the addition to CFLAGS does not work correctly if I ### change this variable name "opt" to match the remaining names of "copt". Works fine - ### for 'clang' on OSX but not for 'gcc'. Adds the -march=native but somehow that + ### for 'clang' on OSX but not for 'gcc'. Adds the -march=native but somehow that ### extra flag is removed when testing the -mcpu/-mtune compiler options. For the sake ### of my sanity, I have accepted that this is how it shall work! Hopefully, in the future, - ### someone will figure out/explain *why* this behaviour is expected. It - ### seems more like a gcc bug to me where gcc is updating CFLAGS based on - ### the options on the last compile call (since cland does not show + ### someone will figure out/explain *why* this behaviour is expected. It + ### seems more like a gcc bug to me where gcc is updating CFLAGS based on + ### the options on the last compile call (since cland does not show ### this behaviour) - MS: 3rd May, 2023 ## TLDR: Leave this variable as "opt" while the remaining are set to "copt". Otherwise, @@ -424,7 +424,7 @@ ifeq ($(DO_CHECKS), 1) CFLAGS += $(copt) else CFLAGS := $(filter-out $(copt), $(CFLAGS)) - endif + endif copt := -mtune=apple-m1 COMPILE_OPT_SUPPORTED := $(shell $(CC) $(copt) -dM -E - < /dev/null 2>&1 1>/dev/null) @@ -474,8 +474,8 @@ ifeq ($(DO_CHECKS), 1) ### Check for minimum python + numpy versions. In theory, I should also check ### that *any* python and numpy are available but that seems too much effort - MIN_PYTHON_MAJOR := 3 - MIN_PYTHON_MINOR := 9 + MIN_PYTHON_MAJOR := 2 + MIN_PYTHON_MINOR := 7 MIN_NUMPY_MAJOR := 1 MIN_NUMPY_MINOR := 20 diff --git a/setup.py b/setup.py index c0a99882..f0d9e7ba 100644 --- a/setup.py +++ b/setup.py @@ -522,11 +522,13 @@ def setup_packages(): 'Operating System :: POSIX', 'Programming Language :: C', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12'] + 'Programming Language :: Python :: 3.10'] metadata = dict( name=projectname, version=version, @@ -558,8 +560,7 @@ def setup_packages(): min_np_minor), 'future', 'wurlitzer'], - python_requires='!=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*,'\ - '!=3.5.*, !=3.6.*, !=3.7.*, !=3.8.*, <4', + python_requires='>=2.7,!=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, <4', zip_safe=False, cmdclass={'build_ext': BuildExtSubclass})