[#914] Drop the setuptools<82 build-time pin - #922
Merged
Conversation
Empirically verified (fresh-clone `python -m build` sdist -> wheel-from- sdist on Python 3.9 and 3.14, plus a direct `native_build.py install --prefix=...` exercising `distutils.command.install`/`change_root`/ `get_platform`) that setuptools 83.0.0 still vendors a working `_distutils` package, so the ceiling isn't actually needed: the real setuptools 82 breaking change was `pkg_resources` removal, which this build never touches. Replaced `setuptools<82` with `setuptools>=77` (floor kept for the SPDX `license`/`license-files` support #915 needs). Also cleaned up `DisplayCAL/freeze.py`, which duplicated both anti- patterns #912 and #913 already fixed in `DisplayCAL/setup.py` but was never itself touched: its `attrs` dict carried the same dead `name`/ `classifiers`/`description`/`license`/`long_description`/`entry_points` metadata (more clearly dead here since `setup(**attrs)` is commented out and only `console`/`windows`/`data_files`/`zipfile`/`options` are ever read from it), and it unconditionally rewrote MANIFEST.in on every py2exe freeze. Removed both, along with the now-fully-unused `distutils.filelist.findall` monkeypatch (never exercised, since this file never invokes distutils' sdist/setup), swapping the one live `distutils.util.get_platform` call for stdlib `sysconfig.get_platform`. Left the real, working `distutils.core`/`distutils.command.install`/ `distutils.util.change_root` usage in `DisplayCAL/setup.py`, `native_build.py`, and `util/make-site-package-dist.py` untouched. setuptools still vendors these with no announced removal date, and a full rewrite carries real risk for no currently-proven benefit. Verified via a fresh-clone isolated sdist -> wheel-from-sdist build (resolves setuptools 83.0.0, 711 files, entry_points/METADATA intact) and a full serial `pytest` run (2576 passed, 21 skipped).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setuptools<82withsetuptools>=77inpyproject.toml's[build-system]requires. The<82ceiling was introduced because "some functionalities DisplayCAL currently requires are deprecated" (util/ez_setup.py: pkg_resources is removed from setuptools 82+ #667), but empirical testing shows the actual setuptools 82 breaking change waspkg_resourcesremoval, which nothing in this build path touches (only the separately-slated-for-deletionutil/ez_setup.pyuses it, and it's never imported during a build). setuptools 83.0.0 still vendors a fully working_distutilspackage, sodistutils.core,distutils.util,distutils.command.install, anddistutils.filelistall keep working unpinned. The>=77floor is kept since that's when SPDXlicense/license-filessupport (needed by [Packaging] Update project.license to an SPDX string before setuptools' 2027-02-18 deadline #915) landed.DisplayCAL/freeze.py, which turned out to duplicate both anti-patterns [Packaging] MANIFEST.in gets silently regenerated as a side effect of building #912 and [Packaging] Build metadata is duplicated between pyproject.toml and DisplayCAL/setup.py, and has already drifted #913 already fixed inDisplayCAL/setup.py, but was never itself touched:attrsdict carried the same deadname/classifiers/description/license/long_description/entry_pointsmetadata, even more clearly dead here sincesetup(**attrs)is commented out and onlyconsole/windows/data_files/zipfile/optionsare ever read back out of it.MANIFEST.infrom scratch on every py2exe freeze, the exact side effect [Packaging] MANIFEST.in gets silently regenerated as a side effect of building #912 removed fromDisplayCAL/setup.py.distutils.filelist.findallmonkeypatch (never exercised, since this file never invokes distutils'sdist/setup()), and swapped the one livedistutils.util.get_platform()call for stdlibsysconfig.get_platform()(verified identical output).distutils.core/distutils.command.install/distutils.util.change_rootusage inDisplayCAL/setup.py,native_build.py, orutil/make-site-package-dist.py. setuptools has no announced removal date for its vendored distutils shim (onlypkg_resourceswas pulled abruptly), so that larger rewrite is deferred as a separate follow-up rather than bundled here for no currently-proven benefit.Verification
python -m build(sdist -> wheel-from-sdist) on both Python 3.14 and Python 3.9, resolving unpinned setuptools 83.0.0: succeeds, wheel has 711 files,entry_points.txt/METADATAintact.native_build.py install --prefix=...(exercises the realdistutils.command.install/change_root/get_platformpath) produces an identical install tree with setuptools 83 unpinned vs. the setuptools 81 pinned baseline ondevelop.pytestrun: 2576 passed, 21 skipped, 0 failures.Test plan