Fix site version parsing in rb-site upgrade with modern packaging libs.

Review Request #13086 — Created May 31, 2023 and submitted

Information

Review Board
release-5.0.x

Reviewers

When running rb-site upgrade, the old site version is checked to see
if certain steps need to be performed. We check the display version of
the site, since that's all that we can pull from siteconfig, and
historically this has worked, with pkg_resources.parse_version()
turning this into a LegacyVersion object.

Unfortunately, this support has been dropped, causing this code path to
fail if running any beta, alpha, RC, or development releases.

To work around this, we now pull out the actual version component (the
part before a space) and compare using that.

Since pkg_resources is deprecated, this also moves our version parsing
to packaging.version.parse instead. This is the first step toward
moving away from pkg_resources.

Tested a site upgrade, verifying that this code path was being executed.
Verified that the version check worked fine on an alpha dev build.

Summary ID
Fix site version parsing in rb-site upgrade with modern packaging libs.
When running `rb-site upgrade`, the old site version is checked to see if certain steps need to be performed. We check the display version of the site, since that's all that we can pull from siteconfig, and historically this has worked, with `pkg_resources.parse_version()` turning this into a `LegacyVersion` object. Unfortunately, this support has been dropped, causing this code path to fail if running any beta, alpha, RC, or development releases. To work around this, we now pull out the actual version component (the part before a space) and compare using that. Since `pkg_resources` is deprecated, this also moves our version parsing to `packaging.version.parse` instead. This is the first step toward moving away from `pkg_resources`.
45e57e8a01db9f731a3f0812caafb91ae1d646ad
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-5.0.x (766b032)
Loading...