diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d55cdc85..c3791866 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,15 +9,13 @@ on: jobs: test: name: Test - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: submodules: recursive - - uses: wntrblm/nox@2022.11.21 + - uses: wntrblm/nox@2023.04.22 with: - python-versions: "3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, pypy3.8, pypy3.9, pypy3.10" - - name: "Allow nox to run with python 3.6" - run: pipx runpip nox install 'virtualenv<20.22.0' + python-versions: "3.7, 3.8, 3.9, 3.10, 3.11, 3.12, pypy3.8, pypy3.9, pypy3.10" - name: "Run tests" run: nox --error-on-missing-interpreters -s test diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 69063fbe..ea35fae8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: rev: v3.15.0 hooks: - id: pyupgrade - args: ["--py36-plus"] + args: ["--py37-plus"] - repo: https://github.com/psf/black-pre-commit-mirror rev: 23.12.1 @@ -34,6 +34,7 @@ repos: rev: 5.13.2 hooks: - id: isort + args: ["-a", "from __future__ import annotations"] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.8.0 diff --git a/README.rst b/README.rst index 2b069028..ef48386e 100644 --- a/README.rst +++ b/README.rst @@ -121,6 +121,10 @@ Running Python 3.7.2, Apple LLVM version 10.0.0 (clang-1000.11.45.5), Mac OS X 1 Changelog ========= +Future +------ +- Drop python 3.6 support + 1.3.2 ----- - Update base64 library diff --git a/conftest.py b/conftest.py index 680c2348..f112d548 100644 --- a/conftest.py +++ b/conftest.py @@ -1,2 +1,5 @@ +from __future__ import annotations + + def pytest_addoption(parser) -> None: parser.addoption("--sde-cpu", action="store", default=None, help="run sde tests") diff --git a/docs/conf.py b/docs/conf.py index e91fb205..b8280305 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,6 +12,8 @@ # All configuration values have a default; values that are commented out # serve to show the default. +from __future__ import annotations + import datetime import os import runpy diff --git a/noxfile.py b/noxfile.py index 92fea832..793a5a95 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,7 +1,8 @@ +from __future__ import annotations + import os import sys from pathlib import Path -from typing import Dict import nox @@ -9,7 +10,7 @@ nox.options.sessions = ["lint", "test"] -ALL_CPYTHON = [f"3.{minor}" for minor in range(6, 12 + 1)] +ALL_CPYTHON = [f"3.{minor}" for minor in range(7, 12 + 1)] ALL_PYPY = [f"pypy3.{minor}" for minor in range(8, 10 + 1)] ALL_PYTHON = ALL_CPYTHON + ALL_PYPY @@ -21,7 +22,7 @@ def lint(session: nox.Session) -> None: session.run("pre-commit", "run", "-a") -def update_env_macos(session: nox.Session, env: Dict[str, str]) -> None: +def update_env_macos(session: nox.Session, env: dict[str, str]) -> None: if sys.platform.startswith("darwin"): # we don't support universal builds machine = session.run( diff --git a/pyproject.toml b/pyproject.toml index 58be5580..b8145210 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ build-verbosity = 1 profile = "black" [tool.mypy] -python_version = 3.6 +python_version = "3.7" follow_imports = "silent" ignore_missing_imports = true disallow_untyped_defs = true diff --git a/requirements-test.txt b/requirements-test.txt index 7b6883ad..f9708e4b 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,2 +1 @@ -pytest==7.0.1 ; python_version == '3.6' -pytest==7.4.3 ; python_version >= '3.7' +pytest==7.4.3 diff --git a/setup.py b/setup.py index 1afbf521..5a2a28e7 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,9 @@ +from __future__ import annotations + import sys -if sys.version_info[:2] < (3, 6): - raise RuntimeError("Python version >= 3.6 required.") +if sys.version_info[:2] < (3, 7): + raise RuntimeError("Python version >= 3.7 required.") import logging import os @@ -228,7 +230,6 @@ def run(self): # that you indicate whether you support Python 2, Python 3 or both. "Programming Language :: C", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -237,7 +238,7 @@ def run(self): "Programming Language :: Python :: 3.12", ], # Supported python versions - python_requires=">=3.6", + python_requires=">=3.7", # What does your project relate to? keywords="base64", # You can just specify the packages manually here if your project is diff --git a/src/pybase64/__init__.py b/src/pybase64/__init__.py index 9c12100b..aec478fa 100644 --- a/src/pybase64/__init__.py +++ b/src/pybase64/__init__.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any from ._license import _license diff --git a/src/pybase64/__main__.py b/src/pybase64/__main__.py index 74e6df14..d765d787 100644 --- a/src/pybase64/__main__.py +++ b/src/pybase64/__main__.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import argparse import base64 import sys diff --git a/src/pybase64/_fallback.py b/src/pybase64/_fallback.py index a0d1ef39..d02abd02 100644 --- a/src/pybase64/_fallback.py +++ b/src/pybase64/_fallback.py @@ -1,8 +1,10 @@ +from __future__ import annotations + from base64 import b64decode as builtin_decode from base64 import b64encode as builtin_encode from base64 import encodebytes as builtin_encodebytes from binascii import Error as BinAsciiError -from typing import Any, Union +from typing import Any __all__ = [ "_get_simd_name", @@ -26,7 +28,7 @@ def _get_simd_path() -> int: return 0 -def _get_bytes(s: Any) -> Union[bytes, bytearray]: +def _get_bytes(s: Any) -> bytes | bytearray: if isinstance(s, str): try: return s.encode("ascii") diff --git a/src/pybase64/_version.py b/src/pybase64/_version.py index f708a9b2..e1e107f6 100644 --- a/src/pybase64/_version.py +++ b/src/pybase64/_version.py @@ -1 +1,3 @@ +from __future__ import annotations + __version__ = "1.3.2" diff --git a/tests/test_main.py b/tests/test_main.py index eb735f32..2eaf1fa9 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import os import re import sys diff --git a/tests/test_pybase64.py b/tests/test_pybase64.py index 13b14e32..c8f9db04 100644 --- a/tests/test_pybase64.py +++ b/tests/test_pybase64.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import base64 import os from base64 import encodebytes as b64encodebytes