Skip to content

Commit

Permalink
drop Python 3.8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
gruebel committed Jan 6, 2025
1 parent 2776d92 commit 895b7f9
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 61 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nodejs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
- master
pull_request:

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['18', '20']

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on:
types: [published]
workflow_dispatch:

permissions:
contents: read

env:
MIN_PYTHON_VERSION: "3.9"

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -16,7 +22,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.8'
python-version: ${{ env.MIN_PYTHON_VERSION }}

- name: Install dependencies
run: |
Expand All @@ -39,7 +45,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.8'
python-version: ${{ env.MIN_PYTHON_VERSION }}

- name: Install dependencies
run: |
Expand All @@ -61,12 +67,14 @@ jobs:
update-brew:
needs: publish-package
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.8'
python-version: ${{ env.MIN_PYTHON_VERSION }}
- name: publish brew
run: |
sleep 5m
Expand All @@ -87,6 +95,8 @@ jobs:
bump-version:
runs-on: ubuntu-latest
needs: update-brew
permissions:
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/python-dependency-updater.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
push:
branches:
- master

permissions:
contents: read

jobs:
detect-secrets:
runs-on: ubuntu-latest
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ on:
- master
pull_request:

permissions:
contents: read

env:
MIN_PYTHON_VERSION: "3.9"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.8' # needed for 'pyupgrade'
python-version: ${{ env.MIN_PYTHON_VERSION }}
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

ci:
Expand All @@ -28,7 +34,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.8'
python-version: ${{ env.MIN_PYTHON_VERSION }}

- name: Install dependencies
run: |
Expand All @@ -54,7 +60,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
python: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/update-bundle-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
- cron: '0 0 1 * *'
workflow_dispatch:

permissions:
contents: read

env:
MIN_PYTHON_VERSION: "3.9"

jobs:
update:
runs-on: ubuntu-latest
Expand All @@ -15,7 +21,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.8'
python-version: ${{ env.MIN_PYTHON_VERSION }}

- name: Install dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/rhysd/actionlint
rev: v1.7.1
rev: v1.7.6
hooks:
- id: actionlint-docker
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.2
rev: v0.8.6
hooks:
- id: ruff
files: ^(cloudsplaining/|setup.py)
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8
3.9
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
version: 2

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.8"
python: "3.9"

mkdocs:
configuration: mkdocs.yml
Expand Down
2 changes: 1 addition & 1 deletion cloudsplaining/bin/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# pylint: disable=missing-module-docstring
__version__ = "0.7.1"
__version__ = "0.8.0"
6 changes: 4 additions & 2 deletions cloudsplaining/output/policy_finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
from __future__ import annotations

import logging
from typing import Any
from typing import TYPE_CHECKING, Any

from cloudsplaining.scan.policy_document import PolicyDocument
from cloudsplaining.shared.constants import (
ACTIONS_THAT_RETURN_CREDENTIALS,
ISSUE_SEVERITY,
Expand All @@ -23,6 +22,9 @@
is_name_excluded,
)

if TYPE_CHECKING:
from cloudsplaining.scan.policy_document import PolicyDocument

logger = logging.getLogger(__name__)


Expand Down
8 changes: 5 additions & 3 deletions cloudsplaining/scan/group_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
from __future__ import annotations

import json
from typing import Any
from typing import TYPE_CHECKING, Any

from cloudsplaining.scan.inline_policy import InlinePolicy
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
from cloudsplaining.scan.statement_detail import StatementDetail
from cloudsplaining.shared import utils
from cloudsplaining.shared.exceptions import NotFoundException
from cloudsplaining.shared.exclusions import DEFAULT_EXCLUSIONS, Exclusions
Expand All @@ -18,6 +16,10 @@
is_aws_managed,
)

if TYPE_CHECKING:
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
from cloudsplaining.scan.statement_detail import StatementDetail


