Skip to content

Update pyproject TOML to specific setuptools version#17

Merged
justin-a-sanders merged 1 commit intoNoble-Lab:mainfrom
martingarridorc:main
Mar 3, 2026
Merged

Update pyproject TOML to specific setuptools version#17
justin-a-sanders merged 1 commit intoNoble-Lab:mainfrom
martingarridorc:main

Conversation

@martingarridorc
Copy link
Copy Markdown
Contributor

@martingarridorc martingarridorc commented Feb 11, 2026

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_resources module, 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

  • Chores
    • Updated project dependencies to ensure compatibility and stability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 11, 2026

📝 Walkthrough

Walkthrough

A 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

Cohort / File(s) Summary
Dependency Constraint Update
pyproject.toml
Added setuptools version constraint (<70.0.0) to [project.dependencies], ensuring compatibility with older setuptools versions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A builder's constraint, so fine and neat,
setuptools at seventy we won't meet,
Compatibility locked, stability strong,
Version sixty-nine carries us along!
Building blocks stacked just right, oh yes—
This little fix brings perfect finesse! 🔧✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a specific setuptools version constraint to pyproject.toml to resolve a pkg_resources import issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pyproject.toml
]
requires-python = ">=3.8"
dependencies = [
"setuptools<70.0.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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 -50

Repository: 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_resources removal point; the “70” you’re seeing is usually from people pinning defensively (e.g., setuptools<=70), not from an announced pkg_resources removal 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 to Setuptools<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_resources is treated as removed / no longer available in the 81 line per downstream breakage reports and migration guidance (hence the common recommendation to pin setuptools<81 until 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_resources usage is explicitly deprecated in favor of importlib.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.

Suggested change
"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.

@justin-a-sanders justin-a-sanders merged commit 1cc2a4a into Noble-Lab:main Mar 3, 2026
1 check passed
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.

2 participants