From c816e9caa2703dbe7a2a716c04109f566acd7107 Mon Sep 17 00:00:00 2001 From: Seth Cope Date: Wed, 10 Jun 2026 21:38:27 -0500 Subject: [PATCH] Remove pkg_resources usage from setup.py (builds fail with setuptools>=82) setuptools 82.0.0 (2026-02-08) removed pkg_resources, so building this project's sdist in a default isolated build environment fails with ModuleNotFoundError: No module named 'pkg_resources'. Use importlib.metadata (stdlib since 3.8) instead of pkg_resources for the setuptools version check. Verified: the patched sdist builds a wheel with setuptools 82 in a clean python:3.12 container; the unpatched one does not. Co-Authored-By: Claude Fable 5 --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index cf5756f..d35f291 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,8 @@ import setuptools -from pkg_resources import get_distribution +from importlib.metadata import version try: - get_distribution("setuptools>=39.2.0") + assert tuple(int(x) for x in version("setuptools").split(".")[:2]) >= (39, 2) except Exception as e: raise AssertionError( "Please upgrade setuptools by `pip install -U setuptools`: {}".format(