Skip to content

Commit 7c07425

Browse files
chore: update pre-commit hooks (#28)
* chore: update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.3 → v0.14.4](astral-sh/ruff-pre-commit@v0.14.3...v0.14.4) - [github.com/pre-commit/mirrors-clang-format: v21.1.2 → v21.1.5](pre-commit/mirrors-clang-format@v21.1.2...v21.1.5) * ci: remove python 3.8 from test matrix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Andrey Fedorov <[email protected]>
1 parent b553630 commit 7c07425

File tree

5 files changed

+18
-20
lines changed

5 files changed

+18
-20
lines changed

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
strategy:
3838
fail-fast: false
3939
matrix:
40-
python: ["3.8", "3.12"]
40+
python: ["3.10", "3.12"]
4141

4242
steps:
4343
- uses: actions/checkout@v5

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
strategy:
4141
fail-fast: false
4242
matrix:
43-
python-version: ["3.8", "3.12"]
43+
python-version: ["3.10", "3.12"]
4444
runs-on: [ubuntu-latest, macos-latest, windows-latest]
4545

4646
include:

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ repos:
4040
args: [--prose-wrap=always]
4141

4242
- repo: https://github.com/astral-sh/ruff-pre-commit
43-
rev: "v0.14.3"
43+
rev: "v0.14.4"
4444
hooks:
4545
- id: ruff
4646
args: ["--fix", "--show-fixes"]
4747
- id: ruff-format
4848

4949
- repo: https://github.com/pre-commit/mirrors-clang-format
50-
rev: "v21.1.2"
50+
rev: "v21.1.5"
5151
hooks:
5252
- id: clang-format
5353
types_or: [c++, c, cuda]

pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = [
1111
description = "This project provides the infrastructure to build s5cmd Python wheels."
1212
readme = "README.md"
1313
license.file = "LICENSE"
14-
requires-python = ">=3.8"
14+
requires-python = ">=3.10"
1515
classifiers = [
1616
"Development Status :: 1 - Planning",
1717
"Intended Audience :: Science/Research",
@@ -21,8 +21,6 @@ classifiers = [
2121
"Programming Language :: Python",
2222
"Programming Language :: Python :: 3",
2323
"Programming Language :: Python :: 3 :: Only",
24-
"Programming Language :: Python :: 3.8",
25-
"Programming Language :: Python :: 3.9",
2624
"Programming Language :: Python :: 3.10",
2725
"Programming Language :: Python :: 3.11",
2826
"Programming Language :: Python :: 3.12",
@@ -104,7 +102,7 @@ report.exclude_also = [
104102

105103
[tool.mypy]
106104
files = ["src", "tests"]
107-
python_version = "3.8"
105+
python_version = "3.10"
108106
warn_unused_configs = true
109107
strict = true
110108
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
@@ -163,7 +161,7 @@ isort.required-imports = ["from __future__ import annotations"]
163161

164162

165163
[tool.pylint]
166-
py-version = "3.8"
164+
py-version = "3.10"
167165
ignore-paths = [".*/_version.py"]
168166
extension-pkg-allow-list = []
169167
reports.output-format = "colorized"

tests/test_executable.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
from __future__ import annotations
22

33
import subprocess
4-
import sys
54
import sysconfig
65
from pathlib import Path
76

87
import pytest
98

10-
if sys.version_info < (3, 10):
11-
from importlib_metadata import distribution
12-
else:
13-
from importlib.metadata import distribution
14-
159
import s5cmd
1610

1711
from . import push_argv
@@ -33,16 +27,22 @@ def test_module(tool):
3327

3428

3529
def _get_scripts():
36-
dist = distribution("s5cmd")
30+
# Collect all "scripts" directories from sysconfig schemes
3731
scripts_paths = [
3832
Path(sysconfig.get_path("scripts", scheme)).resolve()
3933
for scheme in sysconfig.get_scheme_names()
4034
]
4135
scripts = []
42-
for file in dist.files:
43-
if file.locate().parent.resolve(strict=True) in scripts_paths:
44-
scripts.append(file.locate().resolve(strict=True))
45-
return scripts
36+
for scripts_dir in scripts_paths:
37+
# Skip non-existent dirs to avoid Resolve errors
38+
if not scripts_dir.exists():
39+
continue
40+
# Add regular files in the scripts dir (resolve to absolute Path)
41+
for f in scripts_dir.iterdir():
42+
if f.is_file():
43+
scripts.append(f.resolve())
44+
# remove duplicates while preserving order
45+
return list(dict.fromkeys(scripts))
4646

4747

4848
@all_tools

0 commit comments

Comments
 (0)