Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
b3ad98cb
Unverified
Commit
b3ad98cb
authored
May 27, 2024
by
Me No Dev
Committed by
GitHub
May 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(release): Update merge_package.py (#9694)
Use packaging.version instead of the deprecated distutils.version
parent
d94b32ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
.github/scripts/merge_packages.py
.github/scripts/merge_packages.py
+5
-3
No files found.
.github/scripts/merge_packages.py
View file @
b3ad98cb
...
...
@@ -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
...
...
@@ -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
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment