Changelog & Version History
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The "Changelog & Version History" for python-multipart serves as the official record of the project's evolution, documenting feature additions, performance optimizations, security enhancements, and breaking changes. As a streaming multipart parser, maintaining a clear version history is critical for downstream projects (like FastAPI or Starlette) that rely on its stability for handling file uploads and form data.
The project follows a semantic versioning approach, transitioning from early iterations under the multipart name to the modern python_multipart package structure. Significant historical milestones include the migration to pyproject.toml for modern packaging standards and the enforcement of 100% test coverage to ensure reliability across all supported Python versions.
Sources: CHANGELOG.md:1-200, README.md:1-15, pyproject.toml:1-40
Project Lifecycle and Package Evolution
The project underwent a significant renaming phase to resolve import ambiguities. Version 0.0.12 introduced strict typing and coverage enforcement, while 0.0.13 and 0.0.14 finalized the transition from the multipart import name to python_multipart. This transition included a fallback mechanism to maintain backward compatibility for existing users.
Versioning Milestones
| Version Range | Primary Focus | Key Changes |
|---|---|---|
| 0.0.6 - 0.0.9 | Infrastructure | Migration to pyproject.toml, Python 3.11/3.12 support. |
| 0.0.10 - 0.0.12 | DX & Reliability | Strict typing (mypy), 100% coverage, improved error messaging. |
| 0.0.13 - 0.0.17 | Namespace Transition | Renaming to python_multipart, adding dunder attributes. |
| 0.0.24 - 0.0.29 | Performance & Security | Boundary length caps, header limits, and malformed RFC 2231 handling. |
Sources: CHANGELOG.md:5-150, pyproject.toml:90-110
Architectural Evolution of Parsers
The core parsing logic has evolved from basic buffer management to a sophisticated state-machine architecture. This history is reflected in the addition of MultipartState and QuerystringState enums in version 0.0.9, which formalized the parser transitions.
The diagram shows the transition from regex-based header parsing to the modern state-machine architecture using IntEnum.
Sources: CHANGELOG.md:143-155, python_multipart/multipart.py:100-140
Security and Performance History
Recent versions (0.0.24+) have prioritized security against Denial of Service (DoS) attacks and performance bottlenecks.
Security Enhancements
- Header Limits: Introduced in 0.0.27 to prevent memory exhaustion from excessive multipart headers (
MAX_HEADER_COUNTandMAX_HEADER_SIZE). - Boundary Validation: Version 0.0.28 capped the multipart boundary length at 256 bytes to prevent algorithmic complexity issues during tail scans.
- RFC Compliance: Version 0.0.29 improved robustness by handling malformed RFC 2231 continuations in header parsing.
Performance Optimizations
- Tail Scanning: Version 0.0.28 replaced manual iteration with
bytes.findfor partial-boundary scans, significantly speeding up data processing. - Preamble/Epilogue Handling: Version 0.0.26 optimized the skipping of preamble data before the first boundary and silently discarding epilogue data after the final boundary.
Sources: CHANGELOG.md:5-35, python_multipart/multipart.py:155-170, python_multipart/multipart.py:910-950
Language and Environment Support
The project maintains a strict lifecycle for Python version support, quickly adopting new releases while dropping End-of-Life (EOL) versions.
The version history shows a consistent pattern of modernization by supporting the latest Python interpreters.
Sources: CHANGELOG.md:45-165, pyproject.toml:15-30
Release Implementation Details
Versions are managed dynamically via the hatchling build system. The version string is sourced from python_multipart/__init__.py.
[tool.hatch.version]
path = "python_multipart/__init__.py"
[project]
name = "python-multipart"
dynamic = ["version"]
# Sources: pyproject.toml:4, 85
Dependency Evolution
The project has moved toward a zero-dependency model for runtime, as shown in pyproject.toml. All external tools like pytest, ruff, and mypy are categorized under development groups. This ensures that the core python-multipart installation remains lightweight.
Sources: pyproject.toml:35-65, CHANGELOG.md:155-160
Summary
The version history of python-multipart reflects a transition from a community-driven tool to a highly optimized, production-grade library. Key phases include the namespace transition to python_multipart, the formalization of parser states, and the recent implementation of security constraints and performance optimizations. By enforcing 100% test coverage and strict typing, the project ensures that each version remains a reliable component of the Python web ecosystem.
Sources: CHANGELOG.md:1-200, README.md:1-10