Skip to content

Commit

Permalink
Add sanity ignores for 2.12 and 2.13 (#249)
Browse files Browse the repository at this point in the history
* Adding stable-2.13.0rc1 to sanity matrix

* Adding stable-2.13.0rc1 to units matrix

* Fixing sanity compile on py2.6, 2.7, and 3.5

* Nevermind stable-2.13.0rc1

* Adding ignores for 2.12

* Reverting the Spaces modules

* Do a naive version check on dopy

* Adding ignores for sanity 2.13

* Adding a changelog fragment

* Try packaging.version before naive

* Fix tense and capitalization
  • Loading branch information
mamercad authored Jun 24, 2022
1 parent a03f09c commit b551430
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/247-sanity-checks-2.12-13.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- digital_ocean - add sanity test ignores for Ansible 2.12 and 2.13 (https://github.com/ansible-collections/community.digitalocean/issues/247).
17 changes: 14 additions & 3 deletions plugins/modules/digital_ocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@
import time
import traceback

from distutils.version import LooseVersion
try:
from packaging.version import Version

HAS_PACKAGING = True
except ImportError:
HAS_PACKAGING = False

try:
# Imported as a dependency for dopy
Expand All @@ -204,8 +209,14 @@
import dopy
from dopy.manager import DoError, DoManager

if LooseVersion(dopy.__version__) >= LooseVersion("0.3.2"):
HAS_DOPY = True
# NOTE: Expressing Python dependencies isn't really possible:
# https://github.com/ansible/ansible/issues/62733#issuecomment-537098744
if HAS_PACKAGING:
if Version(dopy.__version__) >= Version("0.3.2"):
HAS_DOPY = True
else:
if dopy.__version__ >= "0.3.2": # Naive lexographical check
HAS_DOPY = True
except ImportError:
pass

Expand Down
12 changes: 12 additions & 0 deletions tests/sanity/ignore-2.12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins/modules/digital_ocean_spaces.py compile-2.6!skip
plugins/modules/digital_ocean_spaces_info.py compile-2.6!skip
plugins/modules/digital_ocean_spaces.py compile-2.7!skip
plugins/modules/digital_ocean_spaces_info.py compile-2.7!skip
plugins/modules/digital_ocean_spaces.py compile-3.5!skip
plugins/modules/digital_ocean_spaces_info.py compile-3.5!skip
plugins/modules/digital_ocean_spaces.py import-2.6!skip
plugins/modules/digital_ocean_spaces_info.py import-2.6!skip
plugins/modules/digital_ocean_spaces.py import-2.7!skip
plugins/modules/digital_ocean_spaces_info.py import-2.7!skip
plugins/modules/digital_ocean_spaces.py import-3.5!skip
plugins/modules/digital_ocean_spaces_info.py import-3.5!skip
8 changes: 8 additions & 0 deletions tests/sanity/ignore-2.13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins/modules/digital_ocean_spaces.py compile-2.7!skip
plugins/modules/digital_ocean_spaces_info.py compile-2.7!skip
plugins/modules/digital_ocean_spaces.py compile-3.5!skip
plugins/modules/digital_ocean_spaces_info.py compile-3.5!skip
plugins/modules/digital_ocean_spaces.py import-2.7!skip
plugins/modules/digital_ocean_spaces_info.py import-2.7!skip
plugins/modules/digital_ocean_spaces.py import-3.5!skip
plugins/modules/digital_ocean_spaces_info.py import-3.5!skip

0 comments on commit b551430

Please sign in to comment.