Skip to content

Commit 680155d

Browse files
committed
drop Python 3.9 support
1 parent 6260d76 commit 680155d

File tree

23 files changed

+97
-116
lines changed

23 files changed

+97
-116
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
contents: read
1414

1515
env:
16-
MIN_PYTHON_VERSION: "3.9"
16+
MIN_PYTHON_VERSION: "3.10"
1717
TERRAFORM_VERSION: "1.10"
1818

1919
jobs:
@@ -80,7 +80,7 @@ jobs:
8080
strategy:
8181
fail-fast: true
8282
matrix:
83-
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
83+
python: ['3.11', '3.12', '3.13', '3.14']
8484
steps:
8585
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8686
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
contents: read
1212

1313
env:
14-
MIN_PYTHON_VERSION: "3.9"
14+
MIN_PYTHON_VERSION: "3.10"
1515

1616
jobs:
1717
test:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
contents: read
1111

1212
env:
13-
MIN_PYTHON_VERSION: "3.9"
13+
MIN_PYTHON_VERSION: "3.10"
1414

1515
jobs:
1616
python-dependency-updater:

.github/workflows/update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010
contents: read
1111

1212
env:
13-
MIN_PYTHON_VERSION: "3.9"
13+
MIN_PYTHON_VERSION: "3.10"
1414

1515
jobs:
1616
update-actions:

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version: 2
77
build:
88
os: ubuntu-24.04
99
tools:
10-
python: 3.9
10+
python: 3.10
1111

1212
mkdocs:
1313
configuration: mkdocs.yml

policy_sentry/analysis/analyze.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ def analyze_by_access_level(policy_json: dict[str, Any], access_level: str) -> l
3434
expanded_policy = get_expanded_policy(policy_json)
3535
requested_actions = get_actions_from_policy(expanded_policy)
3636
# expanded_actions = determine_actions_to_expand(requested_actions)
37-
actions_by_level = remove_actions_not_matching_access_level(requested_actions, access_level)
38-
return actions_by_level
37+
return remove_actions_not_matching_access_level(requested_actions, access_level)
3938

4039

4140
def analyze_statement_by_access_level(statement_json: dict[str, Any], access_level: str) -> list[str]:
@@ -50,5 +49,4 @@ def analyze_statement_by_access_level(statement_json: dict[str, Any], access_lev
5049
"""
5150
requested_actions = get_actions_from_statement(statement_json)
5251
expanded_actions = determine_actions_to_expand(requested_actions)
53-
actions_by_level = remove_actions_not_matching_access_level(expanded_actions, access_level)
54-
return actions_by_level
52+
return remove_actions_not_matching_access_level(expanded_actions, access_level)

policy_sentry/analysis/expand.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def expand(action: str | list[str]) -> list[str]:
3232

3333
if action == "*":
3434
return list(get_all_actions())
35-
elif "*" in action:
35+
if "*" in action:
3636
service_prefix = action.split(":", maxsplit=1)[0]
3737
service_actions = get_actions_for_service(service_prefix=service_prefix)
3838
expanded = [

policy_sentry/command/create_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def create_template(output_file: str | Path, template_type: str, verbose: str) -
5959
sys.exit()
6060

6161
filename = Path(output_file).resolve()
62-
with open(filename, "a", encoding="utf-8") as file_obj:
62+
with filename.open("a", encoding="utf-8") as file_obj:
6363
file_obj.write(template)
6464

6565
print(f"write-policy template file written to: {filename}")

policy_sentry/command/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def print_dict(output: list[Any] | dict[Any, Any], fmt: str = "json") -> None:
5454
"""Common method on how to print a dict, depending on whether the user requests JSON, YAML or CSV output"""
5555
if fmt == "csv":
5656
if not output:
57-
return None
57+
return
5858
print(",".join(output[0].keys()))
5959
for entry in output:
6060
print(",".join(entry.values()))

policy_sentry/command/write_policy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,4 @@ def write_policy_with_template(cfg: dict[str, Any], minimize: int | None = None)
154154
Dictionary: The JSON policy
155155
"""
156156
sid_group = SidGroup()
157-
policy = sid_group.process_template(cfg, minimize)
158-
return policy
157+
return sid_group.process_template(cfg, minimize)

0 commit comments

Comments
 (0)