Skip to content

Commit 784ad30

Browse files
committed
Remove use of deprecated package distutils
1 parent ad286d0 commit 784ad30

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ project.ext {
291291
// Pip binary after it has been bootstrapped.
292292
pipExe = new File(pythonBinDir, "pip3")
293293
// Python packages required by export_unity_package.py
294-
exportUnityPackageRequirements = ["absl-py", "PyYAML"]
294+
exportUnityPackageRequirements = ["absl-py", "PyYAML", "packaging"]
295295
// Python packages required by gen_guids.py
296296
genGuidRequirements = ["absl-py"]
297297
}

source/ExportUnityPackage/export_unity_package.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
from absl import app
294294
from absl import flags
295295
from absl import logging
296-
import distutils.version
296+
import packaging.version
297297
import yaml
298298

299299
FLAGS = flags.FLAGS
@@ -983,11 +983,11 @@ def __init__(self, duplicate_guids_checker, guids_json,
983983

984984
if plugin_version:
985985
# Aggregate guids for older versions of files.
986-
current_version = distutils.version.LooseVersion(plugin_version)
987-
for version in sorted(guids_json, key=distutils.version.LooseVersion,
986+
current_version = packaging.version.Version(plugin_version)
987+
for version in sorted(guids_json, key=packaging.version.Version,
988988
reverse=True):
989989
# Skip all versions after and including the current version.
990-
if distutils.version.LooseVersion(version) >= current_version:
990+
if packaging.version.Version(version) >= current_version:
991991
continue
992992
# Add all guids for files to the current version.
993993
guids_by_filename = guids_json[version]

0 commit comments

Comments
 (0)