# Announcement: packaging 26.4 released!

**URL:** <https://discuss.python.org/t/announcement-packaging-26-4-released/110276>\
**Category:** Packaging\
**Tags:** release\
**Created:** [November 24, 2026, 6:25pm UTC](https://discuss.python.org/t/announcement-packaging-26-4-released/110276 "2026-11-24T18:25:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![notatallshaw](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/notatallshaw/32/10861_2.png) [@notatallshaw](https://discuss.python.org/u/notatallshaw)\
**Post date:** [November 24, 2026, 6:25pm UTC](https://discuss.python.org/t/announcement-packaging-26-4-released/110276/1 "2026-11-24T18:25:33Z")

</div>

I’m pleased to announce, with @henryiii as the release manager, that [packaging 26.4](https://pypi.org/project/packaging/26.4/) is out! This release drops support for Python 3.9.

### New features

- [`prepare_environment()`](https://packaging.pypa.io/en/stable/markers.html#packaging.markers.prepare_environment) and [`Marker.evaluate_prepared()`](https://packaging.pypa.io/en/stable/markers.html#evaluating-many-markers-against-one-environment) let you reuse one environment across many marker evaluations.
- `Marker.evaluate()` accepts [a set of selected names for `extra`](https://packaging.pypa.io/en/stable/markers.html#evaluating-extra-markers-against-a-set-of-extras).
- [`Requirement`](https://packaging.pypa.io/en/stable/requirements.html#packaging.requirements.Requirement), [`Specifier`](https://packaging.pypa.io/en/stable/specifiers.html#packaging.specifiers.Specifier. __replace__ ), and [`SpecifierSet`](https://packaging.pypa.io/en/stable/specifiers.html#packaging.specifiers.SpecifierSet. __replace__ ) support ` __replace__ ` calls, which `copy.replace()` uses on Python 3.13+.
- [`packaging.tags.interpreter_abi()`](https://packaging.pypa.io/en/stable/tags.html#packaging.tags.interpreter_abi) gives you the ABI tag for the running interpreter.
- [`InvalidRequirement`](https://packaging.pypa.io/en/stable/requirements.html#packaging.requirements.InvalidRequirement) and [`InvalidMarker`](https://packaging.pypa.io/en/stable/markers.html#packaging.markers.InvalidMarker) expose `message`, `source`, and `span` for syntax errors.
- [`VersionRange.from_bounds()`](https://packaging.pypa.io/en/stable/ranges.html#building-from-raw-bounds) builds a range from explicit bounds, [`snap_bounds()`](https://packaging.pypa.io/en/stable/ranges.html#snapping-onto-known-versions) moves its endpoints to known versions, and [`relation()`](https://packaging.pypa.io/en/stable/ranges.html#relating-two-ranges) checks subset and disjointness in one pass.

### Performance

Across the board our [benchmarks](https://github.com/pypa/packaging/pull/1535) show performance improvements. E.g. we see repeatedly filtering with `~=` takes about 30% to 45% less time. The first `str(marker)` call takes about 20% to 30% less time, and repeated calls on the same marker take about 95% less time.

Packaging uses [lazy imports](https://github.com/pypa/packaging/pull/1129) on Python 3.15 and later.

### Behavior changes and fixes

Markers joined with `&` or `|` print with [fewer parentheses](https://github.com/pypa/packaging/pull/1510). `Pylock.select()` raises an error for [unknown extras or dependency groups](https://github.com/pypa/packaging/pull/1376).

See the [changelog](https://packaging.pypa.io/en/stable/changelog.html) for the full list.

### Bonus topic

We have a new [PubGrub dependecy resolver](https://github.com/pypa/packaging/blob/main/benchmarks/_pubgrub.py) [benchmark](https://github.com/pypa/packaging/blob/main/benchmarks/resolver.py#L57) to validate packaging’s performance, and it is intended to also be a simple implementation for understanding PubGrub.

---

<div class="post-metadata">

**Author:** ![henryiii](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/henryiii/32/3493_2.png) [@henryiii](https://discuss.python.org/u/henryiii)\
**Post date:** [November 25, 2026, 2:14am UTC](https://discuss.python.org/t/announcement-packaging-26-4-released/110276/2 "2026-11-25T02:14:23Z")

</div>

There were a lot of performance improvements! Toy resolvers got 2x faster, Python 3.11.5+ and PyPy 7.3.22+ construct complex Versions and especially Specifiers faster, and some specific operation are up to 20x faster. The only benchmarks that didn’t get faster are the rest of Version and `canonicalize_name` ones, which are probably about as optimized as possible in pure Python. Expect for strings of versions those got faster. While evaluate doesn’t look that much faster, there’s now new API to prepare environments and evaluate in prepared environments, which is faster for repeated evaluations.

Below is the comparison table for 26.3 to 26.4. Lower is better, and there’s a bit of noise.

| Benchmark | 3.10 | 3.11 | 3.12 | 3.13 | 3.14 | 3.15 |
| --- | --- | --- | --- | --- | --- | --- |
| 🟢 markers: constructor | 🟢 **0.54** | 🟢 **0.54** | 🟢 **0.52** | 🟢 **0.52** | 🟢 **0.51** | 🟢 **0.54** |
| 🟢 markers: evaluate | 🟢 **0.95** | 0.96 | 0.96 | 🟢 **0.95** | 0.96 | 0.96 |
| 🟢 markers: evaluate\_many | 🟢 **0.67** | 🟢 **0.67** | 🟢 **0.67** | 🟢 **0.68** | 🟢 **0.66** | 🟢 **0.70** |
| 🟢 markers: first\_str | 🟢 **0.78** | 🟢 **0.68** | 🟢 **0.72** | 🟢 **0.72** | 🟢 **0.73** | 🟢 **0.73** |
| 🟢 markers: hash | 🟢 **0.12** | 🟢 **0.12** | 🟢 **0.12** | 🟢 **0.12** | 🟢 **0.12** | 🟢 **0.12** |
| 🟢 markers: str | 🟢 **0.07** | 🟢 **0.06** | 🟢 **0.06** | 🟢 **0.05** | 🟢 **0.05** | 🟢 **0.06** |
| 🟢 ranges: complement | 🟢 **0.87** | 🟢 **0.86** | 🟢 **0.87** | 🟢 **0.89** | 🟢 **0.80** | 🟢 **0.82** |
| 🟢 ranges: constructor\_cold | 🟢 **0.81** | 🟢 **0.80** | 🟢 **0.81** | 🟢 **0.83** | 🟢 **0.81** | 🟢 **0.79** |
| 🟢 ranges: constructor\_warm | 🟢 **0.82** | 🟢 **0.83** | 🟢 **0.78** | 🟢 **0.82** | 🟢 **0.78** | 🟢 **0.78** |
| 🟢 ranges: contains | 🟢 **0.70** | 🟢 **0.69** | 🟢 **0.72** | 🟢 **0.77** | 🟢 **0.63** | 🟢 **0.72** |
| 🟢 ranges: difference | 🟢 **0.35** | 🟢 **0.33** | 🟢 **0.35** | 🟢 **0.36** | 🟢 **0.35** | 🟢 **0.35** |
| 🟢 ranges: filter\_complex | 🟢 **0.41** | 🟢 **0.44** | 🟢 **0.46** | 🟢 **0.48** | 🟢 **0.19** | 🟢 **0.49** |
| ranges: filter\_default | 🟢 **0.94** | 0.97 | 0.96 | 🔴 **1.05** | 🟢 **0.79** | 1.00 |
| ranges: filter\_prerelease\_fallback | 1.01 | 0.98 | 1.00 | 1.02 | 🟢 **0.85** | 1.02 |
| 🟢 ranges: filter\_simple | 0.96 | 🟢 **0.93** | 🟢 **0.92** | 0.98 | 🟢 **0.70** | 🟢 **0.92** |
| 🟢 ranges: intersection | 🟢 **0.53** | 🟢 **0.52** | 🟢 **0.53** | 🟢 **0.53** | 🟢 **0.53** | 🟢 **0.54** |
| 🟢 ranges: is\_disjoint | 🟢 **0.11** | 🟢 **0.11** | 🟢 **0.10** | 🟢 **0.11** | 🟢 **0.10** | 🟢 **0.11** |
| 🟢 ranges: is\_subset | 🟢 **0.10** | 🟢 **0.10** | 🟢 **0.12** | 🟢 **0.10** | 🟢 **0.11** | 🟢 **0.11** |
| ✅ ranges: relation | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 🟢 ranges: singleton | 🟢 **0.39** | 🟢 **0.39** | 🟢 **0.41** | 🟢 **0.40** | 🟢 **0.43** | 🟢 **0.40** |
| 🟢 ranges: union | 🟢 **0.68** | 🟢 **0.68** | 🟢 **0.69** | 🟢 **0.68** | 🟢 **0.64** | 🟢 **0.66** |
| 🟢 requirement: constructor | 🟢 **0.64** | 🟢 **0.60** | 🟢 **0.61** | 🟢 **0.60** | 🟢 **0.59** | 🟢 **0.61** |
| 🟢 resolver: pubgrub | 🟢 **0.46** | 🟢 **0.45** | 🟢 **0.46** | 🟢 **0.46** | 🟢 **0.45** | 🟢 **0.45** |
| 🟢 resolver: resolver\_loop | 🟢 **0.52** | 🟢 **0.50** | 🟢 **0.56** | 🟢 **0.55** | 🟢 **0.55** | 🟢 **0.54** |
| 🟢 specifiers: constructor | 1.00 | 🟢 **0.82** | 🟢 **0.82** | 🟢 **0.80** | 🟢 **0.78** | 🟢 **0.80** |
| 🟢 specifiers: contains\_cold | 🟢 **0.79** | 🟢 **0.78** | 🟢 **0.80** | 🟢 **0.83** | 🟢 **0.80** | 🟢 **0.79** |
| 🟢 specifiers: contains\_complex\_warm | 🟢 **0.49** | 🟢 **0.47** | 🟢 **0.58** | 🟢 **0.64** | 🟢 **0.67** | 🟢 **0.63** |
| 🟢 specifiers: contains\_warm | 🟢 **0.48** | 🟢 **0.50** | 🟢 **0.57** | 🟢 **0.63** | 🟢 **0.53** | 🟢 **0.58** |
| 🟢 specifiers: eq\_specifier\_warm | 🟢 **0.07** | 🟢 **0.08** | 🟢 **0.08** | 🟢 **0.09** | 🟢 **0.09** | 🟢 **0.10** |
| 🟢 specifiers: filter\_compatible\_warm | 🟢 **0.54** | 🟢 **0.55** | 🟢 **0.56** | 🟢 **0.67** | 🟢 **0.65** | 🟢 **0.67** |
| 🟢 specifiers: filter\_complex\_cold | 🟢 **0.65** | 🟢 **0.67** | 🟢 **0.65** | 🟢 **0.70** | 🟢 **0.66** | 🟢 **0.69** |
| 🟢 specifiers: filter\_complex\_warm | 🟢 **0.55** | 🟢 **0.56** | 🟢 **0.57** | 🟢 **0.67** | 🟢 **0.64** | 🟢 **0.67** |
| 🟢 specifiers: filter\_simple\_cold | 🟢 **0.73** | 🟢 **0.69** | 🟢 **0.70** | 🟢 **0.74** | 🟢 **0.66** | 🟢 **0.73** |
| 🟢 specifiers: filter\_simple\_warm | 🟢 **0.59** | 🟢 **0.60** | 🟢 **0.58** | 🟢 **0.64** | 🟢 **0.57** | 🟢 **0.64** |
| 🟢 specifiers: hash\_specifier\_warm | 🟢 **0.09** | 🟢 **0.11** | 🟢 **0.13** | 🟢 **0.12** | 🟢 **0.10** | 🟢 **0.11** |
| 🟢 specifiers: is\_subset(False) | 🟢 **0.76** | 🟢 **0.76** | 🟢 **0.75** | 🟢 **0.77** | 🟢 **0.76** | 🟢 **0.75** |
| 🟢 specifiers: is\_subset(None) | 🟢 **0.71** | 🟢 **0.71** | 🟢 **0.73** | 🟢 **0.74** | 🟢 **0.71** | 🟢 **0.71** |
| 🟢 specifiers: is\_subset(True) | 🟢 **0.69** | 🟢 **0.71** | 🟢 **0.71** | 🟢 **0.71** | 🟢 **0.69** | 🟢 **0.70** |
| 🟢 specifiers: is\_unsatisfiable\_complex\_cold | 🟢 **0.71** | 🟢 **0.70** | 🟢 **0.70** | 🟢 **0.72** | 🟢 **0.67** | 🟢 **0.69** |
| 🟢 specifiers: sort\_and\_dedup\_warm | 🟢 **0.26** | 🟢 **0.29** | 🟢 **0.31** | 🟢 **0.31** | 🟢 **0.29** | 🟢 **0.32** |
| utils: canonicalize\_name | 0.99 | 1.01 | 1.01 | 1.02 | 0.99 | 0.99 |
| version: constructor | 1.00 | 0.98 | 0.96 | 0.96 | 0.96 | 0.96 |
| version: hash | 0.99 | 1.00 | 0.99 | 1.00 | 1.00 | 0.99 |
| version: hash\_warm | 1.01 | 1.00 | 1.00 | 1.00 | 1.02 | 1.01 |
| version: sort\_cold | 1.03 | 0.97 | 1.00 | 1.00 | 0.99 | 1.02 |
| version: sort\_warm | 1.01 | 1.01 | 0.99 | 1.00 | 1.01 | 1.00 |
| 🟢 version: str | 🟢 **0.61** | 🟢 **0.61** | 🟢 **0.77** | 🟢 **0.78** | 🟢 **0.80** | 🟢 **0.81** |
