[MacPorts] #66304: py-setuptools 65.6.0_0 breaks py-numpy builds

MacPorts noreply at macports.org
Mon Nov 21 02:12:41 UTC 2022


#66304: py-setuptools 65.6.0_0 breaks py-numpy builds
-----------------------+------------------------
 Reporter:  michaelld  |      Owner:  (none)
     Type:  defect     |     Status:  new
 Priority:  Normal     |  Milestone:
Component:  ports      |    Version:
 Keywords:             |       Port:  setuptools
-----------------------+------------------------
 setuptools 65.6.0 changes the log API such that all NumPy builds from
 source fail (the code causing the error predates the earliest version of
 NumPy used in MacPorts right now [1.16]). While this -is- a NumPy problem
 from a certain perspective, we need to fixup -all- NumPy uses of log to
 work again; luckily all of the NumPy code looks the be virtually
 identical. I hope this (ab)use of the log API is limited to NumPy!

 {{{
 :debug:build system:  cd "/opt/local/var/macports/build
 /_opt_sources_MacPorts_ports_github_macports_python_py-
 numpy/py310-numpy/work/numpy-1.23.4" &&
 /opt/local/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10
 setup.py --no-user-cfg build -j8
 :info:build Running from numpy source directory.
 :info:build Traceback (most recent call last):
 :info:build   File "/opt/local/var/macports/build
 /_opt_sources_MacPorts_ports_github_macports_python_py-
 numpy/py310-numpy/work/numpy-1.23.4/setup.py", line 86, in <module>
 :info:build     import numpy.distutils.command.sdist
 :info:build   File "/opt/local/var/macports/build
 /_opt_sources_MacPorts_ports_github_macports_python_py-
 numpy/py310-numpy/work/numpy-1.23.4/numpy/distutils/__init__.py", line 26,
 in <module>
 :info:build     from . import ccompiler
 :info:build   File "/opt/local/var/macports/build
 /_opt_sources_MacPorts_ports_github_macports_python_py-
 numpy/py310-numpy/work/numpy-1.23.4/numpy/distutils/ccompiler.py", line
 20, in <module>
 :info:build     from numpy.distutils import log
 :info:build   File "/opt/local/var/macports/build
 /_opt_sources_MacPorts_ports_github_macports_python_py-
 numpy/py310-numpy/work/numpy-1.23.4/numpy/distutils/log.py", line 4, in
 <module>
 :info:build     from distutils.log import Log as old_Log
 :info:build ImportError: cannot import name 'Log' from 'distutils.log'
 (/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10
 /site-packages/setuptools/_distutils/log.py)
 :info:build Command failed:  cd "/opt/local/var/macports/build
 /_opt_sources_MacPorts_ports_github_macports_python_py-
 numpy/py310-numpy/work/numpy-1.23.4" &&
 /opt/local/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10
 setup.py --no-user-cfg build -j8
 }}}

 Here's the NumPy code that fails:
 https://github.com/numpy/numpy/blob/maintenance/1.23.x/numpy/distutils/log.py#L4

 Here's the setuptools change that causes the issue:
 https://github.com/pypa/setuptools/commit/9b8a6ef60b2b490bcf60b9dd7f0d43d46f49e489
 #diff-f4970eee1e6aebcf5dd5528890fbf7ddce06a8929dd9649b16b94f04277eb85b

 Here's an older version of the setuptools code that works:
 https://github.com/pypa/setuptools/blob/bb9fb1fcfe37c1ef1e29e1e6d1fc4e483c743380/setuptools/_distutils/log.py
 . Note the `class Log` that is required by NumPy, which was removed for
 this latest release.

 Here is the NumPy issue: https://github.com/numpy/numpy/issues/22623 .
 NumPy folks say to not use this setuptools, and they won't be fixing the
 issue; if someone wants to fix it & it doesn't break anything, they will
 consider merging it.

-- 
Ticket URL: <https://trac.macports.org/ticket/66304>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list