class GroupDetailList:
"""Processes all entries under the GroupDetailList"""
Expand Down
2 changes: 1 addition & 1 deletion cloudsplaining/scan/resource_policy_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"saml:aud": "saml-endpoint",
}
RELEVANT_CONDITION_OPERATORS_PATTERN = re.compile(
"((ForAllValues|ForAnyValue):)?(ARN(Equals|Like)|String(Equals|Like)(IgnoreCase)?|IpAddress)(IfExists)?",
r"((ForAllValues|ForAnyValue):)?(ARN(Equals|Like)|String(Equals|Like)(IgnoreCase)?|IpAddress)(IfExists)?",
re.IGNORECASE,
)

Expand Down
8 changes: 5 additions & 3 deletions cloudsplaining/scan/role_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

import json
import logging
from typing import Any
from typing import TYPE_CHECKING, Any

from cloudsplaining.scan.assume_role_policy_document import AssumeRolePolicyDocument
from cloudsplaining.scan.inline_policy import InlinePolicy
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
from cloudsplaining.scan.statement_detail import StatementDetail
from cloudsplaining.shared import utils
from cloudsplaining.shared.exceptions import NotFoundException
from cloudsplaining.shared.exclusions import (
Expand All @@ -24,6 +22,10 @@
is_aws_managed,
)

if TYPE_CHECKING:
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
from cloudsplaining.scan.statement_detail import StatementDetail

logger = logging.getLogger(__name__)


Expand Down
10 changes: 6 additions & 4 deletions cloudsplaining/scan/user_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
from __future__ import annotations

import json
from typing import Any
from typing import TYPE_CHECKING, Any

from cloudsplaining.scan.group_details import GroupDetail, GroupDetailList
from cloudsplaining.scan.inline_policy import InlinePolicy
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
from cloudsplaining.scan.statement_detail import StatementDetail
from cloudsplaining.shared import utils
from cloudsplaining.shared.exceptions import NotFoundException
from cloudsplaining.shared.exclusions import DEFAULT_EXCLUSIONS, Exclusions
Expand All @@ -19,6 +16,11 @@
is_aws_managed,
)

if TYPE_CHECKING:
from cloudsplaining.scan.group_details import GroupDetail, GroupDetailList
from cloudsplaining.scan.managed_policy_detail import ManagedPolicyDetails
from cloudsplaining.scan.statement_detail import StatementDetail


class UserDetailList:
"""Processes all entries under the UserDetailList"""
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ignore_missing_imports = true

[tool.ruff]
line-length = 120
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
preview = true
Expand All @@ -38,12 +38,15 @@ select = [
"S",
"SIM",
"T10",
"TC",
"UP",
"W",
"YTT",
]
ignore = ["E501"] # ruff fromat takes care of it

fixable = ["I001"]

[tool.pytest.ini_options]
testpaths = [
"test",
Expand Down
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# CI
pre-commit==3.5.0 # 3.6+ requires Python 3.9
pre-commit==4.0.1
# Unit testing
pytest==8.3.4
coverage==7.6.1
coverage==7.6.10
# type check
mypy==1.14.1
mypy[faster-cache]==1.14.1
boto3-stubs-lite[iam,s3,sts]==1.35.70
types-PyYAML==6.0.12.20241230
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ pyyaml==6.0.2
# We render Markdown glossary files as HTML in the Cloudsplaining report
markdown==3.7
# AWS IAM Logic
policy-sentry==0.13.2
policy-sentry==0.14.0
# Schema validation
schema==0.7.7
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"click_option_group",
"jinja2",
"markdown",
"policy_sentry>=0.13.0,<0.14",
"policy_sentry>=0.14.0,<0.15",
"pyyaml",
"schema",
]
Expand Down Expand Up @@ -57,7 +57,6 @@ def get_description() -> str:
project_urls=PROJECT_URLS,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down

0 comments on commit 895b7f9

Please sign in to comment.