No unreleased changes.
Features:
- PEP 751: support pylock (:pull:`900`)
- PEP 794: import name metadata (:pull:`948`)
- Support for writing metadata to a file (:pull:`846`)
- Support
__replace__on Version (:pull:`1003`) - Support positional pattern matching for
VersionandSpecifierSet(:pull:`1004`)
Behavior adaptations:
- PEP 440 handling of prereleases for
Specifier.contains,SpecifierSet.contains, andSpecifierSet.filter(:pull:`897`) - Handle PEP 440 edge case in
SpecifierSet.filter(:pull:`942`) - Adjust arbitrary equality intersection preservation in
SpecifierSet(:pull:`951`) - Return
Falseinstead of raising for.containswith invalid version (:pull:`932`) - Support arbitrary equality on arbitrary strings for
SpecifierandSpecifierSet'sfilterandcontainsmethod. (:pull:`954`) - Only try to parse as
Versionon certain marker keys, returnFalseon unequal ordered comparisons (:pull:`939`)
Fixes:
- Update
_hashwhen unpicklingTag()(:pull:`860`) - Correct comment and simplify implicit prerelease handling in
Specifier.prereleases(:pull:`896`) - Use explicit
_GLibCVersionNamedTuplein_manylinux(:pull:`868`) - Detect invalid license expressions containing
()(:pull:`879`) - Correct regex for metadata
'name'format (:pull:`925`) - Improve the message around expecting a semicolon (:pull:`833`)
- Support nested parens in license expressions (:pull:`931`)
- Add space before at symbol in
Requirementsstring (:pull:`953`) - A root logger use found, use a
packaginglogger instead (:pull:`965`) - Better support for subclassing
MarkerandRequirement(:pull:`1022`) - Normalize all extras, not just if it comes first (:pull:`1024`)
- Don't produce a broken repr if
Markerfails to construct (:pull:`1033`)
Performance:
- Avoid recompiling regexes in the tokenizer for a 3x speedup (:pull:`1019`)
- Improve performance in
_manylinux.py(:pull:`869`) - Minor cleanups to
Version(:pull:`913`) - Skip redundant creation of
Version's in specifier comparison (:pull:`986`) - Cache the
Specifier'sVersion(:pull:`985`) - Make
Versiona little faster (:pull:`987`) - Minor
Versionregex cleanup (:pull:`990`) - Faster regex on Python 3.11.5+ for
Version(:pull:`988`, :pull:`1055`) - Lazily calculate
_keyinVersion(:pull:`989`, :pull:`1048`) - Faster
canonicalize_version(:pull:`993`) - Use
re.fullmatchin a couple more places (:pull:`992`, :pull:`1029`) - Use
mapinstead of generator (:pull:`996`) - Deprecate
._version(_Version, aNamedTuple) (:pull:`995`, :pull:`1062`) - Avoid duplicate
Versioncreation incanonicalize_version(:pull:`994`) - Add
__slots__to core classes (:pull:`1001`, :pull:`1002`, :pull:`1032`) - Use
Version.__replace__in specifier comparison (:pull:`999`) - Use
_get_spec_versionin more places inSpecifier(:pull:`1005`) - Pull
setconstruction out of function (:pull:`1012`) - Letter normalization dict for prereleases and the like (:pull:`1014`)
- Use
str.partitionin_parse_project_urls(:pull:`1013`) - Avoid normalizing extras again when comparing (:pull:`1028`)
- Speed up
Version.__str__by about 10% (:pull:`997`) - Much faster
canonicalize_nameby avoiding a regex (:pull:`1030`, :pull:`1047`, :pull:`1064`) - Faster zero stripping (:pull:`1058`)
Type annotations:
- Fix a type annotation (:pull:`907`)
- Fix type hint of function used with
contextlib.contextmanager(:pull:`1046`) - Fix tags return type in
parse_wheel_filenamedocs (:pull:`973`) - Add type hint for
_versionin.version.Version(:pull:`927`) - Changed static type annotations in prereleases setter method in
specifier.py(:pull:`930`) - Statically type our test suite (:pull:`982`)
Internal:
- Test and declare support for Python 3.14 (:pull:`901`)
- Change our license metadata to use an SPDX license expression (:pull:`881`, :pull:`924`)
- Expand the Ruff checks run on our codebase (:pull:`835`, :pull:`957`, :pull:`959`, :pull:`963`, :pull:`956`, :pull:`961`, :pull:`964`, :pull:`958`, :pull:`960`, :pull:`968`, :pull:`967`, :pull:`966`, :pull:`969`, :pull:`980`, :pull:`979`, :pull:`962`, :pull:`984`, :pull:`972`)
- Add spell checking (:pull:`904`, :pull:`910`, :pull:`1015`)
- Improve links back to source in the documentation (:pull:`991`)
- Add case insensitivity tests for arbitrary equality (:pull:`975`)
- Fix incorrectly implicitly concatenated string in specifiers test (:pull:`946`)
- Simpler else instead of assert in a check (:pull:`1027`, :pull:`1031`)
- Synchronize documentation and code for markers (:pull:`1008`)
- Use the GitHub Actions slim runner for the all pass check (:pull:`1021`)
- Use
actionlintto check CI workflows (:pull:`1052`) - Use Trusted Publishing (:pull:`893`, :pull:`1043`, :pull:`1045`, :pull:`1051`)
- Use zizmor to check CI (:pull:`1035`)
- Test on first public release of CPython 3.11 and newer (:pull:`1056`)
Since the final release candidate: Faster canonicalize_name, especially on
Python 3.12 and 3.13, where performance regressed previously (:pull:`1064`),
and reintroduce (deprecated) support for Version._.version (:pull:`1062`).
Third release candidate for 26.0. Avoid bug in CPython 3.11.0-3.11.4 and older PyPy 3.11 (:pull:`1055`).
Second release candidate for 26.0. Fixed a regression in (private)
Version._key for packaging_legacy (:pull:`1048`), and speed up
stripping zeros a little more (:pull:`1058`).
First release candidate for 26.0.
- PEP 751: Add support for
extrasanddependency_groupsmarkers. (:issue:`885`) - PEP 738: Add support for Android platform tags. (:issue:`880`)
- PEP 639: Implement License-Expression and License-File (:issue:`828`)
- Use
!rformatter for error messages with filenames (:issue:`844`) - Add support for PEP 730 iOS tags (:issue:`832`)
- Fix prerelease detection for
>and<(:issue:`794`) - Fix uninformative error message (:issue:`830`)
- Refactor
canonicalize_version(:issue:`793`) - Patch python_full_version unconditionally (:issue:`825`)
- Fix doc for
canonicalize_versionto mentionstrip_trailing_zeroand a typo in a docstring (:issue:`801`) - Fix typo in Version
__str__(:issue:`817`) - Support creating a
SpecifierSetfrom an iterable ofSpecifierobjects (:issue:`775`)
- Document
markers.default_environment()(:issue:`753`). - Add support for Python 3.13 (:issue:`783`).
- Modernise type annotations (:issue:`785`).
- Work around
platform.python_version()returning non PEP 440 compliant version for non-tagged CPython builds (:issue:`802`).
- Do specifier matching correctly when the specifier contains an epoch number and has more components than the version (:issue:`683`)
- Support the experimental
--disable-gilbuilds in packaging.tags (:issue:`727`) - BREAKING: Make optional
metadata.Metadataattributes default toNone(:issue:`733`) - Fix errors when trying to access the
description_content_type,keywords, andrequires_pythonattributes onmetadata.Metadatawhen those values have not been provided (:issue:`733`) - Fix a bug preventing the use of the built in
ExceptionGroupon versions of Python that support it (:issue:`725`)
- Document calendar-based versioning scheme (:issue:`716`)
- Enforce that the entire marker string is parsed (:issue:`687`)
- Requirement parsing no longer automatically validates the URL (:issue:`120`)
- Canonicalize names for requirements comparison (:issue:`644`)
- Introduce
metadata.Metadata(along withmetadata.ExceptionGroupandmetadata.InvalidMetadata; :issue:`570`) - Introduce the
validatekeyword parameter toutils.normalize_name()(:issue:`570`) - Introduce
utils.is_normalized_name()(:issue:`570`) - Make
utils.parse_sdist_filename()andutils.parse_wheel_filename()raiseInvalidSdistFilenameandInvalidWheelFilename, respectively, when the version component of the name is invalid - Remove support for Python 3.7 (:issue:`783`)
- Parse raw metadata (:issue:`671`)
- Import underlying parser functions as an underscored variable (:issue:`663`)
- Improve error for local version label with unsupported operators (:issue:`675`)
- Add dedicated error for specifiers with incorrect
.*suffix - Replace spaces in platform names with underscores (:issue:`620`)
- Relax typing of
_keyon_BaseVersion(:issue:`669`) - Handle prefix match with zeros at end of prefix correctly (:issue:`674`)
- Allow
"extra"to beNonein the marker environment (:issue:`650`) - Refactor
tags._generic_apito useEXT_SUFFIX(:issue:`607`) - Correctly handle trailing whitespace on URL requirements (:issue:`642`)
- Fix typing for
specifiers.BaseSpecifier.filter()(:issue:`643`) - Use stable Python 3.11 in tests (:issue:`641`)
- Correctly handle non-normalised specifiers in requirements (:issue:`634`)
- Move to
src/layout (:issue:`626`) - Remove
__about__file, in favour of keeping constants in__init__(:issue:`626`)
- Explicitly declare support for Python 3.11 (:issue:`587`)
- Remove support for Python 3.6 (:issue:`500`)
- Remove
LegacySpecifierandLegacyVersion(:issue:`407`) - Add
__hash__and__eq__toRequirement(:issue:`499`) - Add a
cpNNN-none-anytag (:issue:`541`) - Adhere to PEP 685 when evaluating markers with extras (:issue:`545`)
- Allow accepting locally installed prereleases with
SpecifierSet(:issue:`515`) - Allow pre-release versions in marker evaluation (:issue:`523`)
- Correctly parse ELF for musllinux on Big Endian (:issue:`538`)
- Document
packaging.utils.NormalizedName(:issue:`565`) - Document exceptions raised by functions in
packaging.utils(:issue:`544`) - Fix compatible version specifier incorrectly strip trailing
0(:issue:`493`) - Fix macOS platform tags with old macOS SDK (:issue:`513`)
- Forbid prefix version matching on pre-release/post-release segments (:issue:`563`)
- Normalize specifier version for prefix matching (:issue:`561`)
- Improve documentation for
packaging.specifiersandpackaging.version. (:issue:`572`) Marker.evaluatewill now assume evaluation environment with emptyextra. Evaluating markers like"extra == 'xyz'"without passing any extra in theenvironmentwill no longer raise an exception (:issue:`550`)- Remove dependency on
pyparsing, by replacing it with a hand-written parser. This package now has no runtime dependencies (:issue:`468`) - Update return type hint for
Specifier.filterandSpecifierSet.filterto useIteratorinstead ofIterable(:issue:`584`)
- Add a
pp3-none-anytag (:issue:`311`) - Replace the blank pyparsing 3 exclusion with a 3.0.5 exclusion (:issue:`481`, :issue:`486`)
- Fix a spelling mistake (:issue:`479`)
- Update documentation entry for 21.1.
- Update pin to pyparsing to exclude 3.0.0.
- PEP 656: musllinux support (:issue:`411`)
- Drop support for Python 2.7, Python 3.4 and Python 3.5.
- Replace distutils usage with sysconfig (:issue:`396`)
- Add support for zip files in
parse_sdist_filename(:issue:`429`) - Use cached
_hashattribute to short-circuit tag equality comparisons (:issue:`417`) - Specify the default value for the
specifierargument toSpecifierSet(:issue:`437`) - Proper keyword-only "warn" argument in packaging.tags (:issue:`403`)
- Correctly remove prerelease suffixes from ~= check (:issue:`366`)
- Fix type hints for
Version.postandVersion.dev(:issue:`393`) - Use typing alias
UnparsedVersion(:issue:`398`) - Improve type inference for
packaging.specifiers.filter()(:issue:`430`) - Tighten the return type of
canonicalize_version()(:issue:`402`)
- Run isort over the code base (:issue:`377`)
- Add support for the
macosx_10_*_universal2platform tags (:issue:`379`) - Introduce
packaging.utils.parse_wheel_filename()andparse_sdist_filename()(:issue:`387` and :issue:`389`)
- Revert back to setuptools for compatibility purposes for some Linux distros (:issue:`363`)
- Do not insert an underscore in wheel tags when the interpreter version number is more than 2 digits (:issue:`372`)
No unreleased changes.
Note
This release was subsequently yanked, and these changes were included in 20.7.
- Fix flit configuration, to include LICENSE files (:issue:`357`)
- Make
intela recognized CPU architecture for theuniversalmacOS platform tag (:issue:`361`) - Add some missing type hints to
packaging.requirements(issue:350)
- Officially support Python 3.9 (:issue:`343`)
- Deprecate the
LegacyVersionandLegacySpecifierclasses (:issue:`321`) - Handle
OSErroron non-dynamic executables when attempting to resolve the glibc version string.
- Canonicalize version before comparing specifiers. (:issue:`282`)
- Change type hint for
canonicalize_nameto returnpackaging.utils.NormalizedName. This enables the use of static typing tools (like mypy) to detect mixing of normalized and un-normalized names.
- Fix changelog for 20.2.
- Fix a bug that caused a 32-bit OS that runs on a 64-bit ARM CPU (e.g. ARM-v8, aarch64), to report the wrong bitness.
- Fix a bug caused by reuse of an exhausted iterator. (:issue:`257`)
- Add type hints (:issue:`191`)
- Add proper trove classifiers for PyPy support (:issue:`198`)
- Scale back depending on
ctypesfor manylinux support detection (:issue:`171`) - Use
sys.implementation.namewhere appropriate forpackaging.tags(:issue:`193`) - Expand upon the API provided by
packaging.tags:interpreter_name(),mac_platforms(),compatible_tags(),cpython_tags(),generic_tags()(:issue:`187`) - Officially support Python 3.8 (:issue:`232`)
- Add
major,minor, andmicroaliases topackaging.version.Version(:issue:`225`) - Properly mark
packaginghas being fully typed by adding apy.typedfile (:issue:`226`)
- Remove dependency on
attrs(:issue:`178`, :issue:`179`) - Use appropriate fallbacks for CPython ABI tag (:issue:`181`, :issue:`185`)
- Add manylinux2014 support (:issue:`186`)
- Improve ABI detection (:issue:`181`)
- Properly handle debug wheels for Python 3.8 (:issue:`172`)
- Improve detection of debug builds on Windows (:issue:`194`)
- Add the
packaging.tagsmodule. (:issue:`156`) - Correctly handle two-digit versions in
python_version(:issue:`119`)
Fix string representation of PEP 508 direct URL requirements with markers.
Better handling of file URLs
This allows for using
file:///absolute/path, which was previously prevented due to the missingnetloc.This allows for all file URLs that
urlunparseturns back into the original URL to be valid.
- Improve error messages when invalid requirements are given. (:issue:`129`)
- Fix
utils.canonicalize_versionwhen supplying non PEP 440 versions.
- Drop support for python 2.6, 3.2, and 3.3.
- Define minimal pyparsing version to 2.0.2 (:issue:`91`).
- Add
epoch,release,pre,dev, andpostattributes toVersionandLegacyVersion(:issue:`34`). - Add
Version().is_devreleaseandLegacyVersion().is_devreleaseto make it easy to determine if a release is a development release. - Add
utils.canonicalize_versionto canonicalize version strings orVersioninstances (:issue:`121`).
- Fix markers that utilize
inso that they render correctly. - Fix an erroneous test on Python RC releases.
- Add support for the deprecated
python_implementationmarker which was an undocumented setuptools marker in addition to the newer markers.
- Add support for the deprecated, PEP 345 environment markers in addition to the newer markers.
- Fix a regression in parsing requirements with whitespaces between the comma separators.
- Fix a regression in parsing requirements like
foo (==4).
- Fix a bug where
packaging.requirements:Requirementwas overly strict when matching legacy requirements.
- Add a function that implements the name canonicalization from PEP 503.
- Implement requirement specifiers from PEP 508.
- Relicense so that packaging is available under either the Apache License, Version 2.0 or a 2 Clause BSD license.
- Support installation of packaging when only distutils is available.
- Fix
==comparison when there is a prefix and a local version in play. (:issue:`41`). - Implement environment markers from PEP 508.
- Normalize post-release spellings for rev/r prefixes. :issue:`35`
- Fix an error where the arbitrary specifier (
===) was not correctly allowing pre-releases when it was being used. - Expose the specifier and version parts through properties on the
Specifierclasses. - Allow iterating over the
SpecifierSetto get access to all of theSpecifierinstances. - Allow testing if a version is contained within a specifier via the
inoperator.
- Fix a logic error that was causing inconsistent answers about whether or not
a pre-release was contained within a
SpecifierSetor not.
- Add
Version().is_postreleaseandLegacyVersion().is_postreleaseto make it easy to determine if a release is a post release. - Add
Version().base_versionandLegacyVersion().base_versionto make it easy to get the public version without any pre or post release markers. - Support the update to PEP 440 which removed the implied
!=V.*when using either>Vor<Vand which instead special cased the handling of pre-releases, post-releases, and local versions when using>Vor<V.
- Normalize release candidates as
rcinstead ofc. - Expose the
VERSION_PATTERNconstant, a regular expression matching a valid version.
- Ensure that versions are normalized before comparison when used in a
specifier with a less than (
<) or greater than (>) operator.
- BACKWARDS INCOMPATIBLE Refactor specifier support so that it can sanely handle legacy specifiers as well as PEP 440 specifiers.
- BACKWARDS INCOMPATIBLE Move the specifier support out of
packaging.versionintopackaging.specifiers.
- Add prerelease support to
Specifier. - Remove the ability to do
item in Specifier()and replace it withSpecifier().contains(item)in order to allow flags that signal if a prerelease should be accepted or not. - Add a method
Specifier().filter()which will take an iterable and returns an iterable with items that do not match the specifier filtered out.
- Allow
LegacyVersionandVersionto be sorted together. - Add
packaging.version.parse()to enable easily parsing a version string as either aVersionor aLegacyVersiondepending on it's PEP 440 validity.
- Initial release.