26.1
Features:
PEP 783: add handling for Emscripten wheel tags by @hoodmane in https://github.com/pypa/packaging/pull/804(old name used in implementation, will be fixed in next release)- PEP 803: add handling for the
abi3.abi3tfree-threading tag by @ngoldbaum in https://github.com/pypa/packaging/pull/1099 - PEP 723: add
packaging.dependency_groupsmodule, based on thedependency-groupspackage by @sirosen in https://github.com/pypa/packaging/pull/1065 - Add the
packaging.direct_urlmodule by @sbidoul in https://github.com/pypa/packaging/pull/944 - Add the
packaging.errorsmodule by @henryiii in https://github.com/pypa/packaging/pull/1071 - Add
SpecifierSet.is_unsatisfiableusing ranges (new internals that will be expanded in future versions) by @notatallshaw in https://github.com/pypa/packaging/pull/1119 - Add
create_compatible_tags_selectorto select compatible tags by @sbidoul in https://github.com/pypa/packaging/pull/1110 - Add a
keyargument toSpecifierSet.filter()by @frostming in https://github.com/pypa/packaging/pull/1068 - Support
&and|forMarker's by @henryiii in https://github.com/pypa/packaging/pull/1146 - Normalize
Version.__replace__and addVersion.from_partsby @henryiii in https://github.com/pypa/packaging/pull/1078 - Add an option to validate compressed tag set sort order in
parse_wheel_filenameby @r266-tech in https://github.com/pypa/packaging/pull/1150
Behavior adaptations:
- Narrow exclusion of pre-releases for
<V.postNto match spec by @notatallshaw in https://github.com/pypa/packaging/pull/1140 - Narrow exclusion of post-releases for
>Vto match spec by @notatallshaw in https://github.com/pypa/packaging/pull/1141 - Rename
format_full_versionto_format_full_versionto make it visibly private by @r266-tech in https://github.com/pypa/packaging/pull/1125 - Restrict local version to ASCII by @henryiii in https://github.com/pypa/packaging/pull/1102
Pylock (PEP 751) updates:
- Add pylock
selectfunction by @sbidoul in https://github.com/pypa/packaging/pull/1092 - Document pylock
select()method andPylockSelectErrorby @r266-tech in https://github.com/pypa/packaging/pull/1153 - Add
filenameproperty toPackageSdistandPackageWheel, more validation by @sbidoul in https://github.com/pypa/packaging/pull/1095 - Give preference to path over url by @sbidoul in https://github.com/pypa/packaging/pull/1128
- Validate name/version consistency in file names by @sbidoul in https://github.com/pypa/packaging/pull/1114
Fixes:
- Fix
>comparison for versions with dev+local segments by @veeceey in https://github.com/pypa/packaging/pull/1097 - Fix incorrect self-comparison for
InfinityTypeandNegativeInfinityTypeby @bysiber in https://github.com/pypa/packaging/pull/1093 - Canonicalize when deduplicating specifiers in
SpecifierSetby @notatallshaw in https://github.com/pypa/packaging/pull/1109 - Fix charset error message formatting by @notatallshaw in https://github.com/pypa/packaging/pull/1121
- Handle the
keyparameter inSpecifierSet.filterwhen specifiers are empty and prerelease isFalseby @notatallshaw in https://github.com/pypa/packaging/pull/1096 - Standardize inner components of
reproutput by @henryiii in https://github.com/pypa/packaging/pull/1090 Specifier's===uses original string, not normalized, when available by @notatallshaw in https://github.com/pypa/packaging/pull/1124- Propagate int-max-str-digits
ValueErrorby @notatallshaw in https://github.com/pypa/packaging/pull/1155
Performance:
- Add fast path for parsing simple versions (digits and dots only) by @notatallshaw in https://github.com/pypa/packaging/pull/1082
- Add fast path for
VersiontoVersioncomparison by skipping_keyproperty by @notatallshaw in https://github.com/pypa/packaging/pull/1083 - Cache
Versionhash value in dedicated slot by @notatallshaw in https://github.com/pypa/packaging/pull/1118 - Overhaul
_cmpkeyto remove use of custom objects by @notatallshaw in https://github.com/pypa/packaging/pull/1116 - Skip
__replace__in Specifier comparison if not needed by @notatallshaw in https://github.com/pypa/packaging/pull/1081 SpecifierSetusetupleinstead offrozensetfor_specsby @notatallshaw in https://github.com/pypa/packaging/pull/1108- Speed up complex
SpecifierSetfiltering by implementing cost-based ordering by @notatallshaw in https://github.com/pypa/packaging/pull/1105 - Speed up wildcard comparison by @notatallshaw in https://github.com/pypa/packaging/pull/1111
- Stream PEP440 filtering in
SpecifierSet.filterby @notatallshaw in https://github.com/pypa/packaging/pull/1076 - Add
__slots__toMarkerby @henryiii in https://github.com/pypa/packaging/pull/1147 - Simply
Specifierregex by @sirosen in https://github.com/pypa/packaging/pull/1106 - Skip using the hash property internally by @notatallshaw in https://github.com/pypa/packaging/pull/1115
Internal:
- Add downstream testing by @henryiii in https://github.com/pypa/packaging/pull/1049
- Benchmarking suite by @henryiii in https://github.com/pypa/packaging/pull/1059
- Benchmark variance reduction by @notatallshaw in https://github.com/pypa/packaging/pull/1107
- Add property-based tests for PEP 440 by @notatallshaw in https://github.com/pypa/packaging/pull/1144
- Clean up a few
collections.namedtuplein tests by @henryiii in https://github.com/pypa/packaging/pull/1070 - Do not reload the tags module in tests by @henryiii in https://github.com/pypa/packaging/pull/1152
- Limit
dir()/ tab-completion in REPL by @henryiii in https://github.com/pypa/packaging/pull/1011 - Add more
__all__/__dir__by @henryiii in https://github.com/pypa/packaging/pull/1069 - Cleanup pre-commit a bit by @henryiii in https://github.com/pypa/packaging/pull/1080
- Pin pre-commit file, use dependabot by @henryiii in https://github.com/pypa/packaging/pull/1133
- Remove sphinx-toolbox by @henryiii in https://github.com/pypa/packaging/pull/1135
- Use docs group, faster readthedocs by @henryiii in https://github.com/pypa/packaging/pull/1061
- Add free-threaded Python to CI by @henryiii in https://github.com/pypa/packaging/pull/1098
- Simplify combining
SpecifierSet.prereleasesby @notatallshaw in https://github.com/pypa/packaging/pull/1073 - Use direct operator methods in
_compare_compatibleby @notatallshaw in https://github.com/pypa/packaging/pull/1100 - Remove unnecessary if statement in
Specifier.prereleasesby @notatallshaw in https://github.com/pypa/packaging/pull/1074 - Remove unneeded nesting in
Specifier.prereleasesby @notatallshaw in https://github.com/pypa/packaging/pull/1072
Documentation:
- Fix documentation: grammar, typos, formatting, and outdated references by @DimitriPapadopoulos in https://github.com/pypa/packaging/pull/1084
- Fix versionadded for
Version.from_parts()by @Jackenmen in https://github.com/pypa/packaging/pull/1134 - Document
&and|operators for combiningMarkerobjects by @r266-tech in https://github.com/pypa/packaging/pull/1151 - Expand and clean up
Versiondocumentation by @henryiii in https://github.com/pypa/packaging/pull/1089 - Move license docs inline by @henryiii in https://github.com/pypa/packaging/pull/1131
- Move markers inline by @henryiii in https://github.com/pypa/packaging/pull/1104
- Move tags docs to inline by @henryiii in https://github.com/pypa/packaging/pull/1130
- Move utilities inline, like other modules by @henryiii in https://github.com/pypa/packaging/pull/1103
Benchmarks
Performance improvements since 26.0, from the new integrated benchmark suite:
uv run asv run 26.0..HEAD
New Contributors
- @veeceey made their first contribution in https://github.com/pypa/packaging/pull/1097
- @bysiber made their first contribution in https://github.com/pypa/packaging/pull/1093
- @sirosen made their first contribution in https://github.com/pypa/packaging/pull/1106
- @Jackenmen made their first contribution in https://github.com/pypa/packaging/pull/1134
- @ngoldbaum made their first contribution in https://github.com/pypa/packaging/pull/1099
- @r266-tech made their first contribution in https://github.com/pypa/packaging/pull/1151
- @hoodmane made their first contribution in https://github.com/pypa/packaging/pull/804
Full Changelog: https://github.com/pypa/packaging/compare/26.0...26.1