-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
{Script} Add retry in get_whl_from_url and only verify latest version of an extension #2987
Conversation
Script |
scripts/ci/test_index.py
Outdated
@@ -21,6 +21,10 @@ | |||
|
|||
from util import get_ext_metadata, get_whl_from_url, get_index_data, verify_dependency | |||
|
|||
# Some extensions are published through manually submitted PRs and the latest version may not be in the end of | |||
# the version list in index.json. Let's just test all versions for these extensions. | |||
EXTS_TEST_ALL_VERSIONS = {'azure-cli-ml', 'alias', 'azure_iot'} |
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.
Maybe we can sort all versions and only test the latest one?
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.
Python's built-in function max
supports a custom key extraction function and we can use packaging.version
for version comparison.
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.
updated with picking a max
version so the order of versions does not matter now.
scripts/ci/test_index.py
Outdated
item['sha256Digest'], | ||
item['filename'])) | ||
# only test the latest version | ||
item = max(exts, key=lambda ext: LooseVersion(ext['metadata']['version'])) |
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.
distutils.version.LooseVersion
is legacy and conformant only to the superseded PEP 386 (by PEP 440). Perhaps we can migrate to the latest packaging.version
.
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.
LooseVersion
doesn't comply with PEP 440 and can't handle pre-release versions.
>>> from distutils.version import LooseVersion, StrictVersion
>>> StrictVersion('1.0.0a1') < StrictVersion('1.0.0')
True
>>> LooseVersion('1.0.0a1') < LooseVersion('1.0.0')
False
To mitigate the increasing failures in
Verify Extensions Index
CI task recently.This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update
src/index.json
automatically.The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify
src/index.json
.