Skip to content

Drop support for Python 3.10 - #1061

Merged
kevin1024 merged 7 commits into
kevin1024:masterfrom
pylaterreur:drop-python-3.10
Oct 25, 2026
Merged

kevin1024 merged 7 commits into
kevin1024:masterfrom
pylaterreur:drop-python-3.10

Conversation

@pylaterreur

Copy link
Copy Markdown
Contributor

Python 3.10 reached its end of life on 2026-10-01. This drops it, as #953 did for 3.9.

  • pyproject.toml: requires-python = ">=3.11", drop the 3.10 classifier, and set ruff's target-version to py311. The tests extra lists pyreqwest without its python_version >= '3.11' marker, which is now always true.
  • CI: drop 3.10 from the test matrix.
  • vcr/record_mode.py: with the py311 target, ruff's UP042 suggests making RecordMode(str, Enum) a StrEnum. I silenced it instead: StrEnum would change str() and format() of the members, e.g. f"{vcr.mode.ONCE}" would give once instead of RecordMode.ONCE. repr(), equality with strings, hashing and pickling are the same either way. I can switch to StrEnum if you prefer.
  • Docs: the installation page said "Python 3.9+" (now 3.11+), and the contributing guide's pyenv example used pypy3.10 (now pypy3.11).
  • A changelog entry.

Nothing in vcr/ or tests/ was specific to 3.10.

Tests. I ran the workflow's steps locally on GitHub's CPython 3.11.17 and 3.13.16 builds, with the offline step in a network namespace, and ran master the same way on 3.11.17:

online offline
3.11.17 tests, this branch 108 passed, 1 skipped 404 passed, 9 skipped, 2 failed
3.11.17 tests, master 108 passed, 1 skipped 405 passed, 9 skipped, 1 failed
3.13.16 tests, this branch 108 passed, 1 skipped 404 passed, 9 skipped, 2 failed

The offline failures are the known flaky BrokenPipeErrors in tests that POST to the local httpbin (#1059, kevin1024/pytest-httpbin#101). Run 25 times each, alternating, those tests failed in 20 of 25 runs on both this branch and master. tests-niquests fails on the same tests as on master (the urllib3-future problem #1056 fixes), apart from those flaky uploads. Skips and installed packages are identical to master.

pre-commit and codespell pass. The built wheel's metadata differs from master's only in Requires-Python: >=3.11, the classifier and the pyreqwest marker. pip installs it on 3.11 and refuses it on 3.10 (requires a different Python: 3.10.21 not in '>=3.11'). The docs build with the same Sphinx warnings as on master.

This overlaps with #1058 in docs/installation.rst (same sentence) and the changelog: whichever is merged second needs a rebase, keeping "3.11+" and both changelog entries.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN

Python 3.10 reached its end of life on 2026-10-01. Require Python 3.11
or newer: drop the 3.10 classifier and CI job, target py311 in ruff,
and install pyreqwest in the tests extra without its now always-true
python_version >= '3.11' marker. setup.cfg, which mirrors
pyproject.toml, gets the same changes.

Nothing in vcr/ or tests/ was specific to Python 3.10. With the new
target, ruff's UP042 wants RecordMode to subclass enum.StrEnum rather
than (str, Enum). Silence it instead: StrEnum would make str() and
format() of a member return its value ("once") instead of
"RecordMode.ONCE", which users of vcr.mode could notice.

Also update the docs: the installation page still said Python 3.9+,
and the contributing guide had contributors install PyPy 3.10, which
can no longer install vcrpy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN
@pylaterreur

Copy link
Copy Markdown
Contributor Author

@kevin1024 @cclauss Friendly ping: could this be merged, or is anything still needed from my side? Thanks!

@codecov-commenter

codecov-commenter commented Oct 25, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.29%. Comparing base (b1fb62b) to head (a827da6).
⚠️ Report is 65 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1061      +/-   ##
==========================================
+ Coverage   92.45%   93.29%   +0.83%     
==========================================
  Files          27       27              
  Lines        1988     2087      +99     
  Branches      254      267      +13     
==========================================
+ Hits         1838     1947     +109     
+ Misses         99       90       -9     
+ Partials       51       50       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

pylaterreur and others added 2 commits October 25, 2026 19:51
Move the changelog entry under Unreleased: 8.4.0 is out without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN
@pylaterreur

Copy link
Copy Markdown
Contributor Author

@kevin1024 The red build (3.12, tests-niquests) job here is the flaky test_post_chunked_binary (BrokenPipeError), not this PR: the local httpbin server rejects chunked uploads and closes the connection mid-request. kevin1024/pytest-httpbin#101 fixes that on the server side. The newer head has a fresh run.

@kevin1024

Copy link
Copy Markdown
Owner

Thanks @pylaterreur! Dropping a Python version means a major version bump for us, so I'm holding this for 9.0.0 along with the other breaking changes (#925, #1004). 8.5.0 goes out first with the current fixes and 3.14/3.15 support. Agree on keeping RecordMode as (str, Enum).

@kevin1024
kevin1024 merged commit a04fecd into kevin1024:master Oct 25, 2026
17 checks passed
@pylaterreur
pylaterreur deleted the drop-python-3.10 branch October 25, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants