Skip to content

Commit

Permalink
Use packaging.version instead of distutils Version classes
Browse files Browse the repository at this point in the history
Resolves the following warning:
  /usr/local/lib/python3.10/dist-packages/horovod/tensorflow/elastic.py:28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  • Loading branch information
njzjz committed Sep 14, 2022
1 parent 94529cc commit 7a230f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions horovod/tensorflow/elastic.py
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
# ==============================================================================

from distutils.version import LooseVersion
from packaging.version import parse

import tensorflow as tf

Expand All @@ -25,7 +25,7 @@
from horovod.tensorflow.mpi_ops import _executing_eagerly, init, rank, shutdown


_IS_TF2 = LooseVersion(tf.__version__) >= LooseVersion('2.0.0')
_IS_TF2 = parse(tf.__version__) >= parse('2.0.0')


def run(func):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -154,7 +154,7 @@ def build_extensions(self):


# python packages required to use horovod in general
require_list = ['cloudpickle', 'psutil', 'pyyaml', 'dataclasses;python_version<"3.7"']
require_list = ['cloudpickle', 'psutil', 'pyyaml', 'dataclasses;python_version<"3.7"', 'packaging']

# framework dependencies
tensorflow_require_list = ['tensorflow']
Expand Down

0 comments on commit 7a230f0

Please sign in to comment.