diff --git a/.github/workflows/build-pipeline.yml b/.github/workflows/build-pipeline.yml index db48fa79..0685e4a9 100644 --- a/.github/workflows/build-pipeline.yml +++ b/.github/workflows/build-pipeline.yml @@ -51,7 +51,7 @@ jobs: needs: build strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9f5a515..bb485ffd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,7 +65,7 @@ or ask on the discussion forum. ### General policy -Currently, pyHanko aims to remain compatible with Python versions 3.7 and up, +Currently, pyHanko aims to remain compatible with Python versions 3.8 and up, and this is expected of new contributions as well (for the time being). PyHanko follows [SemVer](https://semver.org/), but has not yet reached `1.0.0`. diff --git a/README.md b/README.md index 0532852b..1ba2669c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ pip install pyHanko[pkcs11,image-support,opentype,xmp] This `pip` invocation includes the optional dependencies required for PKCS#11, image handling and OpenType/TrueType support. -PyHanko requires Python 3.7 or later. +PyHanko requires Python 3.8 or later. ### Contributing diff --git a/pyhanko/cli/_root.py b/pyhanko/cli/_root.py index 640d24d3..eb43f169 100644 --- a/pyhanko/cli/_root.py +++ b/pyhanko/cli/_root.py @@ -112,20 +112,6 @@ def _root(ctx: click.Context, config, verbose, no_plugins): def _load_plugins(root_config: Optional[CLIRootConfig], plugins_enabled: bool): import sys - - if sys.version_info < (3, 8): - from pyhanko.cli.commands.signing.pkcs11_cli import ( - BEIDPlugin, - PKCS11Plugin, - ) - from pyhanko.cli.commands.signing.simple import ( - PemderPlugin, - PKCS12Plugin, - ) - - # no plugins on 3.7, only load defaults - return [PemderPlugin(), PKCS12Plugin(), PKCS11Plugin(), BEIDPlugin()] - from importlib import metadata # we always load the default ones diff --git a/pyhanko/config/api.py b/pyhanko/config/api.py index fff29ada..7cb8b62e 100644 --- a/pyhanko/config/api.py +++ b/pyhanko/config/api.py @@ -9,7 +9,7 @@ import dataclasses import re -from typing import Any, Optional, Set, Tuple, Type, Union +from typing import Optional, Set, Type, Union from asn1crypto.core import BitString, ObjectIdentifier @@ -31,21 +31,7 @@ def _unwrap_type_annot(thing) -> Optional[type]: if isinstance(thing, type): the_type = thing else: - try: - from typing import get_args, get_origin - except ImportError: # pragma: nocover - # backwards compatibility with Python 3.7 - def get_args(tp: Any) -> Tuple[Any, ...]: - try: - return tp.__args__ - except AttributeError: - return () - - def get_origin(tp: Any) -> Optional[Any]: - try: - return tp.__origin__ - except AttributeError: - return None + from typing import get_args, get_origin # is it an optional? (i.e. Union[X, None]) # if so, retrieve the wrapped type diff --git a/pyproject.toml b/pyproject.toml index 40240c03..8fa81f32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,6 @@ classifiers = [ "Operating System :: OS Independent", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -33,7 +32,7 @@ classifiers = [ "Topic :: Security :: Cryptography", "Topic :: Software Development :: Libraries :: Python Modules", ] -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = [ "asn1crypto>=1.5.1", "qrcode>=7.3.1",