What's Changed
Features:
- PEP 751: support pylock by @sbidoul in #900
- PEP 794: import name metadata by @brettcannon in #948
- Support writing metadata by @henryiii in #846
- Support
__replace__forVersionby @henryiii in #1003 - Support positional pattern matching for
VersionandSpecifierby @henryiii in #1004
Behavior adaptations:
- PEP 440 handling of prereleases for
Specifier.contains,SpecifierSet.contains, andSpecifierSet.filterby @notatallshaw in #897 - Handle PEP 440 edge case in
SpecifierSet.filterby @notatallshaw in #942 - Adjust arbitrary equality intersection preservation in
SpecifierSetby @notatallshaw in #951 - Return
Falseinstead of raising for.containswith invalid version by @Liam-DeVoe in #932 - Support arbitrary equality on arbitrary strings for
SpecifierandSpecifierSet'sfilterandcontainsmethod. by @notatallshaw in #954 - Only try to parse as
Versionon certain marker keys, returnFalseon unequal ordered comparsions by @JP-Ellis in #939
Fixes:
- Update
_hashwhen unpicklingTag()by @dholth in #860 - Correct comment and simplify implicit prerelease handling in
Specifier.prereleasesby @notatallshaw in #896 - Use explicit
_GLibCVersionNamedTuplein_manylinuxby @cthoyt in #868 - Detect invalid license expressions containing
()by @bwoodsend in #879 - Correct regex for metadata
'name'format by @di in #925 - Improve the message around expecting a semicolon by @pradyunsg in #833
- Support nested parens in license expressions by @Liam-DeVoe in #931
- Add space before at symbol in
Requirementsstring by @henryiii in #953 - A root logger use found by ruff LOG, use
packaginglogger instead by @henryiii in #965 - Better support for subclassing
MarkerandRequirementby @henryiii in #1022 - Normalize all extras, not just if it comes first by @henryiii in #1024
- Don't produce a broken repr if
Markerfails to construct by @henryiii in #1033
Performance:
- Avoid recompiling regexes in the tokenizer for a 3x speedup by @hauntsaninja in #1019
- Improve performance in
_manylinux.pyby @cthoyt in #869 - Minor cleanups to
Versionby @bearomorphism in #913 - Skip redundant creation of
Versions in specifier comparison by @notatallshaw in #986 - Cache
Specifier's Version by @notatallshaw in #985 - Make
Versiona little faster by @henryiii in #987 - Minor
Versionregex cleanup by @henryiii in #990 - Faster regex on Python 3.11+ by @henryiii in #988
- Lazily calculate
_keyinVersionby @notatallshaw in #989 - Faster
canonicalize_versionby @henryiii in #993 - Use
fullmatchin a couple more places by @henryiii in #992 - Use
fullmatchfor markers too by @henryiii in #1029 - Use
mapinstead of generator by @henryiii in #996 - Drop
._version(_Version, aNamedTuple) by @henryiii in #995 - Avoid duplicate
Versioncreation incanonicalize_versionby @henryiii in #994 - Add
__slots__toVersionby @henryiii in #1001 - Add
__slots__toSpecifiers by @henryiii in #1002 - Add
__slots__toNodes by @henryiii in #1032 - Use
version.__replace__in specifier comparison by @notatallshaw in #999 - Use
_get_spec_versionin more places inSpecifierby @notatallshaw in #1005 - Pull
setconstruction out of function by @henryiii in #1012 - Letter normalization dict for prereleases and the like by @henryiii in #1014
- Avoid normalizing extras again when comparing by @henryiii in #1028
- Speed up
Version.__str__by about 10% by @henryiii in #997 - Double the performance of
canonicalize_nameby avoiding a regex by @henryiii in #1030
Type annotations:
- Fix a type annotation by @brettcannon in #907
- Fix tags return type in
parse_wheel_filenamedocs by @ncoghlan in #973 - Add type hint for
_versionin.version.Versionby @brettcannon in #927 - Changed static type annotations in prereleases setter method in
specifier.pyby @subhajitsaha01 in #930 - Statically type the tests by @henryiii in #982
Internal:
- Test and declare support Python 3.14 by @henryiii in #901
- Modernize and speed up tests on Python 3.14 by @henryiii in #903
- Change our license metadata to use an SPDX license expression by @cdce8p in #881
- No need for
license-filesby @DimitriPapadopoulos in #924 - Update mypy by @hauntsaninja in #891
- Some config updates by @henryiii in #902
- Add spell check and rst check by @henryiii in #904
- Clean up ruff ignores by @henryiii in #905
- Update example for env marker
python_versionby @trim21 in #908 - Move codespell configuration into pyproject.toml by @yarikoptic in #910
- Check warning a little more precisely by @henryiii in #837
- Speed up mypy a little by @henryiii in #836
- Apply ruff/flake8-pyi rules (PYI) by @DimitriPapadopoulos in #835
- Better local runs for codespell by @henryiii in #911
- Remove outdated/confusing Gist link by @stefan6419846 in #921
- Fix docs and docs ci after #897 landed by @notatallshaw in #926
- Run twine-check on push in CI by @EpicWink in #922
ruffwas renamedruff-checkin pre-commit by @henryiii in #933- Fix incorrectly implicitly concatenated string in specifiers test by @notatallshaw in #946
- Simplify conditional by @ofek in #949
- Modernize nox, use dependency-groups for tests by @henryiii in #952
- Add more checks that don't affect anything by @henryiii in #957
- Enable Ruff ISC rule by @henryiii in #959
- Ruff code FLY by @henryiii in #963
- pytest
log_levelis better thanlog_cli_levelby @henryiii in #956 - Ruff code TRY by @henryiii in #961
- Add the ruff PL checks by @henryiii in #964
- Enable Ruff ARG rules by @henryiii in #958
- Ruff PT code (pytest) by @henryiii in #960
- Add ruff DTZ by @henryiii in #968
- Add ruff BLE by @henryiii in #967
- Add the ruff SIM checks by @henryiii in #966
- Adding ruff PERF by @henryiii in #969
- Move some config into coverage config by @henryiii in #971
- Check ruff C4 by @henryiii in #962
- Adding ruff T20 by @henryiii in #972
- Add a tests pass job by @henryiii in #977
- Add ruff TC by @henryiii in #980
- Adding part of ruff RET by @henryiii in #979
- Reorder mypy check by @henryiii in #983
- Enable ruff ALL by @henryiii in #984
- Link back to repo/source in furo by @henryiii in #991
- Add case insensitivity tests for arbitrary equality by @notatallshaw in #975
- Synchronize documentation and code for markers by @zahlman in #1008
- Use
partitionin_parse_project_urlsby @henryiii in #1013 - auto-skip the dependabot PRs in the release changelog generation by @henryiii in #1016
- Update unreleased section in changelog by @henryiii in #1017
- Fix PR role to match extlinks by @hugovk in #1020
- Mention new parts in README by @henryiii in #1023
- Replace a couple of asserts with else by @henryiii in #1027
- Simplify and/or check a little more by @henryiii in #1031
- Use slim runner for all check by @henryiii in #1021
- Use typos instead of codespell by @henryiii in #1015
- Update changelog with recent additions by @henryiii in #1034
- Publish to PyPI via GitHub CI by @EpicWink in #893
- Use prek for faster pre-commit lint step by @henryiii in #1037
- Add help text to noxfile by @henryiii in #1038
- Update licenses to 3.27 by @henryiii in #1036
- Use relative import in
packaging.licensesby @notatallshaw in #1039 - Add zizmor and tighten up CI by @henryiii in #1035
- Fix release script by @henryiii in #1040
- Fix using a dev version (again) by @henryiii in #1041
New Contributors
- @cdce8p made their first contribution in #881
- @dholth made their first contribution in #860
- @trim21 made their first contribution in #908
- @yarikoptic made their first contribution in #910
- @cthoyt made their first contribution in #868
- @bwoodsend made their first contribution in #879
- @stefan6419846 made their first contribution in #921
- @bearomorphism made their first contribution in #913
- @EpicWink made their first contribution in #922
- @Liam-DeVoe made their first contribution in #932
- @subhajitsaha01 made their first contribution in #930
- @ncoghlan made their first contribution in #973
- @zahlman made their first contribution in #1008
- @JP-Ellis made their first contribution in #939
Full Changelog: 25.0...26.0rc1