Skip to content

Commit 895b7f9

Browse files
committed
drop Python 3.8 support
1 parent 2776d92 commit 895b7f9

19 files changed

+72
-61
lines changed

.github/workflows/nodejs-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ on:
88
- master
99
pull_request:
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
build:
13-
1416
runs-on: ubuntu-latest
15-
1617
strategy:
1718
matrix:
1819
node-version: ['18', '20']
19-
2020
steps:
2121
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222
- name: Use Node.js ${{ matrix.node-version }}

.github/workflows/publish.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
types: [published]
88
workflow_dispatch:
99

10+
permissions:
11+
contents: read
12+
13+
env:
14+
MIN_PYTHON_VERSION: "3.9"
15+
1016
jobs:
1117
test:
1218
runs-on: ubuntu-latest
@@ -16,7 +22,7 @@ jobs:
1622
- name: Setup Python
1723
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
1824
with:
19-
python-version: '3.8'
25+
python-version: ${{ env.MIN_PYTHON_VERSION }}
2026

2127
- name: Install dependencies
2228
run: |
@@ -39,7 +45,7 @@ jobs:
3945
- name: Set up Python
4046
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
4147
with:
42-
python-version: '3.8'
48+
python-version: ${{ env.MIN_PYTHON_VERSION }}
4349

4450
- name: Install dependencies
4551
run: |
@@ -61,12 +67,14 @@ jobs:
6167
update-brew:
6268
needs: publish-package
6369
runs-on: ubuntu-latest
70+
permissions:
71+
contents: write
6472
steps:
6573
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6674
- name: Set up Python
6775
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
6876
with:
69-
python-version: '3.8'
77+
python-version: ${{ env.MIN_PYTHON_VERSION }}
7078
- name: publish brew
7179
run: |
7280
sleep 5m
@@ -87,6 +95,8 @@ jobs:
8795
bump-version:
8896
runs-on: ubuntu-latest
8997
needs: update-brew
98+
permissions:
99+
contents: write
90100
steps:
91101
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
92102
with:

.github/workflows/python-dependency-updater.yml

-25
This file was deleted.

.github/workflows/security.yml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
push:
88
branches:
99
- master
10+
11+
permissions:
12+
contents: read
13+
1014
jobs:
1115
detect-secrets:
1216
runs-on: ubuntu-latest

.github/workflows/test.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@ on:
88
- master
99
pull_request:
1010

11+
permissions:
12+
contents: read
13+
14+
env:
15+
MIN_PYTHON_VERSION: "3.9"
16+
1117
jobs:
1218
pre-commit:
1319
runs-on: ubuntu-latest
1420
steps:
1521
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1622
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
1723
with:
18-
python-version: '3.8' # needed for 'pyupgrade'
24+
python-version: ${{ env.MIN_PYTHON_VERSION }}
1925
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
2026

2127
ci:
@@ -28,7 +34,7 @@ jobs:
2834
- name: Setup Python
2935
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
3036
with:
31-
python-version: '3.8'
37+
python-version: ${{ env.MIN_PYTHON_VERSION }}
3238

3339
- name: Install dependencies
3440
run: |
@@ -54,7 +60,7 @@ jobs:
5460
strategy:
5561
fail-fast: true
5662
matrix:
57-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
63+
python: ['3.10', '3.11', '3.12', '3.13']
5864
steps:
5965
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6066
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0

.github/workflows/update-bundle-report.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
- cron: '0 0 1 * *'
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
12+
env:
13+
MIN_PYTHON_VERSION: "3.9"
14+
915
jobs:
1016
update:
1117
runs-on: ubuntu-latest
@@ -15,7 +21,7 @@ jobs:
1521
- name: Setup python
1622
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
1723
with:
18-
python-version: '3.8'
24+
python-version: ${{ env.MIN_PYTHON_VERSION }}
1925

2026
- name: Install dependencies
2127
run: |

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
repos:
22
- repo: https://github.com/rhysd/actionlint
3-
rev: v1.7.1
3+
rev: v1.7.6
44
hooks:
55
- id: actionlint-docker
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: v0.6.2
7+
rev: v0.8.6
88
hooks:
99
- id: ruff
1010
files: ^(cloudsplaining/|setup.py)

.python-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8
1+
3.9

.readthedocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
version: 2
66

77
build:
8-
os: ubuntu-22.04
8+
os: ubuntu-24.04
99
tools:
10-
python: "3.8"
10+
python: "3.9"
1111

1212
mkdocs:
1313
configuration: mkdocs.yml

cloudsplaining/bin/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# pylint: disable=missing-module-docstring
2-
__version__ = "0.7.1"
2+
__version__ = "0.8.0"

cloudsplaining/output/policy_finding.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
from __future__ import annotations
99

1010
import logging
11-
from typing import Any
11+
from typing import TYPE_CHECKING, Any
1212

13-
from cloudsplaining.scan.policy_document import PolicyDocument
1413
from cloudsplaining.shared.constants import (
1514
ACTIONS_THAT_RETURN_CREDENTIALS,
1615
ISSUE_SEVERITY,
@@ -23,6 +22,9 @@
2322
is_name_excluded,
2423
)
2524

25+
if TYPE_CHECKING:
26+
from cloudsplaining.scan.policy_document import PolicyDocument
27+
2628
logger = logging.getLogger(__name__)
2729

2830

cloudsplaining/scan/group_details.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
from __future__ import annotations
44

