Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.99k forks source link

Wheel 0.30.0 is not compatible with latest setuptools #29467

Open bebound opened 3 months ago

bebound commented 3 months ago

After 71.0.0, in https://github.com/pypa/setuptools/pull/4457 run python setup.py bdist_wheel: Use installed wheel or vendored wheel Install package from source code: Use installed wheel or vendored wheel

Setuptools calls wheels 0.30.0 we installed, which does not provide wheel.wheelfile. see - https://github.com/Azure/azure-cli/issues/29421#issuecomment-2238008833

If the package does not provide wheel and must compile from source code, you'll see this error:

# install cffi 1.15.1 in Python 3.12
2024-07-25T03:43:04.0552476Z Building wheels for collected packages: cffi
2024-07-25T03:43:04.0552668Z   Building wheel for cffi (setup.py): started
2024-07-25T03:43:04.0552985Z   Building wheel for cffi (setup.py): finished with status 'error'
2024-07-25T03:43:04.0553397Z   error: subprocess-exited-with-error
2024-07-25T03:43:04.0553554Z   
2024-07-25T03:43:04.0553792Z   × python setup.py bdist_wheel did not run successfully.
2024-07-25T03:43:04.0554013Z   │ exit code: 1
2024-07-25T03:43:04.0554207Z   ╰─> [25 lines of output]
2024-07-25T03:43:04.0554371Z       Traceback (most recent call last):
2024-07-25T03:43:04.0554525Z         File "<string>", line 2, in <module>
2024-07-25T03:43:04.0554796Z         File "<pip-setuptools-caller>", line 34, in <module>
2024-07-25T03:43:04.0555161Z         File "/tmp/pip-install-7jczthn1/cffi_1b5c114d59cc470d96d4d51c40a16d1f/setup.py", line 179, in <module>
2024-07-25T03:43:04.0555433Z           setup(
2024-07-25T03:43:04.0555800Z         File "/mnt/vss/_work/1/s/env/lib/python3.12/site-packages/setuptools/__init__.py", line 108, in setup
2024-07-25T03:43:04.0556032Z           return distutils.core.setup(**attrs)
2024-07-25T03:43:04.0556194Z                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-25T03:43:04.0556572Z         File "/mnt/vss/_work/1/s/env/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 171, in setup
2024-07-25T03:43:04.0556824Z           ok = dist.parse_command_line()
2024-07-25T03:43:04.0556969Z                ^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-25T03:43:04.0557375Z         File "/mnt/vss/_work/1/s/env/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 478, in parse_command_line
2024-07-25T03:43:04.0557637Z           args = self._parse_command_opts(parser, args)
2024-07-25T03:43:04.0557809Z                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-25T03:43:04.0558199Z         File "/mnt/vss/_work/1/s/env/lib/python3.12/site-packages/setuptools/dist.py", line 858, in _parse_command_opts
2024-07-25T03:43:04.0558478Z           nargs = _Distribution._parse_command_opts(self, parser, args)
2024-07-25T03:43:04.0558656Z                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-25T03:43:04.0559069Z         File "/mnt/vss/_work/1/s/env/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 537, in _parse_command_opts
2024-07-25T03:43:04.0559333Z           cmd_class = self.get_command_class(command)
2024-07-25T03:43:04.0559500Z                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-25T03:43:04.0559869Z         File "/mnt/vss/_work/1/s/env/lib/python3.12/site-packages/setuptools/dist.py", line 697, in get_command_class
2024-07-25T03:43:04.0560127Z           from .command.bdist_wheel import bdist_wheel
2024-07-25T03:43:04.0560547Z         File "/mnt/vss/_work/1/s/env/lib/python3.12/site-packages/setuptools/command/bdist_wheel.py", line 29, in <module>
2024-07-25T03:43:04.0560801Z           from wheel.wheelfile import WheelFile
2024-07-25T03:43:04.0561094Z       ModuleNotFoundError: No module named 'wheel.wheelfile'
2024-07-25T03:43:04.0561275Z       [end of output]
2024-07-25T03:43:04.0561395Z   
2024-07-25T03:43:04.0561577Z   note: This error originates from a subprocess, and is likely not a problem with pip.
2024-07-25T03:43:04.0561805Z   ERROR: Failed building wheel for cffi
2024-07-25T03:43:04.0561973Z   Running setup.py clean for cffi
2024-07-25T03:43:04.0562141Z Failed to build cffi
2024-07-25T03:43:04.0562350Z ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cffi)

Ref:

yonzhan commented 3 months ago

Thank you for opening this issue, we will look into it.

wangzelin007 commented 2 months ago

I just encountered this issue, the actual test result is: setuptools>72.1.0 not compatible with old version of wheel, we may need to pin the setuptools version at 72.1.0 in azdev. Upgrading setuptools and wheel is not an easy task and cannot be done in the short term, we have no choice.

image image

image image

vilit1 commented 1 month ago

I am also seeing the same issue: image

Elsie4ever commented 1 month ago

I'm also getting the same issue in github runner image

bebound commented 1 month ago

For now, we have to pin setuptools to 70.0.0 like https://github.com/Azure/azure-cli-extensions/pull/7739

I hope the extension can stop using wheel 0.30.0 someday.