Attempt to reland #99549, but using packaging.version instead of looseversion, based on the usage used for LLDB in #93712.