55
import json
6-
from typing import Any
6+
from typing import TYPE_CHECKING, Any
77

88
from cloudsplaining.scan.inline_policy import InlinePolicy
9-
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
10-
from cloudsplaining.scan.statement_detail import StatementDetail
119
from cloudsplaining.shared import utils
1210
from cloudsplaining.shared.exceptions import NotFoundException
1311
from cloudsplaining.shared.exclusions import DEFAULT_EXCLUSIONS, Exclusions
@@ -18,6 +16,10 @@
1816
is_aws_managed,
1917
)
2018

19+
if TYPE_CHECKING:
20+
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
21+
from cloudsplaining.scan.statement_detail import StatementDetail
22+
2123

2224
class GroupDetailList:
2325
"""Processes all entries under the GroupDetailList"""

cloudsplaining/scan/resource_policy_document.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"saml:aud": "saml-endpoint",
2828
}
2929
RELEVANT_CONDITION_OPERATORS_PATTERN = re.compile(
30-
"((ForAllValues|ForAnyValue):)?(ARN(Equals|Like)|String(Equals|Like)(IgnoreCase)?|IpAddress)(IfExists)?",
30+
r"((ForAllValues|ForAnyValue):)?(ARN(Equals|Like)|String(Equals|Like)(IgnoreCase)?|IpAddress)(IfExists)?",
3131
re.IGNORECASE,
3232
)
3333

cloudsplaining/scan/role_details.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44

55
import json
66
import logging
7-
from typing import Any
7+
from typing import TYPE_CHECKING, Any
88

99
from cloudsplaining.scan.assume_role_policy_document import AssumeRolePolicyDocument
1010
from cloudsplaining.scan.inline_policy import InlinePolicy
11-
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
12-
from cloudsplaining.scan.statement_detail import StatementDetail
1311
from cloudsplaining.shared import utils
1412
from cloudsplaining.shared.exceptions import NotFoundException
1513
from cloudsplaining.shared.exclusions import (
@@ -24,6 +22,10 @@
2422
is_aws_managed,
2523
)
2624

25+
if TYPE_CHECKING:
26+
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
27+
from cloudsplaining.scan.statement_detail import StatementDetail
28+
2729
logger = logging.getLogger(__name__)
2830

2931

cloudsplaining/scan/user_details.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
from __future__ import annotations
44

55
import json
6-
from typing import Any
6+
from typing import TYPE_CHECKING, Any
77

8-
from cloudsplaining.scan.group_details import GroupDetail, GroupDetailList
98
from cloudsplaining.scan.inline_policy import InlinePolicy
10-
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
11-
from cloudsplaining.scan.statement_detail import StatementDetail
129
from cloudsplaining.shared import utils
1310
from cloudsplaining.shared.exceptions import NotFoundException
1411
from cloudsplaining.shared.exclusions import DEFAULT_EXCLUSIONS, Exclusions
@@ -19,6 +16,11 @@
1916
is_aws_managed,
2017
)
2118

19+
if TYPE_CHECKING:
20+
from cloudsplaining.scan.group_details import GroupDetail, GroupDetailList
21+
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
22+
from cloudsplaining.scan.statement_detail import StatementDetail
23+
2224

2325
class UserDetailList:
2426
"""Processes all entries under the UserDetailList"""

pyproject.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ignore_missing_imports = true
1414

1515
[tool.ruff]
1616
line-length = 120
17-
target-version = "py38"
17+
target-version = "py39"
1818

1919
[tool.ruff.lint]
2020
preview = true
@@ -38,12 +38,15 @@ select = [
3838
"S",
3939
"SIM",
4040
"T10",
41+
"TC",
4142
"UP",
4243
"W",
4344
"YTT",
4445
]
4546
ignore = ["E501"] # ruff fromat takes care of it
4647

48+
fixable = ["I001"]
49+
4750
[tool.pytest.ini_options]
4851
testpaths = [
4952
"test",

requirements-dev.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# CI
2-
pre-commit==3.5.0 # 3.6+ requires Python 3.9
2+
pre-commit==4.0.1
33
# Unit testing
44
pytest==8.3.4
5-
coverage==7.6.1
5+
coverage==7.6.10
66
# type check
7-
mypy==1.14.1
7+
mypy[faster-cache]==1.14.1
88
boto3-stubs-lite[iam,s3,sts]==1.35.70
99
types-PyYAML==6.0.12.20241230

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ pyyaml==6.0.2
1212
# We render Markdown glossary files as HTML in the Cloudsplaining report
1313
markdown==3.7
1414
# AWS IAM Logic
15-
policy-sentry==0.13.2
15+
policy-sentry==0.14.0
1616
# Schema validation
1717
schema==0.7.7

setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"click_option_group",
2020
"jinja2",
2121
"markdown",
22-
"policy_sentry>=0.13.0,<0.14",
22+
"policy_sentry>=0.14.0,<0.15",
2323
"pyyaml",
2424
"schema",
2525
]
@@ -57,7 +57,6 @@ def get_description() -> str:
5757
project_urls=PROJECT_URLS,
5858
classifiers=[
5959
"Programming Language :: Python :: 3 :: Only",
60-
"Programming Language :: Python :: 3.8",
6160
"Programming Language :: Python :: 3.9",
6261
"Programming Language :: Python :: 3.10",
6362
"Programming Language :: Python :: 3.11",

0 commit comments

Comments
 (0)