Skip to content

fix(docs): update channel plugin build backend to hatchling#3192

Merged
Re-bin merged 2 commits intoHKUDS:mainfrom
JiajunBernoulli:fix-issue-3188-channel-plugin-build
Apr 17, 2026
Merged

fix(docs): update channel plugin build backend to hatchling#3192
Re-bin merged 2 commits intoHKUDS:mainfrom
JiajunBernoulli:fix-issue-3188-channel-plugin-build

Conversation

@JiajunBernoulli
Copy link
Copy Markdown
Contributor

Problem

The pyproject.toml example in docs/CHANNEL_PLUGIN_GUIDE.md uses a deprecated setuptools backend:

build-backend = "setuptools.backends._legacy:_Backend"

This causes the following error on Python 3.14 with newer setuptools:

pip._vendor.pyproject_hooks._impl.BackendUnavailable: Cannot import 'setuptools.backends.legacy'

Solution

Replace the deprecated backend with hatchling (same as the main nanobot project):

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["nanobot_channel_webhook"]

Changes

  • Updated docs/CHANNEL_PLUGIN_GUIDE.md pyproject.toml example
  • Using hatchling ensures compatibility across all Python versions

Fixes #3188

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
@vansatchen
Copy link
Copy Markdown

vansatchen commented Apr 17, 2026

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]
name = "nanobot-channel-webhook"
version = "0.1.0"
dependencies = ["nanobot", "aiohttp"]

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
Copy link
Copy Markdown
Collaborator

@Re-bin Re-bin left a comment

Choose a reason for hiding this comment

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

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.

@Re-bin Re-bin merged commit ebbed1c into HKUDS:main Apr 17, 2026
8 checks 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.

Cannot install nanobot-channel-webhook

3 participants