editdistpy fails to build from source with setuptools >= 82.0.0 because setup.py imports pkg_resources.parse_version, which was removed in
setuptools v82.0.0.
Error
ModuleNotFoundError: No module named 'pkg_resources'
Full traceback occurs during setuptools.build_meta.build_wheel when setup.py is executed.
Root Cause
setup.py line 23:
from pkg_resources import parse_version
pyproject.toml specifies setuptools>=77.0.3 with no upper bound, so setuptools v82+ can be resolved, which no longer ships pkg_resources.
Fix
Replace pkg_resources.parse_version with packaging.version.parse and add packaging to build-system.requires in pyproject.toml.
Environment
- Python 3.12+
- setuptools >= 82.0.0
- uv
Relevant resouces:
editdistpyfails to build from source withsetuptools >= 82.0.0becausesetup.pyimportspkg_resources.parse_version, which was removed insetuptools v82.0.0.
Error
ModuleNotFoundError: No module named 'pkg_resources'
Full traceback occurs during
setuptools.build_meta.build_wheelwhensetup.pyis executed.Root Cause
setup.pyline 23:pyproject.toml specifies setuptools>=77.0.3 with no upper bound, so setuptools v82+ can be resolved, which no longer ships pkg_resources.
Fix
Replace pkg_resources.parse_version with packaging.version.parse and add packaging to build-system.requires in pyproject.toml.
Environment
Relevant resouces: