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

fix(release): Update merge_package.py #9694

Merged
merged 1 commit into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/scripts/merge_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# Written by Ivan Grokhotkov, 2015
#
from __future__ import print_function
from distutils.version import LooseVersion
#from distutils.version import LooseVersion
from packaging.version import Version
import re
import json
import sys
Expand Down Expand Up @@ -33,7 +34,7 @@ def merge_objects(versions, obj):
def pkgVersionNormalized(versionString):

verStr = str(versionString)
verParts = re.split('\.|-rc', verStr, flags=re.IGNORECASE)
verParts = re.split('\.|-rc|-alpha', verStr, flags=re.IGNORECASE)

if len(verParts) == 3:
if (sys.version_info > (3, 0)): # Python 3
Expand Down Expand Up @@ -74,7 +75,8 @@ def main(args):
print("Adding platform {0}-{1}".format(name, version), file=sys.stderr)
pkg1['platforms'].append(platforms[name][version])

pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: LooseVersion(pkgVersionNormalized(k['version'])), reverse=True)
#pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: LooseVersion(pkgVersionNormalized(k['version'])), reverse=True)
pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: Version(pkgVersionNormalized(k['version'])), reverse=True)

json.dump({'packages':[pkg1]}, sys.stdout, indent=2)

Expand Down