Skip to content

Commit ea13edc

Browse files
committed
Drops Python 3.7 support
1 parent 41fc6d2 commit ea13edc

File tree

5 files changed

+41
-28
lines changed

5 files changed

+41
-28
lines changed

.github/actions/setup_python/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
python_version:
66
description: "Version of Python to use"
77
required: false
8-
default: "3.7"
8+
default: "3.8"
99
python_packages:
1010
description: "Python packages to install"
1111
required: false

.github/workflows/pr-check.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- name: Setup Python
1515
uses: ./.github/actions/setup_python
16-
- name: 🔍 Lint
17-
run: |
18-
ruff check --output-format github .
19-
mypy .
16+
- name: Lint (ruff)
17+
run: ruff check --output-format github .
18+
- name: Lint (mypy)
19+
run: mypy .
2020
format:
2121
name: 🎨 Format
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v4
2525
- name: Setup Python
2626
uses: ./.github/actions/setup_python
27-
- name: 🎨 Format
28-
run: |
29-
python -m black --check --diff .
30-
python -m isort --check --diff .
27+
- name: Format (black)
28+
run: python -m black --check --diff .
29+
- name: Format (isort)
30+
run: python -m isort --check --diff .
3131
test:
3232
name: 🧪 Tests
3333
runs-on: ubuntu-latest
3434
strategy:
3535
matrix:
36-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
36+
python-version: ["3.8", "3.9", "3.10", "3.11"]
3737
steps:
3838
- uses: actions/checkout@v4
3939
- name: Setup Python

lnmc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def echo(
168168

169169
def yaml_read(yaml_file: Path) -> DirectoriesDict:
170170
"""Read the YAML file and return a dictionary."""
171-
with open(yaml_file, "r", encoding="utf-8") as stream:
171+
with yaml_file.open(encoding="utf-8") as stream:
172172
result = yaml.safe_load(stream.read())
173173
if not isinstance(result, dict):
174174
raise cli.UsageError(

pyproject.toml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools >= 68.0.0", "wheel"]
2+
requires = ["setuptools >= 69.0.3", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
@@ -18,18 +18,17 @@ classifiers = [
1818
"Operating System :: POSIX :: Linux",
1919
"Operating System :: MacOS",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",
2524
"Programming Language :: Python :: 3.11",
2625
"Topic :: System :: Systems Administration",
2726
"Topic :: Utilities",
2827
]
29-
requires-python = ">=3.7"
28+
requires-python = ">=3.8"
3029
dependencies = [
31-
"Click >=8.0.4,<9.0.0",
32-
"PyYAML >=6.0.0,<7.0.0"
30+
"Click ~=8.1.7",
31+
"PyYAML ~=6.0.0"
3332
]
3433
dynamic = ["version"]
3534

@@ -40,14 +39,14 @@ Documentation = "https://github.com/LuqueDaniel/lnmc/blob/master/README.md"
4039

4140
[project.optional-dependencies]
4241
dev = [
43-
"pre-commit ==2.21.0",
44-
"black ==23.3.0",
45-
"isort >=5.11.5,<5.12.0", # 5.12.0+ requires Python 3.8+
42+
"pre-commit ==3.5.0",
43+
"black ==23.12.1",
44+
"isort ~=5.13.2",
4645
"ruff >=0.1.9",
47-
"mypy ~=1.4.1",
46+
"mypy ~=1.8.0",
4847
"pytest ~=7.4.3",
4948
"pytest-cov ~=4.1.0",
50-
"types-PyYAML >=6.0.0",
49+
"types-PyYAML ~=6.0.0",
5150
]
5251

5352
[project.scripts]
@@ -58,21 +57,35 @@ py-modules = ["lnmc"]
5857
dynamic = {version = {attr = "lnmc.__version__"}}
5958

6059
[tool.black]
61-
target-version = ["py37"]
60+
target-version = ["py38"]
6261

6362
[tool.isort]
6463
profile = "black"
65-
known_third_party = ["click", "pytest", "setuptools", "yaml"]
64+
known_third_party = ["click", "pytest", "yaml"]
6665

6766
[tool.pytest.ini_options]
6867
addopts = "-vvs --cov=lnmc"
6968

7069
[tool.ruff]
71-
target-version = "py37"
70+
target-version = "py38"
7271
src = ["."]
7372
fix = false
7473
line-length = 88 # its default
75-
select = ["F", "E", "W", "C", "B", "N"]
74+
select = [
75+
"F", # Pyflakes
76+
"E", # pycodestyle (E, W)
77+
"W",
78+
"B", # flake8-bugbear
79+
"N", # pep8-naming
80+
"UP", # pyupgrade
81+
"S", # flake8-bandit
82+
"C4", # flake8-comprehensions
83+
"PT", # flake8-pytest-style
84+
"PTH", # flake8-use-pathlib
85+
]
86+
87+
[tool.ruff.extend-per-file-ignores]
88+
"*_test.py" = ["S101"] # Bandit use of asset in test files
7689

7790
[tool.mypy]
7891
strict = true

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
YAML_TEST_FILE = Path("tests/test.yaml")
1616

1717

18-
@pytest.fixture(scope="function")
18+
@pytest.fixture()
1919
def filesystem_actions(tmp_path: Path) -> FileSystemActions:
2020
"""Instantiate a lnmc.FileSystemActions object and return it.
2121
@@ -28,7 +28,7 @@ def filesystem_actions(tmp_path: Path) -> FileSystemActions:
2828
return FileSystemActions(tmp_path, DST, verbose=True)
2929

3030

31-
@pytest.fixture(scope="function")
31+
@pytest.fixture()
3232
def create_test_tree(tmp_path: Path) -> Generator[None, None, None]:
3333
"""Create a test directory tree based on the content of YAML_TEST_FILE."""
3434
directories = yaml_read(YAML_TEST_FILE)
@@ -48,7 +48,7 @@ def create_test_tree(tmp_path: Path) -> Generator[None, None, None]:
4848
shutil.rmtree(DST)
4949

5050

51-
@pytest.fixture(scope="function")
51+
@pytest.fixture()
5252
def create_test_file(
5353
tmp_path: Path, file_path: str = "dir/file.txt"
5454
) -> Generator[PathPair, None, None]:

0 commit comments

Comments
 (0)