-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Packaging} Hotfix: Only remove dist-info for azure packages in MSI
#17432
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
Conversation
dist-info for azure packagesdist-info for azure packages in MSI
| #az self-test --debug | ||
| #if [ $? != 0 ] | ||
| #then | ||
| # exit_code=1 | ||
| # echo "Failed to verify:" $ext | ||
| #fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment az self-test as it cannot pass on ADO. The issue is caused by extensions azure-iot and arcappliance both have jsonschema dependency but with different versions. On ADO, azure-iot is now always installed before arcappliance (the install order is decided by os.listdir(ext_dir) which is related to the order of how files are stored in the file system). Their directory are both appended to sys.path, and azure-iot is in front of arcappliance. Therefore, in arcappliance, when importing jsonschema, it will import from the one (version 3.0.2) installed in azure-iot and this line of code caused an import issue: __version__ = get_distribution(__name__).version.
If on some system, arcappliance is installed before azure-iot, no error will be thrown as arcappliance uses jsonschema version 3.2.0 and the code to get version changes to __version__ = metadata.version("jsonschema").
Actually, az self-test should not load all extensions together, sys.path will append all extension directories, and causing issues like above for the same dependency but with different versions in different extensions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is caused by extensions
azure-iotandarcapplianceboth havejsonschemadependency but with different versions.
Yes, azure-iot/jsonschema (3.0.2) overriding arcappliance/jsonschema (3.2.0) is an important contributing factor. I provided more detail at #17456
Actually,
az self-testshould not load all extensions together
It is possible for CLI to load multiple extensions at the same time - when command index has not been built yet.
Description
az extension add -n rdbms-connectfailed with the latest MSI. It's caused by the removal ofdist-infofolder ofsetuptools,failing the installation of the
configobjectpackage from source code. Theentry_points.txtfile underdist-infofolder ofsetuptoolsis needed during python source package installation. Without it, the following error will be thrown:There are also some other packages that use
entry_points.txt. This PR changes the packaging script to only removedist-infofolder of azure packages which should only have some metadata and not used when the packages are called.Testing Guide
Download and install the MSI in this PR and run
az extension add -n rdbms-connect.History Notes
[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.