-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] release v65.6.0 breaks packages downstream due to removal of distutils.log.Log
#3693
Comments
This actually breaks just importing In [2]: import numpy.distutils
---------------------------------------------------------------------------
ImportError
...
~/38venv/lib/python3.8/site-packages/numpy/distutils/log.py in <module>
2 import sys
3 from distutils.log import * # noqa: F403
----> 4 from distutils.log import Log as old_Log
5 from distutils.log import _global_log
6
ImportError: cannot import name 'Log' from 'distutils.log' (~/38venv/lib/python3.8/site-packages/setuptools/_distutils/log.py) |
This is a serious issue for people using older numpy (that can only install with distutils) and poetry (as poetry doesn't respect PEP-518 AFAICT). We have no way to install our dependencies except to manually install numpy with the |
setuptools == 65.6.0 remove `distutils.log.Log`, this leads to numpy issues see pypa/setuptools#3693
Also running into this, numpy 1.23.5 is also affected. |
@bentheiii 's alternative above of |
Note that this only appears in the latest poetry, downgrading to |
setuptools == 65.6.0 remove `distutils.log.Log`, this leads to numpy issues see pypa/setuptools#3693
@bentheiii I'm running into this from numpy 1.19.4 also. what do I need to downgrade 1.1.15 to? |
Running into this for statsmodels==0.13.0 and numpy==1.22.0 |
For numpy, follow one of the two options I listed for scipy. (Scipy hits it because of its dependence on numpy.) |
to workaround numpy/numpy#22623 and pypa/setuptools#3693
I'm not sure I understand this. SymPy's CI just does
I am not personally interested in doing this. Both distutils and numpy.distutils are deprecated so the expected downstream response as I understand it is just to stop using them. I find it strange though that backwards incompatible changes would be made if these are deprecated and basically shouldn't be used any more. The problem right now is that it isn't clear what the expected alternatives for distutils/numpy.distutils are supposed to be. Note that the SymPy code in question is using numpy.distutils in the way that is still suggested in the NumPy documentation: |
Another way out from this situation would have been pip constraints, but as far as I can tell, constraints don't seem to apply to an isolated build environment:
It looks like pypa/pip#10669 asked for exactly this (for the same reason of distutils breakage), but that one was duped onto pypa/pip#4582 which is still open. |
On Tue, Nov 22, 2022 at 04:55:58AM -0800, Oscar Benjamin wrote:
I think it is however easy to fix this in SymPy's case by switching to
setuptools instead of numpy.distutils because I don't think the additional
features of numpy.distutils are needed there.
I doubt.
https://numpy.org/devdocs/reference/distutils_status_migration.html#moving-to-setuptools
says that the setuptools has no Fortran build support, for example.
|
* removal of distutils.log.Log from setuptools breaks building packages like numpy. See pypa/setuptools#3693 * we have used SETUPTOOLS_USE_DISTUTILS alternative already in #1924 * update circle-ci and azure pipelines similarly
@cliffwoolley I cannot run it. We have dockerized the model and each time it does poetry install, it needs to install statsmodels, which statsmodels has no PIN for setuptools < 65.6.0, so it fails. We pinned our own models constraints to be <65.6.0 Another Q would be, starting which version of numpy would we get rid of this problem? 1.23.1? |
* removal of distutils.log.Log from setuptools breaks building packages like numpy. See pypa/setuptools#3693 * we have used SETUPTOOLS_USE_DISTUTILS alternative already in #1924 * update circle-ci and azure pipelines similarly
I've cut a release 65.6.2 with the fix. Sorry it took so long to get a remedy out. That was mainly my fault. Huge thanks to abravalheri for multiple fixes and validation work. |
Thanks @jaraco @abravalheri ! (FWIW @tulbureandreit , I'm also building Docker images, though using pip rather than poetry. Setting the env var with ENV is what I'm doing so that it applies to any and all pip installs.) |
For those diving right in to verify like I am, it seems 65.6.1 also has the relevant change; 65.6.2 that @jaraco mentioned was about half an hour later with relnote-only tweaks. v65.6.1...v65.6.2 . |
Thanks all. |
This reverts commit 2fbb6e5.
@cliffwoolley I solved it with SETUPTOOLS_USE_DISTUTILS=stdlib poetry install. I heard maybe 65.6.2 fixed it ? |
I can confirm that setuptools version |
There should probably be a distinction between building numpy (with pinned setuptools) in CI, versus building a carefully crafted test case that depends on numpy and setuptools, and does The latter is what really needs to be tested here in order to make sure that yet more projects using numpy.distutils are operational. |
Hitting problem in azure when deploying related to distutils removal of log. Used in scikit-build pypa/setuptools#3693
setuptools version
65.6.0
Python version
Python 3.10
OS
Ubuntu
Additional environment information
No response
Description
The
distutils.log.Log
class was removed in 74652ca. This causes popular packages downstream, such asnumpy
, to fail: see numpy/numpy#22623Expected behavior
The module
distutils.log
module was not officially marked as deprecated even though 74652ca added to the docstring that the module isRetained for compatibility and should not be used.
. It would be great if the removed class could be reinstated and a deprecation pathway be provided.How to Reproduce
pip install setuptools==65.6.0
from numpy.distutils import Log
Output
The text was updated successfully, but these errors were encountered: