Skip to content

Commit ba6cdf7

Browse files
committed
drop Python 3.8 support
1 parent 81eb99d commit ba6cdf7

File tree

15 files changed

+67
-68
lines changed

15 files changed

+67
-68
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ on:
1212
permissions:
1313
contents: read
1414

15+
env:
16+
MIN_PYTHON_VERSION: "3.9"
17+
1518
jobs:
1619
pre-commit:
1720
runs-on: ubuntu-latest
1821
steps:
1922
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2023
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
2124
with:
22-
python-version: '3.8'
25+
python-version: ${{ env.MIN_PYTHON_VERSION }}
2326
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
2427

2528
sanity:
@@ -28,7 +31,7 @@ jobs:
2831
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2932
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
3033
with:
31-
python-version: '3.8'
34+
python-version: ${{ env.MIN_PYTHON_VERSION }}
3235
- run: |
3336
pip install --upgrade pip
3437
pip install -r requirements.txt
@@ -48,7 +51,7 @@ jobs:
4851
- name: Setup Python
4952
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
5053
with:
51-
python-version: '3.8'
54+
python-version: ${{ env.MIN_PYTHON_VERSION }}
5255

5356
- name: Install dependencies
5457
run: |
@@ -73,7 +76,7 @@ jobs:
7376
strategy:
7477
fail-fast: true
7578
matrix:
76-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
79+
python: ['3.10', '3.11', '3.12', '3.13']
7780
steps:
7881
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7982
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0

.github/workflows/publish.yml

Lines changed: 13 additions & 3 deletions
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: |
@@ -41,7 +47,7 @@ jobs:
4147
- name: Setup Python
4248
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
4349
with:
44-
python-version: '3.8'
50+
python-version: ${{ env.MIN_PYTHON_VERSION }}
4551

4652
- name: Install dependencies
4753
run: |
@@ -68,12 +74,14 @@ jobs:
6874
update-brew:
6975
needs: publish-package
7076
runs-on: ubuntu-latest
77+
permissions:
78+
contents: write
7179
steps:
7280
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7381
- name: Setup Python
7482
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
7583
with:
76-
python-version: '3.8'
84+
python-version: ${{ env.MIN_PYTHON_VERSION }}
7785
- name: publish brew
7886
run: |
7987
sleep 5m
@@ -94,6 +102,8 @@ jobs:
94102
bump-version:
95103
needs: update-brew
96104
runs-on: ubuntu-latest
105+
permissions:
106+
contents: write
97107
steps:
98108
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
99109
with:

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

Lines changed: 7 additions & 1 deletion
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
python-dependency-updater:
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: Run Pyup.io Dependency updater
2127
run: |

.github/workflows/update.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
permissions:
1010
contents: read
1111

12+
env:
13+
MIN_PYTHON_VERSION: "3.9"
14+
1215
jobs:
1316
update-actions:
1417
runs-on: ubuntu-latest
@@ -20,7 +23,7 @@ jobs:
2023
- name: Setup python
2124
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
2225
with:
23-
python-version: '3.8'
26+
python-version: ${{ env.MIN_PYTHON_VERSION }}
2427
- name: install dependencies
2528
run: |
2629
pip install -r requirements.txt
@@ -58,7 +61,7 @@ jobs:
5861
- name: Setup Python
5962
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
6063
with:
61-
python-version: '3.8'
64+
python-version: ${{ env.MIN_PYTHON_VERSION }}
6265
- name: Install dependencies
6366
run: |
6467
pip install -r requirements.txt

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
repos:
22
- repo: https://github.com/rhysd/actionlint
3-
rev: v1.7.1
3+
rev: v1.7.4
44
hooks:
55
- id: actionlint-docker
66
- repo: https://github.com/antonbabenko/pre-commit-terraform
7-
rev: v1.92.0
7+
rev: v1.96.2
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.6.2
13+
rev: v0.8.1
1414
hooks:
1515
- id: ruff
16+
args: [--fix]
1617
files: ^(examples/|policy_sentry/|utils/|setup.py)
1718
- id: ruff-format
1819
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety

.readthedocs.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44
# Required
55
version: 2
66

7+
build:
8+
os: ubuntu-24.04
9+
tools:
10+
python: 3.9
11+
712
mkdocs:
813
configuration: mkdocs.yml
914
fail_on_warning: false
1015

1116
# Optionally build your docs in additional formats such as PDF and ePub
1217
formats: all
1318

14-
# Optionally set the version of Python and requirements required to build your docs
19+
# Optionally set requirements required to build your docs
1520
python:
16-
version: 3.8
1721
install:
1822
- requirements: docs/requirements.txt

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG FROM_TAG=3.8-slim-buster
1+
ARG FROM_TAG=3.9-slim
22
FROM python:${FROM_TAG}
33
MAINTAINER Kinnaird McQuade "[email protected]"
44

policy_sentry/bin/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# pylint: disable=missing-module-docstring
2-
__version__ = "0.13.3"
2+
__version__ = "0.14.0"

policy_sentry/command/write_policy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import json
88
import logging
99
import sys
10-
from pathlib import Path
11-
from typing import Any
10+
from typing import TYPE_CHECKING, Any
1211

1312
import click
1413
import yaml
@@ -18,6 +17,9 @@
1817
from policy_sentry.util.file import read_yaml_file
1918
from policy_sentry.writing.sid_group import SidGroup
2019

20+
if TYPE_CHECKING:
21+
from pathlib import Path
22+
2123
logger = logging.getLogger(__name__)
2224

2325

policy_sentry/shared/awsdocs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def create_database(destination_directory: str | Path, access_level_overrides_fi
181181
continue
182182

183183
title = re.sub(
184-
".*Actions, resources, and condition Keys for *",
184+
r".*Actions, resources, and condition Keys for *",
185185
"",
186186
topic_title.text,
187187
flags=re.IGNORECASE,

policy_sentry/util/file.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
from __future__ import annotations
66

77
import logging
8-
from pathlib import Path
9-
from typing import Any, cast
8+
from typing import TYPE_CHECKING, Any, cast
109

1110
import yaml
1211

12+
if TYPE_CHECKING:
13+
from pathlib import Path
14+
15+
1316
logger = logging.getLogger(__name__)
1417

1518

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ignore_missing_imports = true
1212

1313
[tool.ruff]
1414
line-length = 120
15-
target-version = "py38"
15+
target-version = "py39"
1616

1717
[tool.ruff.lint]
1818
preview = true
@@ -36,12 +36,15 @@ select = [
3636
"S",
3737
"SIM",
3838
"T10",
39+
"TC",
3940
"UP",
4041
"W",
4142
"YTT",
4243
]
4344
ignore = ["E501"] # ruff fromat takes care of it
4445

46+
fixable = ["I001"]
47+
4548
[tool.pytest.ini_options]
4649
testpaths = [
4750
"test",

requirements-dev.txt

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,12 @@
11
# CI
2-
pre-commit==3.5.0 # 3.6+ requires Python 3.9
2+
pre-commit==4.0.1
33
# Unit Testing
4-
pytest==8.3.2
5-
coverage==7.6.1
4+
pytest==8.3.4
5+
coverage==7.6.8
66
# Integration tests and tasks
77
invoke==2.2.0
88
# Type hints
9-
mypy==1.11.2
10-
types-pyyaml==6.0.12.20240808
11-
types-requests==2.32.0.20240712
12-
types-beautifulsoup4==4.12.0.20240511
13-
# Other? Maybe this is from the docs? Not sure.
14-
# appdirs==1.4.4
15-
# astroid==2.5.6
16-
# attrs==20.3.0
17-
# dparse==0.5.1
18-
# future==0.18.2
19-
# gitdb==4.0.5
20-
# GitPython==3.1.14
21-
# iniconfig==1.1.1
22-
# isort==5.8.0
23-
# Jinja2==2.11.3
24-
# joblib==1.0.1
25-
# lazy-object-proxy==1.6.0
26-
# livereload==2.6.3
27-
# markdown==3.3.4
28-
# MarkupSafe==1.1.1
29-
# mccabe==0.6.1
30-
# mypy-extensions==0.4.3
31-
# nltk==3.5
32-
# packaging==20.9
33-
# pathspec==0.8.1
34-
# pbr==5.5.1
35-
# pluggy==0.13.1
36-
# py==1.10.0
37-
# pyparsing==2.4.7
38-
# regex==2021.3.17
39-
# requests==2.25.1
40-
# six==1.15.0
41-
# stevedore==3.3.0
42-
# toml==0.10.2
43-
# tornado==6.1
44-
# tqdm==4.59.0
45-
# typed-ast==1.4.2
46-
# typing-extensions==3.7.4.3
47-
# wrapt==1.12.1
9+
mypy[faster-cache]==1.13.0
10+
types-pyyaml==6.0.12.20240917
11+
types-requests==2.32.0.20241016
12+
types-beautifulsoup4==4.12.0.20241020

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ requests==2.32.3
77
PyYAML==6.0.2
88
schema==0.7.7
99
# IAM DB
10-
orjson==3.10.7
10+
orjson==3.10.12

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def get_description() -> str:
7878
"License :: OSI Approved :: MIT License",
7979
"Operating System :: OS Independent",
8080
"Programming Language :: Python :: 3 :: Only",
81-
"Programming Language :: Python :: 3.8",
8281
"Programming Language :: Python :: 3.9",
8382
"Programming Language :: Python :: 3.10",
8483
"Programming Language :: Python :: 3.11",
@@ -89,7 +88,7 @@ def get_description() -> str:
8988
entry_points={"console_scripts": "policy_sentry=policy_sentry.bin.cli:main"},
9089
zip_safe=True,
9190
keywords="aws iam roles policy policies privileges security",
92-
python_requires=">=3.8",
91+
python_requires=">=3.9",
9392
cmdclass={
9493
"build_py": PreBuildCommand,
9594
},

0 commit comments

Comments
 (0)