Skip to content

Fix DeprecationWarning: distutils Version classes are deprecated #2472

@vfdev-5

Description

@vfdev-5

We need to fix DeprecationWarning: distutils:

  /home/docker/actions-runner/_work/ignite/ignite/tests/ignite/engine/test_create_supervised.py:587: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    @pytest.mark.skipif(LooseVersion(torch.__version__) < LooseVersion("1.6.0"), reason="Skip if < 1.6.0")
  • In the CI and in the code

In addition to the code change we have to figure out if we need to add packaging as a dependency.
It is most probably brought with some other packages but we have to ensure that on a clean environment it is (or not) installed together with for example pytorch.


packaging is not installed with torch cpu on Ubuntu, checked ubuntu:latest docker container.

apt-get install -y python3 python3-pip
python3 --version
Python 3.8.10

pip3 install torch -f https://download.pytorch.org/whl/cpu/torch_stable.html
pip3 list | grep torch
torch             1.10.2+cp

python3 -c "import packaging"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'packaging'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions