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

ci: Fix imgtool CI workflow on main branch #1558

Closed
wants to merge 1 commit into from

Conversation

gustavonihei
Copy link
Collaborator

@gustavonihei gustavonihei commented Dec 21, 2022

Summary

imgtool relies on packaging.version.LegacyVersion to parse image version numbers, and this has been removed in packaging 22.0.
This results in the following error in the Publish step:

+ python ../ci/compare_versions.py --old 1.9.0 --new 1.9.0
Traceback (most recent call last):
  File "/home/runner/work/mcuboot/mcuboot/scripts/../ci/compare_versions.py", line 15, in <module>
    from packaging.version import parse, LegacyVersion
ImportError: cannot import name 'LegacyVersion' from 'packaging.version' (/usr/local/lib/python3.10/dist-packages/packaging/version.py)

https://github.com/mcu-tools/mcuboot/actions/runs/3741361421/jobs/6350869462

Proposed fix based on pypa/pip-audit#427.

Impact

Should have no impact. Patch should bring CI back to normal.

Testing

CI build pass.

imgtool relies on "packaging.version.LegacyVersion" to parse image
version numbers, and this has been removed in packaging 22.0

Signed-off-by: Gustavo Henrique Nihei <[email protected]>
@utzig
Copy link
Member

utzig commented Jan 3, 2023

I think it'd be better to just get rid, of the LegacyVersion import and class check in compare_versions.py. An invalid version would just throw an exception, which is unlikely to happen since we control the versions.

@gustavonihei
Copy link
Collaborator Author

Closing in favor of solution proposed in #1564.

@gustavonihei gustavonihei deleted the bugfix/ci_imgtool branch January 4, 2023 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants