-
-
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
Errors with v49.2.0's distutils adoption #2261
Comments
also see numpy/numpy#16851 where we are trying to work around this. The problem is there is no way of knowing where exactly distutils is being imported. |
@mattip I think it would be prudent to hold off on trying to fix the warnings at the moment. I think #2259 / #2260 will likely be resolved before the distutils adoption is re-enabled by default. (Though replacing distutils with setuptools wherever possible is worthwhile irrespective of the distutils injection strategy.) |
Numpy has distutils extensions, and I hope nothing will break on esoteric combinations like f2py + (mingw or intel compilers) |
I don't really understand what that "distutils extensions" means. If you need something from the |
According to the comment [1], we are adviced to use functions wrapped by setuptools instead of distutils' raw ones. Related problem is that setuptools-49.2.0 started to raise a warning, if it sees that distutils is imported already. This *maybe* mitigates this warning (if nothing imports distutils before from ._version import __version__ is called. [1] pypa/setuptools#2261 (comment)
Hello. I tried to replace from distutils.version import LooseVersion
from distutils import log Thanks for your help! |
One option to replace |
@pganssle this is what I meant by "distutils extensions NumPy has implemented". Perhaps some of them could be incorporated into setuptools at some point. https://numpy.org/devdocs/reference/distutils.html Since setuptools released 49.2.1 without fixing this issue, numpy now needs to pin |
I'm surprised about the build error. That is concerning, especially considering that the distutils adoption code is disabled. That is, there should be few or no functional changes between 49.1.2 and 49.1.3 except for the fix to the stubs. Do I understand correctly that the main issue here is that Pillow builds fine against Setuptools 49.1.2 but not 49.1.3? |
With setuptools:
https://travis-ci.org/github/hugovk/Pillow/jobs/716558438#L2643
But please see PR #2297 by @radarhere (also a Pillow maintainer) which should fix this, by moving forward from deprecated |
#2297 has now been merged and released. |
Confirmed newest 49.3.2 is now working for Pillow: Thanks! |
According to the comment [1], we are adviced to use functions wrapped by setuptools instead of distutils' raw ones. Related problem is that setuptools-49.2.0 started to raise a warning, if it sees that distutils is imported already. This *maybe* mitigates this warning (if nothing imports distutils before from ._version import __version__ is called. [1] pypa/setuptools#2261 (comment)
This is now working for Pillow, we also replaced distutils (python-pillow/Pillow#4796). @mattip Do you still need this specific issue open for NumPy? |
I don't know. It is not clear to me how to migrate, and I fear the incompatibilities and breakage this process will cause. For instance, when trying to replace stdlib
Also, Now admittedly, one could import these via |
I wouldn't say there's a firm commitment, but I would say there is a strong commitment to helping the community transition off of distutils in the stdlib, preferably to something other than distutils, but providing distutils in the meantime in a compatible way and communicating changes through semver. Setuptools/distutils will rely heavily on the community (numpy, PyPy, and others) to contribute to the solution to provide the smoothest transition. If more of a commitment is needed, please open an issue. |
Related to #2256 / #2259.
When upgrading to
setuptools>=49.1.3
for the #2249 fix for Pillow, we get the new warning in v49.2.0:This also causes some C build issues and this sanity test failure; Pillow checks the version in the lower-level C code ("Core version") matches that in the user-facing Python code ("Pillow version"):
Moving the setuptools import before distutils in our setup.py removes the warning but not the error.
https://travis-ci.org/github/hugovk/Pillow/builds/707730154
I've not dug into this further, but it's happening at least on all the Linux/Python versions tested on Travis (3.5-3.9), and wanted to let you know.
More details at python-pillow/Pillow#4784 (comment).
The text was updated successfully, but these errors were encountered: