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

Should not import Wheel.Install in test_index.py #6835

Closed
TheOnlyWei opened this issue Oct 5, 2023 · 4 comments · Fixed by #6842
Closed

Should not import Wheel.Install in test_index.py #6835

TheOnlyWei opened this issue Oct 5, 2023 · 4 comments · Fixed by #6842
Assignees
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. Connected Kubernetes Service Attention This issue is responsible by Azure service team.
Milestone

Comments

@TheOnlyWei
Copy link
Contributor

TheOnlyWei commented Oct 5, 2023

Describe the bug

There is an issue with PR checklist command python scripts/ci/test_index.py -q. The script should not import Wheel.Install in test_index.py as Wheel does not have a public API. There is a "regression" in newer Wheel versions after 0.30.0 where test_index.py breaks with the following error:

Traceback (most recent call last):
  File "C:\tasks\TheOnlyWei\azure-cli-extensions\scripts\ci\test_index.py", line 23, in <module>
    from wheel.install import WHEEL_INFO_RE
ModuleNotFoundError: No module named 'wheel.install'

Researched this issue, and here is the official Wheel team response:

As wheel does not have a public API, the developers are not responsible for any breakage caused by internal refactoring. I suggest that you copy the regex to your own app.
pypa/wheel#235

Code with the issue:
https://github.com/Azure/azure-cli-extensions/blob/17c726f5e2770597224a5e48700672f9f5888113/scripts/ci/test_index.py#L23C24-L23C24

Related command

python scripts/ci/test_index.py -q

Errors

Traceback (most recent call last):
  File "C:\tasks\TheOnlyWei\azure-cli-extensions\scripts\ci\test_index.py", line 23, in <module>
    from wheel.install import WHEEL_INFO_RE
ModuleNotFoundError: No module named 'wheel.install'

Issue script & Debug output

No debug needed for this command

Expected behavior

Should not throw an error.

Environment Summary

azure-cli                         2.40.0 *

core                              2.40.0 *
telemetry                          1.0.8 *

Extensions:
account                            0.2.5
arca-extension                     0.0.1
azure-devops                      0.26.0
customlocation                     0.1.3
k8s-configuration                  1.7.0
k8s-extension                      1.4.5
sandbox                            0.0.1
connectedk8s                       1.5.2 (dev) C:\tasks\TheOnlyWei\azure-cli-extensions\src\connectedk8s
k8s-configuration                  1.5.1 (dev) C:\tasks\TheOnlyWei\azure-cli-extensions\src\k8s-configuration
k8s-extension                      1.3.5 (dev) C:\tasks\TheOnlyWei\azure-cli-extensions\src\k8s-extension
storage-blob-preview               0.6.1 (dev) C:\tasks\TheOnlyWei\azure-cli-extensions\src\storage-blob-preview

Dependencies:
msal                            1.18.0b1
azure-mgmt-resource             21.1.0b1

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\weshi1\.azure\cliextensions'
Development extension sources:
    C:\tasks\TheOnlyWei\azure-cli-extensions

Python (Windows) 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 15:58:59) [MSC v.1929 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal


You have 3 update(s) available. Consider updating your CLI installation with 'az upgrade'

Additional context

No response

@TheOnlyWei TheOnlyWei added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 5, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 5, 2023

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

@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Connected Kubernetes Service Attention This issue is responsible by Azure service team. labels Oct 5, 2023
@wangzelin007
Copy link
Member

wangzelin007 commented Oct 8, 2023

@TheOnlyWei,
Thank you for providing the information.
We have pinned wheel to version 0.3.0 due to another issue: wheel no longer contains metadata.json after version 0.3.0

Please use version 0.3.0 for testing before we support the latest version of wheel.

@TheOnlyWei
Copy link
Contributor Author

TheOnlyWei commented Oct 9, 2023

@wangzelin007 The PR template also asks developers to run python scripts/ci/test_index.py -q, but it doesn't tell them what version to use, which was the reason I created this issue.

@wangzelin007
Copy link
Member

@wangzelin007 The PR template also asks developers to run python scripts/ci/test_index.py -q, but it doesn't tell them what version to use, which was the reason I created this issue.

Totally agree, I can optimize the PR template first.
But upgrading the wheel will not only affect this script, but also the installation, upgrade and release of all extensions.
We need more time to fully test before upgrading the wheel.

@yonzhan yonzhan added this to the Backlog milestone Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. Connected Kubernetes Service Attention This issue is responsible by Azure service team.
Projects
None yet
4 participants