Skip to content

Commit

Permalink
Fix(plugins): Remove wrong 3.9 deprecation warning (aristanetworks#3484)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc authored Jan 11, 2024
1 parent ac88de8 commit a6a59b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@ def _validate_python_version(info: dict, result: dict) -> bool:
if sys.version_info < MIN_PYTHON_SUPPORTED_VERSION:
display.error(f"Python Version running {running_version} - Minimum Version required is {min_version}", False)
return False
elif sys.version_info[:2] == MIN_PYTHON_SUPPORTED_VERSION:
result.setdefault("deprecations", []).append(
{
"msg": (
f"You are currently running Python {running_version}. The next minor release of AVD after November 6th 2023 will drop support for Python"
f" {min_version} as it will be dropping support for ansible-core<2.14 and ansible-core>=2.14 does not support Python {min_version} as"
" documented here: https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix"
)
}
)
# Keeping this for next deprecation adjust the message as required
# elif sys.version_info[:2] == MIN_PYTHON_SUPPORTED_VERSION:
# result.setdefault("deprecations", []).append(
# {
# "msg": (
# f"You are currently running Python {running_version}. The next minor release of AVD after November 6th 2023 will drop support for Python"
# f" {min_version} as it will be dropping support for ansible-core<2.14 and ansible-core>=2.14 does not support Python {min_version} as"
# " documented here: https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix"
# )
# }
# )

return True

Expand Down Expand Up @@ -187,7 +188,7 @@ def _validate_ansible_version(collection_name: str, running_version: str, info:
False,
)
return False
# TODO remove this once dropping support of ansible-core<2.14 as the previous if will catch it.
# Keeping this for next deprecation - set the value of deprecation_specifiers_set when needed and adjust message
elif not deprecation_specifiers_set.contains(running_version):
result.setdefault("deprecations", []).append(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def test__validate_python_version(mocked_version, expected_return):
"serial": mocked_version[4],
}
assert bool(info["python_path"])
if mocked_version[:2] == MIN_PYTHON_SUPPORTED_VERSION:
# Check for depreecation of PYTHON 3.8
assert len(result["deprecations"]) == 1
# if mocked_version[:2] == MIN_PYTHON_SUPPORTED_VERSION:
# # Check for depreecation of PYTHON 3.8
# assert len(result["deprecations"]) == 1


@pytest.mark.parametrize(
Expand Down

0 comments on commit a6a59b2

Please sign in to comment.