diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98b0d029..8935f052 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2 - uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e # v2 with: - python-version: 3.9 + python-version: 3.11 - run: | pip install wheel diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb17a623..58eb0128 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,10 @@ jobs: steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - # tox's `precom` env pins python3.10, which only ubuntu-22.04 had preinstalled. + # tox's `precom` env pins python3.11. - uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 with: - python-version: '3.10' + python-version: '3.11' - name: Install dependencies run: | python -m pip install tox @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.11', '3.12', '3.13', '3.14', '3.15'] requests-version: ['"requests>=2.0,<3.0"'] urllib3-version: ['"urllib3<2"', '"urllib3>=2,<3.0"'] diff --git a/CHANGES b/CHANGES index c3823d65..ddaa9096 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,10 @@ Unreleased ---------- +* Dropped support for Python 3.8, 3.9 and 3.10. Python 3.11 is now the minimum. * Fixed ``fragment_identifier_matcher`` ignoring blank-valued fragment parameters, which allowed missing or different parameters to match. -* Added Python 3.14 support (classifiers, tox envlist, and CI test matrix). See #810 +* Added Python 3.14, and 3.15 (classifiers, tox envlist, and CI test matrix). See #810, #849 * Match response ``Content-Type`` header names case-insensitively so lowercase headers do not produce duplicate content types or incorrect response decoding. This also applies to headers returned by callbacks. diff --git a/README.es.rst b/README.es.rst index 2ac7ea7d..b98f78f8 100644 --- a/README.es.rst +++ b/README.es.rst @@ -17,7 +17,7 @@ Una biblioteca utilitaria para simular (*mock*) la biblioteca Python ``requests` .. note:: - Responses requiere Python 3.8 o superior, y requests >= 2.30.0 + Responses requiere Python 3.11 o superior, y requests >= 2.30.0 Tabla de Contenidos @@ -1513,8 +1513,8 @@ Puedes ejecutar todas las pruebas con: .. code-block:: shell - tox -e py38 - tox -e py310 + tox -e py311 + tox -e py312 O activando manualmente la versión de Python requerida y ejecutando: diff --git a/README.rst b/README.rst index 8170aedc..97bc061e 100644 --- a/README.rst +++ b/README.rst @@ -17,7 +17,7 @@ A utility library for mocking out the ``requests`` Python library. .. note:: - Responses requires Python 3.8 or newer, and requests >= 2.30.0 + Responses requires Python 3.11 or newer, and requests >= 2.30.0 Table of Contents @@ -1511,8 +1511,8 @@ testing. You can run all tests by: .. code-block:: shell - tox -e py38 - tox -e py310 + tox -e py311 + tox -e py312 OR manually activate required version of Python and run diff --git a/responses/matchers.py b/responses/matchers.py index 893b7f25..77796b69 100644 --- a/responses/matchers.py +++ b/responses/matchers.py @@ -195,8 +195,8 @@ def match(request: PreparedRequest) -> Tuple[bool, str]: if not valid: reason = ( - "URL fragment identifier is different: " # type: ignore[str-bytes-safe] - f"{identifier} doesn't match {url_fragment}" + "URL fragment identifier is different: " + f"{identifier} doesn't match {url_fragment}" # type: ignore[str-bytes-safe] ) return valid, reason diff --git a/responses/tests/test_recorder.py b/responses/tests/test_recorder.py index e0203698..c23a4a37 100644 --- a/responses/tests/test_recorder.py +++ b/responses/tests/test_recorder.py @@ -1,3 +1,4 @@ +import tomllib as _toml from pathlib import Path import pytest @@ -10,12 +11,6 @@ from responses._recorder import _dump from responses._recorder import _remove_default_headers -try: - import tomli as _toml -except ImportError: - # python 3.11+ - import tomllib as _toml # type: ignore[no-redef] - def get_data(host, port): data = { diff --git a/setup.py b/setup.py index 966feea3..5b16a649 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,6 @@ "types-requests", "mypy", # for check of different parsers in recorder - "tomli; python_version < '3.11'", "tomli-w", ] @@ -54,7 +53,7 @@ "responses": ["py.typed"], }, zip_safe=False, - python_requires=">=3.8", + python_requires=">=3.11", install_requires=install_requires, extras_require=extras_require, classifiers=[ @@ -63,13 +62,11 @@ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Topic :: Software Development", ], ) diff --git a/tox.ini b/tox.ini index f297ba2a..ea884236 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38,py39,py310,py311,py312,py313,py314,mypy,precom +envlist = py311,py312,py313,py314,py315,mypy,precom [pytest] filterwarnings = @@ -14,7 +14,7 @@ commands = [testenv:mypy] description = Check types using 'mypy' -basepython = python3.10 +basepython = python3.11 commands = python -m mypy --config-file=mypy.ini -p responses # see https://github.com/getsentry/responses/issues/556 @@ -22,7 +22,7 @@ commands = [testenv:precom] description = Run pre-commit hooks (black, flake, etc) -basepython = python3.10 +basepython = python3.11 deps = pre-commit>=2.9.2 commands = pre-commit run --all-files