Skip to content
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

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

Open
wangzelin007 opened this issue Jun 25, 2024 · 3 comments
Open

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

wangzelin007 opened this issue Jun 25, 2024 · 3 comments
Assignees
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team feature-request This issue requires a new behavior in the product in order be resolved.
Milestone

Comments

@wangzelin007
Copy link
Member

wangzelin007 commented Jun 25, 2024

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:
pypa/setuptools#4369
Wheel version higher than 0.30.0 has removed metadata.json from the generated files in .dist-info
pypa/wheel#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.

azure-cli-extensions:


pip install wheel==0.30.0 requests packaging setuptools
https://github.com/Azure/azure-cli-extensions/blob/main/azure-pipelines.yml#L79
pip install wheel==0.30.0
https://github.com/Azure/azure-cli-extensions/blob/main/azure-pipelines.yml#L104-L105
get_ext_metadata: WHL_METADATA_FILENAME = 'metadata.json'
https://github.com/Azure/azure-cli-extensions/blob/main/scripts/ci/util.py#L57

azure-cli:
self.assertNotIn('metadata.json', os.listdir(os.path.join(self.ext_dir, ext_name + '-' + ext_version)))
https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/azure/cli/core/extension/tests/latest/test_dev_type_extension.py#L42
self.assertIn('metadata.json', os.listdir(os.path.join(self.ext_dir, dist_info)))
https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/azure/cli/core/extension/tests/latest/test_wheel_type_extension.py#L46
self.assertNotIn('metadata.json', os.listdir(os.path.join(self.ext_dir, dist_info)))
https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/azure/cli/core/extension/tests/latest/test_wheel_type_extension.py#L77
self.assertNotIn('metadata.json', os.listdir(os.path.join(self.ext_dir, ext_name + '-' + ext_version)))
https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/azure/cli/core/extension/tests/latest/test_wheel_type_extension.py#L105
get_cli_dependencies: whl_metadata_filepath = os.path.join(tmp_dir, dist_info_dir, 'metadata.json')
https://github.com/Azure/azure-cli/blob/50ccb24528eb36529d1432808f3ff385cc4c04aa/tools/automation/verify/default_modules.py#L33
pip install setuptools==70.0.0 wheel==0.30.0
https://github.com/Azure/azure-cli/blob/bf7352f1e9d20ff04c2f7cf5dd7c1b0988ce96c1/azure-pipelines.yml#L1176

azdev:
'wheel==0.30.0',
https://github.com/Azure/azure-cli-dev-tools/blob/8aa045a249297d063334c89f3d70f1e84c678007/setup.py#L89
get_ext_metadata: WHL_METADATA_FILENAME = 'metadata.json'
https://github.com/Azure/azure-cli-dev-tools/blob/dev/azdev/operations/extensions/util.py#L48

Related command

az extension add
az extension list
az extension list-available
az extension remove
az extension show
az extension update
azdev extension build
azdev extension publish
azdev extension update-index

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

@wangzelin007 wangzelin007 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jun 25, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Jun 25, 2024

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

@wangzelin007 wangzelin007 self-assigned this Jun 25, 2024
@yonzhan yonzhan added this to the Backlog milestone Jun 25, 2024
@yonzhan yonzhan added feature-request This issue requires a new behavior in the product in order be resolved. Azure CLI Team The command of the issue is owned by Azure CLI team and removed bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Jun 25, 2024
@wangzelin007
Copy link
Member Author

Azure/azure-cli#29467

@wangzelin007
Copy link
Member Author

Azure/azure-cli#29421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team feature-request This issue requires a new behavior in the product in order be resolved.
Projects
None yet
Development

No branches or pull requests

2 participants