• 
      

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

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

    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.

    Commits

    Files