From ed90e5f9277429c00b3f52a26f1de49024288bb6 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Sat, 30 Sep 2023 11:33:35 +0200 Subject: [PATCH] chore: drop python 3.7 (#457) --- .github/workflows/test.yml | 1 - .pre-commit-config.yaml | 2 +- README.rst | 4 ++-- noxfile.py | 2 +- pyproject.toml | 4 ++-- setup.cfg | 4 +--- src/auditwheel/lddtree.py | 4 ++-- src/auditwheel/main.py | 6 +----- src/auditwheel/wheel_abi.py | 2 +- tests/integration/test_manylinux.py | 5 ++--- 10 files changed, 13 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 243fbf01..f389d071 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,7 +42,6 @@ jobs: fail-fast: false matrix: include: - - python: "3.7" - python: "3.8" - python: "3.9" - python: "3.10" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9339506c..0845980b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: rev: v3.13.0 hooks: - id: pyupgrade - args: ["--py37-plus"] + args: ["--py38-plus"] - repo: https://github.com/psf/black rev: 23.9.1 diff --git a/README.rst b/README.rst index c8cbcf06..6d157317 100644 --- a/README.rst +++ b/README.rst @@ -40,7 +40,7 @@ advised that bundling, like static linking, may implicate copyright concerns. Requirements ------------ - OS: Linux -- Python: 3.7+ +- Python: 3.8+ - `patchelf `_: 0.14+ Only systems that use `ELF @@ -135,7 +135,7 @@ daemon. These tests will pull a number of docker images if they are not already available on your system, but it won't update existing images. To update these images manually, run:: - docker pull python:3.7-slim + docker pull python:3.8-slim docker pull quay.io/pypa/manylinux1_x86_64 docker pull quay.io/pypa/manylinux2010_x86_64 docker pull quay.io/pypa/manylinux2014_x86_64 diff --git a/noxfile.py b/noxfile.py index edce0767..aa7b22e5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -8,7 +8,7 @@ nox.options.sessions = ["lint", "test-dist"] -PYTHON_ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] +PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"] RUNNING_CI = "TRAVIS" in os.environ or "GITHUB_ACTIONS" in os.environ diff --git a/pyproject.toml b/pyproject.toml index 6a5fb5ac..deccf702 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,11 +6,11 @@ build-backend = "setuptools.build_meta" # enable version inference [tool.black] -target-version = ["py37", "py38", "py39", "py310", "py311", "py312"] +target-version = ["py38", "py39", "py310", "py311", "py312"] extend-exclude = "src/auditwheel/_vendor" [tool.isort] -py_version = 37 +py_version = 38 profile = "black" extend_skip_glob = "src/auditwheel/_vendor/**/*.py" diff --git a/setup.cfg b/setup.cfg index 1c93370c..c708adce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,6 @@ classifier = License :: OSI Approved :: MIT License Operating System :: POSIX :: Linux Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 @@ -30,11 +29,10 @@ include_package_data = True install_requires = packaging>=20.9 pyelftools>=0.24 - importlib_metadata; python_version < "3.8" packages = find: package_dir = =src -python_requires = >=3.7 +python_requires = >=3.8 zip_safe = False [options.package_data] diff --git a/src/auditwheel/lddtree.py b/src/auditwheel/lddtree.py index 2e7d4955..22a79388 100644 --- a/src/auditwheel/lddtree.py +++ b/src/auditwheel/lddtree.py @@ -114,7 +114,7 @@ def parse_ld_paths(str_ldpaths: str, path: str, root: str = "") -> list[str]: return [p for p in dedupe(ldpaths) if os.path.isdir(p)] -@functools.lru_cache() +@functools.lru_cache def parse_ld_so_conf(ldso_conf: str, root: str = "/", _first: bool = True) -> list[str]: """Load all the paths from a given ldso config file @@ -166,7 +166,7 @@ def parse_ld_so_conf(ldso_conf: str, root: str = "/", _first: bool = True) -> li return paths -@functools.lru_cache() +@functools.lru_cache def load_ld_paths(root: str = "/", prefix: str = "") -> dict[str, list[str]]: """Load linker paths from common locations diff --git a/src/auditwheel/main.py b/src/auditwheel/main.py index 595ac197..5f1fe8f2 100644 --- a/src/auditwheel/main.py +++ b/src/auditwheel/main.py @@ -5,11 +5,7 @@ import os import pathlib import sys - -if sys.version_info[:2] >= (3, 8): - from importlib import metadata -else: - import importlib_metadata as metadata +from importlib import metadata import auditwheel diff --git a/src/auditwheel/wheel_abi.py b/src/auditwheel/wheel_abi.py index 9dcde770..1e963f7b 100644 --- a/src/auditwheel/wheel_abi.py +++ b/src/auditwheel/wheel_abi.py @@ -58,7 +58,7 @@ class NonPlatformWheel(WheelAbiError): ) -@functools.lru_cache() +@functools.lru_cache def get_wheel_elfdata(wheel_fn: str): full_elftree = {} nonpy_elftree = {} diff --git a/tests/integration/test_manylinux.py b/tests/integration/test_manylinux.py index d2058d18..b34ba532 100644 --- a/tests/integration/test_manylinux.py +++ b/tests/integration/test_manylinux.py @@ -80,7 +80,6 @@ PATH = {k: ":".join(PATH_DIRS).format(devtoolset=v) for k, v in DEVTOOLSET.items()} WHEEL_CACHE_FOLDER = op.expanduser("~/.cache/auditwheel_tests") NUMPY_VERSION_MAP = { - "37": "1.21.4", "38": "1.21.4", "39": "1.21.4", "310": "1.21.4", @@ -801,8 +800,8 @@ def any_manylinux_img(self, request): """ policy = request.param support_check_map = { - "manylinux_2_5": {"37", "38", "39"}, - "manylinux_2_12": {"37", "38", "39", "310"}, + "manylinux_2_5": {"38", "39"}, + "manylinux_2_12": {"38", "39", "310"}, } check_set = support_check_map.get(policy, None) if check_set and PYTHON_ABI_MAJ_MIN not in check_set: