Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
384 stars 1.25k forks source link

{Package} Upgrade setuptools and wheel to the latest version. #7740

Open wangzelin007 opened 4 months ago

wangzelin007 commented 4 months ago

Describe the bug

The latest setuptools 70.1.0 adds a vendored wheel 0.4.3 to generate wheel and it does not generate metadata.json. Related PR: https://github.com/pypa/setuptools/pull/4369 Wheel version higher than 0.30.0 has removed metadata.json from the generated files in .dist-info https://github.com/pypa/wheel/issues/195

Now we pin the setuptools version to 70.0.0 and the wheel version to 0.30.0 Otherwise the metadata.json file will not be generated in the dist-info directory of the wheel package. We should modify the logic of reading metadata and upgrade setuptools and wheel to the latest versions. Otherwise it will be difficult to maintain the related code. https://github.com/Azure/azure-cli-extensions/blob/main/azure-pipelines.yml#L79 https://github.com/Azure/azure-cli-extensions/blob/main/azure-pipelines.yml#L104-L105 https://github.com/Azure/azure-cli-extensions/blob/main/scripts/ci/util.py#L57 https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/azure/cli/core/extension/tests/latest/test_dev_type_extension.py#L42 https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/azure/cli/core/extension/tests/latest/test_wheel_type_extension.py#L46 https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/azure/cli/core/extension/tests/latest/test_wheel_type_extension.py#L77 https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/azure/cli/core/extension/tests/latest/test_wheel_type_extension.py#L77 https://github.com/Azure/azure-cli-dev-tools/blob/dev/azdev/operations/extensions/util.py#L48

Related command

None

Errors

metadata in the wheel file is: {
  "azext.minCliCoreVersion": "2.56.0",
  "azext.isPreview": true
}
Traceback (most recent call last):
  File "/mnt/vss/_work/1/s/scripts/ci/azdev_linter_style.py", line 290, in <module>
    main()
  File "/mnt/vss/_work/1/s/scripts/ci/azdev_linter_style.py", line 281, in main
    azdev_on_internal_extension(modified_files, azdev_type)
  File "/mnt/vss/_work/1/s/scripts/ci/azdev_linter_style.py", line 233, in azdev_on_internal_extension
    azdev_extension.check_extension_name()
  File "/mnt/vss/_work/1/s/scripts/ci/azdev_linter_style.py", line 116, in check_extension_name
    if metadata['name'] != extension_name:
       ~~~~~~~~^^^^^^^^
KeyError: 'name'

Issue script & Debug output

None

Expected behavior

None

Environment Summary

None

Additional context

No response

yonzhan commented 4 months ago

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

wangzelin007 commented 3 months ago

https://github.com/Azure/azure-cli/issues/29467