Skip to content

Commit 6260d76

Browse files
committed
upgrade dependencies
1 parent a323e3f commit 6260d76

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ repos:
44
hooks:
55
- id: actionlint-docker
66
- repo: https://github.com/antonbabenko/pre-commit-terraform
7-
rev: v1.100.0
7+
rev: v1.101.1
88
hooks:
99
- id: terraform_fmt
1010
# - id: terraform_docs
1111
# args: ['--sort-by-required', '--no-providers']
1212
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.12.8
13+
rev: v0.14.0
1414
hooks:
1515
- id: ruff-check
1616
args: [--fix]

policy_sentry/command/query.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import json
88
import logging
9-
from typing import Any
9+
from typing import TYPE_CHECKING, Any
1010

1111
import click
1212
import yaml
@@ -38,11 +38,14 @@
3838
)
3939
from policy_sentry.util.access_levels import transform_access_level_text
4040

41+
if TYPE_CHECKING:
42+
from collections.abc import Iterable
43+
4144
logger = logging.getLogger(__name__)
4245
iam_definition_path = DATASTORE_FILE_PATH
4346

4447

45-
def print_list(output: list[Any], fmt: str = "json") -> None:
48+
def print_list(output: Iterable[Any], fmt: str = "json") -> None:
4649
"""Common method on how to print a list, depending on whether the user requests JSON or YAML output"""
4750
print(yaml.dump(output)) if fmt == "yaml" else [print(item) for item in output]
4851

@@ -135,7 +138,7 @@ def query_action_table(
135138
condition: str,
136139
resource_type: str,
137140
fmt: str = "json",
138-
) -> list[str] | dict[str, list[dict[str, Any]]]:
141+
) -> Iterable[str]:
139142
"""Query the Action Table from the Policy Sentry database.
140143
Use this one when leveraging Policy Sentry as a library."""
141144
if LOCAL_DATASTORE_FILE_PATH.exists():
@@ -164,7 +167,7 @@ def query_action_table(
164167
else:
165168
print("All services in the database:\n")
166169
# it is a set here, which is ok
167-
output = all_services # type:ignore[assignment]
170+
output = all_services
168171
print_list(output=output, fmt=fmt)
169172
elif name is None and access_level and not resource_type:
170173
print(f"All IAM actions under the {service} service that have the access level {access_level}:")

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ files = "policy_sentry"
33

44
python_version = "3.9" # should be identical to the minimum supported version
55
local_partial_types = true # will become the new default from version 2
6+
allow_redefinition_new = true # will become the new default from version 2
7+
fixed_format_cache = true # new caching mechanism
68
strict = true
79
pretty = true
810

@@ -34,6 +36,7 @@ select = [
3436
"PIE",
3537
"PLE",
3638
"PLW",
39+
"PYI",
3740
"RUF",
3841
"S",
3942
"SIM",

requirements-dev.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# CI
33
pre-commit==4.3.0
44
# Unit Testing
5-
pytest==8.4.1
6-
coverage==7.10.3
5+
pytest==8.4.2
6+
coverage==7.10.7
77
# Integration tests and tasks
88
invoke==2.2.0
99
# Type hints
10-
mypy[faster-cache]==1.17.1
11-
types-pyyaml==6.0.12.20250809
12-
types-requests==2.32.4.20250809
10+
mypy==1.18.2
11+
types-pyyaml==6.0.12.20250915
12+
types-requests==2.32.4.20250913
1313
types-beautifulsoup4==4.12.0.20250516

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Command line
22
click==8.1.8 # 8.2+ needs Python 3.10+
33
# Web Scraping
4-
beautifulsoup4==4.13.4
5-
requests==2.32.4
4+
beautifulsoup4==4.14.2
5+
requests==2.32.5
66
# Config files and schema validation
7-
PyYAML==6.0.2
7+
PyYAML==6.0.3
88
schema==0.7.7
99
# IAM DB
10-
orjson==3.11.1
10+
orjson==3.11.3

0 commit comments

Comments
 (0)