From fe7dd9f49f2ce1105738e0c82a1ace94dc87ae10 Mon Sep 17 00:00:00 2001 From: Prajjwal Bhandari Date: Mon, 16 Nov 2026 15:26:35 -0500 Subject: [PATCH 1/9] Require Python 3.11 or newer in package metadata --- setup.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 966feea3..e4b202da 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,9 +62,6 @@ "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", From b2416922c46c324c0b5020f92497da6022996a20 Mon Sep 17 00:00:00 2001 From: Prajjwal Bhandari Date: Mon, 16 Nov 2026 15:26:51 -0500 Subject: [PATCH 2/9] Drop Python 3.8-3.10 from tox envlist and CI workflows --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 6 +++--- tox.ini | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) 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..9d78267e 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'] requests-version: ['"requests>=2.0,<3.0"'] urllib3-version: ['"urllib3<2"', '"urllib3>=2,<3.0"'] diff --git a/tox.ini b/tox.ini index f297ba2a..5ea133d0 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,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 From c32b648024a36a4f1db5f4b32177f918c3852ae0 Mon Sep 17 00:00:00 2001 From: Prajjwal Bhandari Date: Mon, 16 Nov 2026 15:27:16 -0500 Subject: [PATCH 3/9] Import tomllib directly in recorder tests --- responses/tests/test_recorder.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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 = { From 6e5e284df9539ad9f15ddb0931820f585407f7aa Mon Sep 17 00:00:00 2001 From: Prajjwal Bhandari Date: Mon, 16 Nov 2026 15:27:33 -0500 Subject: [PATCH 4/9] Document Python 3.11 minimum --- CHANGES | 2 ++ README.es.rst | 6 +++--- README.rst | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index c3823d65..817eeec3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ 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 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 From 0bb7d5cd5c66a4f4de42df2e10d32841ac0deb7a Mon Sep 17 00:00:00 2001 From: Prajjwal Bhandari Date: Mon, 16 Nov 2026 15:34:28 -0500 Subject: [PATCH 5/9] Add Python 3.14 and 3.15 to classifiers, tox envlist and CI matrix --- .github/workflows/ci.yml | 3 ++- CHANGES | 3 +-- setup.py | 1 + tox.ini | 2 +- uv.lock | 3 +++ 5 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 uv.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d78267e..7ddc054d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['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"'] @@ -48,6 +48,7 @@ jobs: - uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Install dependencies run: | diff --git a/CHANGES b/CHANGES index 817eeec3..eb7ed0b5 100644 --- a/CHANGES +++ b/CHANGES @@ -2,10 +2,9 @@ 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 support (classifiers, tox envlist, and CI test matrix). See #810 * 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/setup.py b/setup.py index e4b202da..5b16a649 100644 --- a/setup.py +++ b/setup.py @@ -66,6 +66,7 @@ "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 5ea133d0..ea884236 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py311,py312,py313,py314,mypy,precom +envlist = py311,py312,py313,py314,py315,mypy,precom [pytest] filterwarnings = diff --git a/uv.lock b/uv.lock new file mode 100644 index 00000000..5cf3c1eb --- /dev/null +++ b/uv.lock @@ -0,0 +1,3 @@ +version = 1 +revision = 5 +requires-python = ">=3.13" From 5868f44947d6cae691790337770e045754f73398 Mon Sep 17 00:00:00 2001 From: Prajjwal Bhandari Date: Mon, 16 Nov 2026 15:36:23 -0500 Subject: [PATCH 6/9] Remove accidentally committed uv.lock --- uv.lock | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 uv.lock diff --git a/uv.lock b/uv.lock deleted file mode 100644 index 5cf3c1eb..00000000 --- a/uv.lock +++ /dev/null @@ -1,3 +0,0 @@ -version = 1 -revision = 5 -requires-python = ">=3.13" From b4d7bd80619da140b8b490c508529173cd5f6767 Mon Sep 17 00:00:00 2001 From: Prajjwal Bhandari Date: Mon, 16 Nov 2026 15:37:55 -0500 Subject: [PATCH 7/9] Move str-bytes-safe ignore onto the f-string line it applies to --- responses/matchers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 29e0339301eff0fc4bb3bc4aaffe1aabc2b7fefd Mon Sep 17 00:00:00 2001 From: Praj Bhandari Date: Mon, 16 Nov 2026 12:52:58 -0800 Subject: [PATCH 8/9] Update CHANGES for Python version support and fixes --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index eb7ed0b5..ddaa9096 100644 --- a/CHANGES +++ b/CHANGES @@ -4,7 +4,7 @@ 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 and 3.15 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. From 38743481a427bee1d8ae9025fa0e1b80d8f48929 Mon Sep 17 00:00:00 2001 From: Prajjwal Bhandari Date: Mon, 16 Nov 2026 15:55:50 -0500 Subject: [PATCH 9/9] Drop allow-prereleases; 3.15 has stable builds --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ddc054d..58eb0128 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,6 @@ jobs: - uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 with: python-version: ${{ matrix.python-version }} - allow-prereleases: true - name: Install dependencies run: |