Skip to content

Commit

Permalink
Drop usage of distutils and use 'packaging' for version comparison
Browse files Browse the repository at this point in the history
ansible-core also depends on packaging so this seems like a reasonable dependency
  • Loading branch information
matburt committed Feb 12, 2022
1 parent 02c051e commit 47ee0e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions requirements.txt
@@ -1,4 +1,5 @@
pexpect>=4.5
packaging
python-daemon
pyyaml
six
4 changes: 2 additions & 2 deletions test/conftest.py
@@ -1,7 +1,7 @@
import shutil

from pathlib import Path
from distutils.version import LooseVersion
from packaging.version import Version
import subprocess

from ansible_runner import defaults
Expand Down Expand Up @@ -60,7 +60,7 @@ def is_pre_ansible212():
.stdout.strip()
.decode()
)
if LooseVersion(base_version) < LooseVersion("2.12"):
if Version(base_version) < Version("2.12"):
return True
except pkg_resources.DistributionNotFound:
pass
Expand Down
1 change: 1 addition & 0 deletions test/integration/test_display_callback.py
Expand Up @@ -197,6 +197,7 @@ def test_callback_plugin_task_args_leak(executor, playbook):
# make sure playbook was successful, so all tasks were hit
assert not events[-1]['event_data']['failures'], 'Unexpected playbook execution failure'


@pytest.mark.parametrize(
"playbook",
[
Expand Down

0 comments on commit 47ee0e5

Please sign in to comment.