Skip to content

Commit

Permalink
Drop support for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Dec 23, 2024
1 parent 39192e1 commit f3064a5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 24 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ Tested with the Ansible Core >= 2.15.0 versions, and the current development ver

This collection depends on the AWS SDK for Python (Boto3 and Botocore). Due to the
[AWS SDK Python Support Policy](https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/)
this collection requires Python 3.7 or greater.
this collection requires Python 3.8 or greater.

Amazon has also announced the planned end of support for
[Python less than 3.8](https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/).
As such support for Python less than 3.8 will be removed in a release after 2024-12-01.
[Python less than 3.9](https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/).
As such support for Python less than 3.9 will be removed in a release after 2026-05-01.

<!---
### End of Support by Python Versions:
Expand Down
4 changes: 4 additions & 0 deletions changelogs/fragments/botocore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ major_changes:
with older versions of the AWS SDK, however compatibility with older versions
of the SDK is not guaranteed and will not be tested. When using older versions
of the SDK a warning will be emitted by Ansible (https://github.com/ansible-collections/amazon.aws/pull/2426).
- amazon.aws collection - due to the AWS SDKs announcing the end of support for Python less than 3.8
(https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/) support for Python
less than 3.8 by this collection was deprecated in release 6.0.0 and removed in release 10.0.0.
(https://github.com/ansible-collections/amazon.aws/pull/2426).
2 changes: 1 addition & 1 deletion tests/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
modules:
python_requires: ">=3.7"
python_requires: ">=3.8"
6 changes: 1 addition & 5 deletions tests/unit/module_utils/test_rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

import sys
from contextlib import nullcontext
from unittest.mock import MagicMock
from unittest.mock import patch

import pytest

if sys.version_info < (3, 7):
pytest.skip("contextlib.nullcontext was introduced in Python 3.7", allow_module_level=True)

from contextlib import nullcontext

try:
import botocore
except ImportError:
Expand Down
12 changes: 0 additions & 12 deletions tests/unit/plugins/modules/ec2_security_group/test_expand_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@ def test_expand_ports_list(rule, expected):
assert ec2_security_group_module.expand_ports_list(rule) == expected


@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="requires Python 3.7 or higher - sentinel doesn't behave well with deepcopy in Python 3.6",
)
@pytest.mark.parametrize("source_type", sorted(ec2_security_group_module.SOURCE_TYPES_ALL))
def test_strip_rule_source(source_type):
rule = {source_type: sentinel.SOURCE_VALUE}
Expand All @@ -202,10 +198,6 @@ def test_strip_rule_source(source_type):
assert rule == {source_type: sentinel.SOURCE_VALUE, "sentinel": sentinel.SENTINEL_VALUE}


@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="requires Python 3.7 or higher - sentinel doesn't behave well with deepcopy in Python 3.6",
)
@pytest.mark.parametrize("port_type", sorted(ec2_security_group_module.PORT_TYPES_ALL))
def test_strip_rule_port(port_type):
rule = {port_type: sentinel.PORT_VALUE}
Expand All @@ -217,10 +209,6 @@ def test_strip_rule_port(port_type):
assert rule == {port_type: sentinel.PORT_VALUE, "sentinel": sentinel.SENTINEL_VALUE}


@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="requires Python 3.7 or higher - sentinel doesn't behave well with deepcopy in Python 3.6",
)
@pytest.mark.parametrize("rule, expected", RULE_EXPANSION)
def test_rule_expand(rule, expected):
assert ec2_security_group_module.expand_rule(rule) == expected
Expand Down
8 changes: 5 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
skipsdist = True
skip_missing_interpreters = True
envlist =
clean
ansible{2.15}-py{39,310,311}-{with_constraints,without_constraints}
ansible{2.16,2.17}-py{310,311,312}-{with_constraints,without_constraints}
ansible{2.18}-py{311,312,313}-{with_constraints,without_constraints}
Expand Down Expand Up @@ -60,11 +59,13 @@ commands =
{posargs:tests/}

[testenv:clean]
description = Remove coverage test data
description = Remove test results and caches
allowlist_externals = rm
deps = coverage
skip_install = true
commands =
coverage erase
rm -rf tests/output/ htmlcov/ .mypy_cache/ complexity/

[testenv:complexity-report]
labels = lint
Expand Down Expand Up @@ -198,7 +199,8 @@ commands_pre =
commands =
cd {[mypy]full_tmp_path}
mypy \
--check-untyped-defs \
--namespace-packages --explicit-package-bases \
--follow-imports silent \
{posargs:plugins/module_utils}
{posargs:plugins/module_utils plugins/plugin_utils}
# start with module_utils, expand later

0 comments on commit f3064a5

Please sign in to comment.