Update pyproject TOML to specific setuptools version#17
Update pyproject TOML to specific setuptools version#17justin-a-sanders merged 1 commit intoNoble-Lab:mainfrom
Conversation
📝 WalkthroughWalkthroughA dependency version constraint for setuptools was added to the project configuration file. The change specifies that setuptools versions below 70.0.0 should be used, restricting the package to older compatible versions. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@pyproject.toml`:
- Line 16: Update the setuptools constraint and plan for migrating
pkg_resources: relax the dependency in pyproject.toml from "setuptools<70.0.0"
to "setuptools<81" to allow newer setuptools releases, and add a follow-up task
to migrate usages of pkg_resources in cascadia/version.py (currently importing
get_distribution and DistributionNotFound) to importlib.metadata (or
importlib_metadata backport for Python <3.8) — replace
get_distribution/DistributionNotFound usage with importlib.metadata.version and
corresponding exceptions, and ensure tests/packaging checks still pass after the
change.
| ] | ||
| requires-python = ">=3.8" | ||
| dependencies = [ | ||
| "setuptools<70.0.0", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for pkg_resources usage in the codebase
echo "=== Searching for pkg_resources imports ==="
rg -n "from pkg_resources import|import pkg_resources" --type py
echo ""
echo "=== Searching for pkg_resources usage patterns ==="
rg -n "pkg_resources\." --type py
echo ""
echo "=== Check pyproject.toml full context ==="
cat -n pyproject.toml | head -50Repository: Noble-Lab/cascadia
Length of output: 1618
🌐 Web query:
setuptools pkg_resources removal version 70 81 deprecation timeline
💡 Result:
setuptools/pkg_resources deprecation → removal timeline (re: versions ~70, 80.9, 81)
-
Setuptools 70.x (2024): not the
pkg_resourcesremoval point; the “70” you’re seeing is usually from people pinning defensively (e.g.,setuptools<=70), not from an announcedpkg_resourcesremoval in that release line. (No primary removal event is associated with 70.x in the sources below.) -
Deprecation warning starts showing up broadly in Setuptools 80.9.0 (released May 27, 2025): users began seeing the runtime warning: “
pkg_resources is deprecated as an API… pin toSetuptools<81… removal as early as 2025-11-30.”
Sources: PyPI release date for 80.9.0 [1]; example reports triggered by 80.9.0 [2]. -
Planned earliest removal date communicated in the warning: 2025‑11‑30 (“as early as”): this date appears in the deprecation warning text that downstream projects reported.
Sources: downstream issue reports quoting the warning [2], [3]. -
Setuptools 81.0.0 (released Feb 6, 2026):
pkg_resourcesis treated as removed / no longer available in the 81 line per downstream breakage reports and migration guidance (hence the common recommendation to pinsetuptools<81until you migrate).
Sources: PyPI release date for 81.0.0 [1]; downstream reports/migration notes referencing removal in v81 [3], [4]. -
Current docs (Setuptools 82.x as of Feb 2026):
pkg_resourcesusage is explicitly deprecated in favor ofimportlib.resources/importlib.metadata.
Source: Setuptools documentation [5].
Sources: [1] [2] [3] [4] [5]
Relax the setuptools version constraint and plan for migration.
The current constraint setuptools<70.0.0 is overly restrictive. According to official Setuptools guidance, pkg_resources deprecation warnings begin in v80.9.0 (May 2025) and removal occurs in v81.0.0 (Feb 2026). The correct short-term workaround is to pin to setuptools<81, not <70.0.0, allowing access to newer setuptools features and security fixes released between versions 70 and 81.
- "setuptools<70.0.0",
+ "setuptools<81",pkg_resources is currently used in cascadia/version.py:25 to import get_distribution and DistributionNotFound. This usage should be migrated to importlib.metadata (or its backport for Python <3.8 compatibility), which is the official replacement. Consider opening a follow-up issue to complete this migration before Setuptools v81 becomes standard in the ecosystem.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "setuptools<70.0.0", | |
| "setuptools<81", |
🤖 Prompt for AI Agents
In `@pyproject.toml` at line 16, Update the setuptools constraint and plan for
migrating pkg_resources: relax the dependency in pyproject.toml from
"setuptools<70.0.0" to "setuptools<81" to allow newer setuptools releases, and
add a follow-up task to migrate usages of pkg_resources in cascadia/version.py
(currently importing get_distribution and DistributionNotFound) to
importlib.metadata (or importlib_metadata backport for Python <3.8) — replace
get_distribution/DistributionNotFound usage with importlib.metadata.version and
corresponding exceptions, and ensure tests/packaging checks still pass after the
change.
Hi,
First of all, thanks for developing this great tool!
While running it for the first time, I encountered a minor issue. The code imports the
pkg_resourcesmodule, but in recent versions of setuptools, this can result in:ModuleNotFoundError: No module named 'pkg_resources'To address this, I’ve added the corresponding requirement so the module is properly installed and the tool runs without errors.
If you’d prefer not to modify the contributor list, feel free to reject the PR and add the requirement yourselves.
Hope this helps, and thanks again for your work!
Cheers,
Martin
Summary by CodeRabbit