Skip to content

Add support for Python 3.15 - #169

Merged
fedelemantuano merged 4 commits into
SpamScope:developfrom
kytta:py315
Aug 19, 2026
Merged

Add support for Python 3.15#169
fedelemantuano merged 4 commits into
SpamScope:developfrom
kytta:py315

Conversation

@kytta

@kytta kytta commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Python 3.15.0 candidate 1 is out. "candidate" means that there will be no more ABI changes, and the API over all is now stable. It is now pretty much safe to test against and to specify support for it.

This PR adds Python 3.15 support to mail-parser:

  • version and classifier in pyproject.toml
  • 3.15 in GitHub Actions
  • find-and-replace 3.14 -> 3.15 and 3.15 -> 3.16

I have ran the tests locally, and all of them pass.

This PR also removes the upper bound on requires-python and thus closes #170

@kytta
kytta marked this pull request as ready for review August 17, 2026 21:47
@fedelemantuano

Copy link
Copy Markdown
Contributor

Thanks for the detailed write-up — and for the concrete repro, which makes the case better than the general argument does.

The upper bound was a poorly chosen default, not a deliberate decision. It came in with #141 and I never revisited it.

What convinced me is the version the resolver actually picks. On Python 3.15, mail-parser backtracks to 4.1.4 — a release that predates every hardening fix landed since (attachment byte handling, hostile charset containment, Received date parsing, header-index complexity, sender-IP attribution). It also reintroduces the six dependency, which this project deliberately dropped. For a forensics and phishing-analysis tool, silently serving an old, unpatched parser is a worse outcome than any hypothetical incompatibility the cap was meant to guard against.

The asymmetry settles it: if a future Python breaks the parser, CI fails and I cut a patch release — bounded and visible. With the cap in place, users get a silent downgrade at install time with no failure and no warning.

So: the bound is going away entirely.

requires-python = ">=3.9"

Supported versions will be stated via trove classifiers, the CI matrix, and the README — which is the right place for a support contract, as you say.

@kytta if you're happy to update #169, I'd merge it as:

  • requires-python = ">=3.9" (no upper bound) instead of <3.16
  • uv.lock regenerated to match
  • keep the Programming Language :: Python :: 3.15 classifier
  • drop '3.8' from the CI matrix — it's been stale since requires-python moved to >=3.9
  • use python-version: '3.15' with allow-prereleases: true rather than '3.15-dev', so there's no follow-up edit in October
  • reword the requires-python range hardcoded in the src/mailparser/utils.py comment and the tests/test_utils.py docstring to just "Python 3.9+" — the point there is the 3.13 strict backport, so the upper bound is irrelevant and only causes churn every release

Otherwise I'll do it myself on top of your branch. Either way the credit is yours — thanks for pushing on this.

@kytta kytta changed the title Declare support for Python 3.15 Add support for Python 3.15 Aug 19, 2026
@fedelemantuano
fedelemantuano merged commit 6752722 into SpamScope:develop Aug 19, 2026
8 checks passed
@kytta
kytta deleted the py315 branch August 19, 2026 20:29
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.

Remove upper bound from requires-python

2 participants