fix(docs): update channel plugin build backend to hatchling#3192
fix(docs): update channel plugin build backend to hatchling#3192Re-bin merged 2 commits intoHKUDS:mainfrom
Conversation
The previous setuptools.backends._legacy:_Backend has been removed in Python 3.14 and newer setuptools, causing 'Cannot import setuptools.backends.legacy' error. Using hatchling (same as main project) ensures compatibility across Python versions. Closes HKUDS#3188
|
The fix works, thanks. But I might be wrong, nanobot is listed in the dependencies, and it overwrites the binaries with its own. I have to reinstall nanobot-ai. Perhaps I should remove it or rewrite it with nanobot-ai. [project] |
The PyPI package `nanobot` is a different project ("Minimalist robot
navigation framework"), not this one. This project publishes as
`nanobot-ai` (see pyproject.toml). Following the guide as-written would
pull down the wrong package — flagged by vansatchen in HKUDS#3188.
Same toml block as the build-backend fix, one-word change.
Made-with: Cursor
Re-bin
left a comment
There was a problem hiding this comment.
Approve (with a follow-up commit pushed directly)
Fix is correct — setuptools.backends._legacy was removed in recent setuptools, so the guide was producing a build that can't even start on Python 3.14. Switching to hatchling matches what the main nanobot-ai repo uses, and adding [tool.hatch.build.targets.wheel] packages = [...] is exactly the extra stanza hatchling needs.
Follow-up I pushed to this PR
Same toml block, line 138, had a second bug that's the same root cause as #3188 from a user's perspective:
-dependencies = ["nanobot", "aiohttp"]
+dependencies = ["nanobot-ai", "aiohttp"]nanobot on PyPI is an unrelated project ("Minimalist robot navigation framework using cascading decision nodes"). This repo publishes as nanobot-ai (pyproject.toml:2). Following the guide as-written would pull down the wrong package and — as @vansatchen reported in the issue thread — overwrite the nanobot console script from the legitimate install. Fixing build-backend without fixing this would close #3188 at the build step but leave users with a silently broken environment. One-word change, same file, pushed as 79974a08 on this branch.
Nit (not blocking)
CI matrix doesn't cover Python 3.14 yet (#3194 will fix that), so the original bug this PR targets wasn't actually reproducible in CI. Worth noting for future docs PRs that touch packaging — once 3.14 lands in the matrix we'll catch these earlier.
LGTM once CI goes green on the follow-up.
Problem
The
pyproject.tomlexample indocs/CHANNEL_PLUGIN_GUIDE.mduses a deprecated setuptools backend:This causes the following error on Python 3.14 with newer setuptools:
Solution
Replace the deprecated backend with
hatchling(same as the main nanobot project):Changes
docs/CHANNEL_PLUGIN_GUIDE.mdpyproject.toml exampleFixes #3188