zopefoundation / zope.i18nmessageid

Other
1 stars 11 forks source link

using a specific version of setuptools lead to distutils.errors.DistutilsSetupError: each element of 'ext_modules' option must be an Extension instance or 2-tuple #61

Closed pbiering closed 14 hours ago

pbiering commented 4 days ago

What I did:

bundle zope.i18nmessageid together with mailman3 for EL8

Because of some other dependencies this requires a specific version of setuptools to build the bundle

What I expect to happen:

Working

What actually happened:

Exception

distutils.errors.DistutilsSetupError: each element of 'ext_modules' option must be an Extension instance or 2-tuple

What version of Python and Zope/Addons I am using:

At least with 6.0.1, 6.1.0 and 7.0

Found well-known root cause here: https://stackoverflow.com/questions/21594925/error-each-element-of-ext-modules-option-must-be-an-extension-instance-or-2-t

And the proposed fix would be reordering the imports:

--- zope.i18nmessageid-6.1.0/setup.py.orig  2024-09-26 21:42:04.261786387 +0200
+++ zope.i18nmessageid-6.1.0/setup.py   2024-09-26 21:42:36.857397705 +0200
@@ -22,15 +22,15 @@
 import os
 import platform
 import sys
-from distutils.command.build_ext import build_ext
-from distutils.errors import CCompilerError
-from distutils.errors import DistutilsExecError
-from distutils.errors import DistutilsPlatformError

 from setuptools import Extension
 from setuptools import find_packages
 from setuptools import setup

+from distutils.command.build_ext import build_ext
+from distutils.errors import CCompilerError
+from distutils.errors import DistutilsExecError
+from distutils.errors import DistutilsPlatformError

 py_impl = getattr(platform, 'python_implementation', lambda: None)
 is_pypy = py_impl() == 'PyPy'
icemac commented 15 hours ago

@pbiering Thank you for your report. Let me try to fix this.