From d9b33dde3016b152c9680c0791878c30e9591131 Mon Sep 17 00:00:00 2001 From: CristiFati Date: Mon, 5 Dec 2022 16:07:26 +0200 Subject: [PATCH 1/5] Only allow .whl installation on Win --- setup.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/setup.py b/setup.py index 13045e88d..b20677179 100644 --- a/setup.py +++ b/setup.py @@ -66,6 +66,24 @@ def run(self): self.failure = self.failure or package_failure +try: + from wheel.bdist_wheel import bdist_wheel + class bdist_wheel_win(bdist_wheel, object): # @TODO - Python 2 compatible (also super() below) still needed? + def get_tag(self): + win_plats = ( # Copied the list from DistUtils + "win-amd64", + "win32", + "win-arm64", + "win-arm32", + "win-ia64", # Py2 only + ) + tag = super(self.__class__, self).get_tag() + return tuple(tag[:-1]) + (".".join(wp.replace("-", "_") for wp in win_plats),) + +except ImportError: + bdist_wheel_win = None + + classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -151,6 +169,7 @@ def run(self): cmdclass={ 'test': test, 'build_py': build_py, + 'bdist_wheel': bdist_wheel_win, 'install': post_install, }, From fe1faf293decc72bbb6c7605c141732ccadbec60 Mon Sep 17 00:00:00 2001 From: CristiFati Date: Mon, 5 Dec 2022 16:23:43 +0200 Subject: [PATCH 2/5] Add platform tag metadata (minor) --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index b20677179..c4e060a58 100644 --- a/setup.py +++ b/setup.py @@ -181,6 +181,8 @@ def run(self): "comtypes.tools", "comtypes.test", ], + + platforms=["Windows"], ) if __name__ == '__main__': From 4da07f77fec56c1d8befcc3d575393fd3c4607a5 Mon Sep 17 00:00:00 2001 From: CristiFati Date: Tue, 13 Dec 2022 14:09:25 +0200 Subject: [PATCH 3/5] Remove Py2 specific stuff --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c4e060a58..3de7d3aa4 100644 --- a/setup.py +++ b/setup.py @@ -68,14 +68,13 @@ def run(self): try: from wheel.bdist_wheel import bdist_wheel - class bdist_wheel_win(bdist_wheel, object): # @TODO - Python 2 compatible (also super() below) still needed? + class bdist_wheel_win(bdist_wheel): def get_tag(self): win_plats = ( # Copied the list from DistUtils "win-amd64", "win32", "win-arm64", "win-arm32", - "win-ia64", # Py2 only ) tag = super(self.__class__, self).get_tag() return tuple(tag[:-1]) + (".".join(wp.replace("-", "_") for wp in win_plats),) From d125cbc3fa811c6ee84be9610dc5b29695ebea76 Mon Sep 17 00:00:00 2001 From: CristiFati Date: Tue, 13 Dec 2022 14:34:41 +0200 Subject: [PATCH 4/5] Force Python >=3.7 and update classifiers --- setup.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 3de7d3aa4..5bb6fccba 100644 --- a/setup.py +++ b/setup.py @@ -88,9 +88,12 @@ def get_tag(self): 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: Microsoft :: Windows', - 'Programming Language :: Python', - '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', 'Topic :: Software Development :: Libraries :: Python Modules', ] @@ -182,6 +185,7 @@ def run(self): ], platforms=["Windows"], + python_requires=">=3.7", ) if __name__ == '__main__': From cf6fafd22436d269b51cefe90bac4cdda6288961 Mon Sep 17 00:00:00 2001 From: CristiFati Date: Wed, 14 Dec 2022 16:43:51 +0200 Subject: [PATCH 5/5] Remove Py2 stuff (that I missed in previous commit(s)) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5bb6fccba..d3b2587fc 100644 --- a/setup.py +++ b/setup.py @@ -76,7 +76,7 @@ def get_tag(self): "win-arm64", "win-arm32", ) - tag = super(self.__class__, self).get_tag() + tag = super().get_tag() return tuple(tag[:-1]) + (".".join(wp.replace("-", "_") for wp in win_plats),) except ImportError: