| Summary: | layerindex: update_layer.py remove use of deprecated pkg_resources | ||
|---|---|---|---|
| Product: | [Yocto Project Subprojects] Layer Index | Reporter: | Tim Orling <tim.orling> |
| Component: | Layer Index | Assignee: | Tim Orling <tim.orling> |
| Status: | RESOLVED FIXED | QA Contact: | apoorv sangal <apoorvsangal> |
| Severity: | normal | ||
| Priority: | Medium | ||
| Version: | 5.0 | ||
| Target Milestone: | 5.0 M3 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
|
Description
Tim Orling
2024-01-17 01:31:19 UTC
packaging.version.parse() seemed like a good replacement, but it cannot handle versions like autotools (2.72d) since it does not match the PEP-440 patterns for allowed Python package versions. https://github.com/pypa/packaging/issues/631 https://packaging.python.org/en/latest/specifications/version-specifiers/#summary-of-differences-from-pkg-resources-parse-version "This specification purposely restricts the syntax which constitutes a valid version while pkg_resources.parse_version attempts to provide some meaning from any arbitrary string." Which means that any Python which has "packaging" >= 22 will no longer parse LegacyVersion() and it throws an InvalidVersion exception with "packaging" == 21 Invalid version: '2.72e' Probably better off using the vercmp code from lib/bb/utils.py. pypi.org has a similar problem of needing the LegacyVersion behavior, so we use their packaging_legacy instead in v2: https://patchwork.yoctoproject.org/project/yocto/patch/20240123001125.1470142-1-tim.orling@konsulko.com/ |