Skip to content

[#914] Drop the setuptools<82 build-time pin - #922

Merged
eoyilmaz merged 1 commit into
developfrom
914-drop-setuptools-pin
Jul 23, 2026
Merged

[#914] Drop the setuptools<82 build-time pin#922
eoyilmaz merged 1 commit into
developfrom
914-drop-setuptools-pin

Conversation

@eoyilmaz

@eoyilmaz eoyilmaz commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaces setuptools<82 with setuptools>=77 in pyproject.toml's [build-system] requires. The <82 ceiling 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 was pkg_resources removal, which nothing in this build path touches (only the separately-slated-for-deletion util/ez_setup.py uses it, and it's never imported during a build). setuptools 83.0.0 still vendors a fully working _distutils package, so distutils.core, distutils.util, distutils.command.install, and distutils.filelist all keep working unpinned. The >=77 floor is kept since that's when SPDX license/license-files support (needed by [Packaging] Update project.license to an SPDX string before setuptools' 2027-02-18 deadline #915) landed.
  • Cleans up 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 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, even more clearly dead here since setup(**attrs) is commented out and only console/windows/data_files/zipfile/options are ever read back out of it.
    • It unconditionally rewrote MANIFEST.in from scratch on every py2exe freeze, the exact side effect [Packaging] MANIFEST.in gets silently regenerated as a side effect of building #912 removed from DisplayCAL/setup.py.
    • Removed the now-fully-unused distutils.filelist.findall monkeypatch (never exercised, since this file never invokes distutils' sdist/setup()), and swapped the one live distutils.util.get_platform() call for stdlib sysconfig.get_platform() (verified identical output).
  • Deliberately did not rewrite the real, working distutils.core/distutils.command.install/distutils.util.change_root usage in DisplayCAL/setup.py, native_build.py, or util/make-site-package-dist.py. setuptools has no announced removal date for its vendored distutils shim (only pkg_resources was pulled abruptly), so that larger rewrite is deferred as a separate follow-up rather than bundled here for no currently-proven benefit.

Verification

  • Fresh-clone isolated 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/METADATA intact.
  • Direct native_build.py install --prefix=... (exercises the real distutils.command.install/change_root/get_platform path) produces an identical install tree with setuptools 83 unpinned vs. the setuptools 81 pinned baseline on develop.
  • Full serial pytest run: 2576 passed, 21 skipped, 0 failures.

Test plan

  • CI green across all workflows (Windows/macOS/Linux/Flatpak/pytest)
  • Nightly build workflow succeeds

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).
@eoyilmaz
eoyilmaz merged commit cdf11aa into develop Jul 23, 2026
36 of 37 checks passed
@eoyilmaz
eoyilmaz deleted the 914-drop-setuptools-pin branch July 23, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant