Upgrading setuptools 83 to 84
Breaking83.0.0 → 84.2.1Breaking2Security2Deprecated1New2Changed8Fixed8Other3
SecurityLowWheel.install_as_egg no longer creates namespace package directories outside the destination egg directory; namespace entries are validated as dotted module names.GHSA-xmj3-9gf7-h52w ↗
BreakingUpgrade verdict
2 breaking changes and 2 security fixes.
In plain terms
- Some compiler error types and return values changed: the macOS deployment-target error is now a compilers PlatformError, gcc_version returns a packaging Version, and runtime_library_dir_option returns a list for GNU ld.
- The compiler code now uses its own set of error types instead of the old distutils errors, so code that catches the old specific errors may need updating.
- Installing a wheel as an egg could be tricked into writing files outside the target folder by a malicious namespace_packages.txt entry. That is now blocked.
- Crafted archive file names could escape the folder you unpack into on Windows. Such names are now rejected on every platform.
Must act 5 items need code or config changes
What you must change
Breaking2
Low MACOSX_DEPLOYMENT_TARGET now raises compilers.errors.PlatformError, gcc_version returns packaging.version.Version, and runtime_library_dir_option returns a list.
MACOSX_DEPLOYMENT_TARGETcompilers.errors.PlatformErrordistutils.errors.DistutilsPlatformErrorCygwinCCompiler.gcc_versionUnixCCompiler.runtime_library_dir_optiondistutils.compat.consolidate_linker_argsCompilers define their own exception vocabulary; PlatformError replaces DistutilsPlatformError/DistutilsModuleError, and newer raises FileNotFoundError.
distutils.compilers.errors.Errordistutils.compilers.errors.UnknownFileTypedistutils.compilers.errors.PlatformErrordistutils.compilers.C.errors.CompileErrordistutils.compilers.C.errors.LinkErrordistutils.compilers.C.errors.LibErrordistutils.compilers.C.errors.PreprocessErrordistutils.errors.CCompilerErrorSecurity2
Wheel.install_as_egg no longer creates namespace package directories outside the destination egg directory; namespace entries are validated as dotted module names.
Wheel.install_as_eggnamespace_packages.txtsetup_requiressetup()Lowsetuptools.archive_util no longer extracts archive members outside the requested extraction directory; backslash, drive letter and UNC names are rejected.
setuptools.archive_utilDeprecations to plan for
Deprecated1
Compiler.spawn is deprecated in favor of Compiler.call, and the MSVC spawn compatibility shim for old monkeypatches is removed.
Compiler.spawnCompiler.calldistutils.spawn.spawnDistutilsExecErrorAPI changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- added:
class UnsafeMember(DistutilsError)
- changed:
field bdist_egg.boolean_options → field bdist_egg.boolean_options: ClassVar[list[str]] - changed:
field bdist_egg.user_options → field bdist_egg.user_options: ClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]] - changed:
function sorted_walk(dir: GenericPath[AnyStr]) -> Iterator[tuple[AnyStr, list[AnyStr], list[AnyStr]]] → function sorted_walk(dir: GenericPath[_StrOrBytesT]) -> Iterator[tuple[_StrOrBytesT, list[_StrOrBytesT], list[_StrOrBytesT]]]
- changed:
field bdist_wheel.boolean_options → field bdist_wheel.boolean_options: ClassVar[list[str]] - changed:
field bdist_wheel.supported_compressions → field bdist_wheel.supported_compressions: ClassVar[dict[str, int]] - changed:
field bdist_wheel.user_options → field bdist_wheel.user_options: ClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]] - added:
function stable_abi_tag(impl_name, impl_version) - added:
property bdist_wheel.abi_tag -> str
- changed:
field develop.boolean_options → field develop.boolean_options: ClassVar[list[str]] - changed:
field develop.user_options → field develop.user_options: ClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]]
- changed:
field dist_info.boolean_options → field dist_info.boolean_options: ClassVar[list[str]] - changed:
field dist_info.negative_opt → field dist_info.negative_opt: ClassVar[dict[str, str]] - changed:
field dist_info.user_options → field dist_info.user_options: ClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]]
- changed:
field editable_wheel.user_options → field editable_wheel.user_options: ClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]]
- changed:
field egg_info.boolean_options → field egg_info.boolean_options: ClassVar[list[str]] - changed:
field egg_info.negative_opt → field egg_info.negative_opt: ClassVar[dict[str, str]] - changed:
field egg_info.user_options → field egg_info.user_options: ClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]]
- changed:
field install_egg_info.user_options → field install_egg_info.user_options: ClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]]
- changed:
field rotate.user_options → field rotate.user_options: ClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]]
- changed:
field sdist.README_EXTENSIONS → field sdist.README_EXTENSIONS: ClassVar[list[str]] - changed:
field sdist.user_options → field sdist.user_options: ClassVar[list[tuple[str, str | None, str]]]
- changed:
field option_base.boolean_options → field option_base.boolean_options: ClassVar[list[str]] - changed:
field option_base.user_options → field option_base.user_options: ClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]]
- changed:
field ConfigMetadataHandler.aliases → field ConfigMetadataHandler.aliases: ClassVar[dict[str, str]]
- changed:
function glob(pathname: AnyStr, recursive: bool=…) -> list[AnyStr] → function glob(pathname: _StrOrBytesT, recursive: bool=…) -> list[_StrOrBytesT] - changed:
function iglob(pathname: AnyStr, recursive: bool=…) -> Iterator[AnyStr] → function iglob(pathname: _StrOrBytesT, recursive: bool=…) -> Iterator[_StrOrBytesT]