Skip to content

extension: build(deps): bump setuptools from 80.10.2 to 82.0.1#9407

Open
dependabot[bot] wants to merge 3 commits intomainfrom
dependabot/pip/setuptools-82.0.0
Open

extension: build(deps): bump setuptools from 80.10.2 to 82.0.1#9407
dependabot[bot] wants to merge 3 commits intomainfrom
dependabot/pip/setuptools-82.0.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot bot commented on behalf of github Feb 16, 2026

Summary

Bumps setuptools from 80.10.2 to 82.0.0 and fixes the resulting U-Boot build breakage.

setuptools 82.0.0 removed the deprecated pkg_resources module. U-Boot's binman (tools/binman/control.py) uses import pkg_resources for reading package resources in all versions prior to v2025.10. The upstream fix landed in U-Boot v2025.10 (commit 538719cb6a), but most U-Boot versions used by Armbian (v2022.07 through v2025.04) are affected.

Approach: runtime extension instead of patch files

A new extension uboot-binman-fix-pkg-resources patches tools/binman/control.py at build time via the pre_config_uboot_target hook. This approach was chosen over adding patch files to BOOTPATCHDIR because:

  • BOOTPATCHDIR varies across ~15 board families
  • control.py differs between U-Boot versions (would need 2+ patch variants)
  • A single idempotent extension covers ALL versions in one file
  • The pre_config_uboot_target hook is already included in artifact hash computation (H-part)

What the extension does

  1. Checks if tools/binman/control.py exists and contains import pkg_resources (idempotency)
  2. Patches the file via inline Python script:
    • Old U-Boot (<=v2023.x): no importlib.resources present — adds try/except import block (matching upstream pattern)
    • Intermediate U-Boot (v2024.01+): has both imports — aliases import importlib.resources as importlib_resources, updates existing usage
    • New U-Boot (>=v2025.10): no import pkg_resources — extension is a no-op
  3. Replacements:
    • pkg_resources.resource_string(__name__, X)importlib_resources.files(__package__).joinpath(X).read_bytes()
    • pkg_resources.resource_listdir(__name__, X)[r.name for r in importlib_resources.files(__package__).joinpath(X).iterdir() if r.is_file()]

Self-removal

Can be removed once all BOOTBRANCH versions in Armbian are >= v2025.10.

Test results

All three code paths verified with real builds on an ARM64 host:

Code path Board U-Boot Patch applied Build result
Old (only pkg_resources) odroidc4 (meson-sm1) v2022.07 Yes — try/except block added OK
Intermediate (both imports) tritium-h5 (sunxi/allwinner) v2024.01 Yes — alias added OK
No-op (already migrated) odroidm2 (rk3588) v2025.10 No (skipped) OK

Key files

  • extensions/uboot-binman-fix-pkg-resources.sh — the extension
  • lib/functions/configuration/main-config.shenable_extension call
  • lib/functions/compilation/uboot.sh:94-98pre_config_uboot_target hook invocation (cwd = U-Boot sources)
  • lib/functions/artifacts/artifact-uboot.sh:74-79 — hook hashing for artifact versioning

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated setuptools dependency to version 82.0.0
    • Ensured U-Boot support remains compatible with setuptools versions 82 and later

@dependabot dependabot bot added Dependencies Pull requests that update a dependency GitHub Actions GitHub Actions code Python Pull requests that update Python code labels Feb 16, 2026
@dependabot dependabot bot requested a review from igorpecovnik as a code owner February 16, 2026 18:46
@dependabot dependabot bot added GitHub Actions GitHub Actions code Dependencies Pull requests that update a dependency Python Pull requests that update Python code labels Feb 16, 2026
@github-actions github-actions bot added Needs review Seeking for review size/small PR with less then 50 lines 02 Milestone: First quarter release labels Feb 16, 2026
@iav iav requested a review from a team as a code owner February 17, 2026 00:01
@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines Framework Framework components and removed size/small PR with less then 50 lines labels Feb 17, 2026
@iav iav requested review from rpardini February 17, 2026 00:02
@iav
Copy link
Copy Markdown
Contributor

iav commented Feb 17, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 17, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 17, 2026

📝 Walkthrough

Walkthrough

The changes address pkg_resources deprecation in setuptools 82+ by introducing a new shell script that patches U-Boot's binman control.py to migrate from pkg_resources to importlib.resources. Configuration enablement is added to activate this patch, and setuptools is upgraded to version 82.0.0.

Changes

Cohort / File(s) Summary
U-Boot Binman Compatibility Fix
extensions/uboot-binman-fix-pkg-resources.sh
New shell script that patches binman control.py to migrate from deprecated pkg_resources to importlib.resources API, with compatibility handling for varying U-Boot versions.
Configuration & Dependency Updates
lib/functions/configuration/main-config.sh, requirements.txt
Enables the binman pkg_resources fix in the configuration initialization chain and bumps setuptools from 80.10.2 to 82.0.0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A hop and a skip, we've patched it just right,
From pkg_resources to importlib—what a delight!
Our setuptools upgraded, version eighty-two,
U-Boot's binman dancing in compatibility true.

🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (2 files):

⚔️ lib/functions/configuration/main-config.sh (content)
⚔️ requirements.txt (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
Title check ⚠️ Warning The title focuses on the setuptools version bump but omits the critical runtime extension that fixes U-Boot incompatibility caused by that upgrade. Revise the title to reflect both the setuptools upgrade and the new uboot-binman-fix-pkg-resources extension that enables the change, e.g., 'chore: upgrade setuptools to 82.0.0 and add U-Boot binman pkg_resources compatibility fix'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dependabot/pip/setuptools-82.0.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@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
Verify each finding against the current code and only fix it if needed.


In `@extensions/uboot-binman-fix-pkg-resources.sh`:
- Around line 33-34: The current re.sub call that removes the import line is too
strict and can miss variants like trailing whitespace or comments; update the
re.sub invocation that operates on the content variable so its pattern allows
optional leading whitespace, matches the import keyword and pkg_resources as a
whole word, permits any trailing characters (comments/whitespace) up to the line
ending (including optional CR), and still uses the MULTILINE flag — replace the
existing strict pattern in the re.sub call with a more resilient line-matching
pattern that covers these cases.

@iav iav force-pushed the dependabot/pip/setuptools-82.0.0 branch from 7b49673 to e9ce784 Compare February 17, 2026 00:15
@igorpecovnik igorpecovnik added 05 Milestone: Second quarter release and removed 02 Milestone: First quarter release labels Feb 17, 2026
@iav iav changed the title build(deps): bump setuptools from 80.10.2 to 82.0.0 extension: build(deps): bump setuptools from 80.10.2 to 82.0.0 Feb 18, 2026
@rpardini
Copy link
Copy Markdown
Member

Hmm -- what is the point of the major 80 -> 82 upgrade to begin with? Yes, we can work-around it, but... why?

@iav
Copy link
Copy Markdown
Contributor

iav commented Feb 18, 2026

Right now, urgent — there is no point.
In the long run, getting stuck on the "latest acceptable version" of something sooner or later becomes a source of security problems, found errors and/or compatibility with something else that we need to update, but the fixed version does not work.
And then it may turn out that now it is much more difficult to upgrade than it was before, because a lot of places have already accumulated a big difference, and no one has simply tested or created such upgrade paths anywhere.

@iav
Copy link
Copy Markdown
Contributor

iav commented Feb 22, 2026

Let me rephrase it briefly: this will prevent the formation of "technical debt" and will eliminate the need to start thinking about the fact that we have dependencies somewhere that require special treatment.

@dependabot @github
Copy link
Copy Markdown
Contributor Author

dependabot bot commented on behalf of github Mar 9, 2026

A newer version of setuptools exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@igorpecovnik igorpecovnik force-pushed the dependabot/pip/setuptools-82.0.0 branch from e9ce784 to 2b77d76 Compare March 25, 2026 21:51
@github-actions github-actions bot added the 02 Milestone: First quarter release label Mar 25, 2026
@igorpecovnik
Copy link
Copy Markdown
Member

@iav How reliable is this fix?

dependabot bot and others added 3 commits March 26, 2026 05:20
Bumps [setuptools](https://github.com/pypa/setuptools) from 80.10.2 to 82.0.1.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](pypa/setuptools@v80.10.2...v82.0.1)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 82.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
setuptools 82.0.1 removed the deprecated pkg_resources module.
U-Boot's binman (tools/binman/control.py) uses `import pkg_resources`
for reading package resources in versions prior to v2025.10.

Add extension that patches binman at build time via pre_config_uboot_target
hook, migrating from pkg_resources to importlib.resources:

- Old U-Boot (<=v2023.x): adds try/except importlib_resources import block
- Intermediate U-Boot (v2024.01+): aliases existing importlib.resources import
- New U-Boot (>=v2025.10): no-op (pkg_resources already removed upstream)

Replaces:
- pkg_resources.resource_string() -> importlib_resources.files().joinpath().read_bytes()
- pkg_resources.resource_listdir() -> [r.name for r in ...files().joinpath().iterdir()]

Using an extension rather than patch files because BOOTPATCHDIR varies
across ~15 families, and control.py differs between U-Boot versions.
A single idempotent extension covers all versions.

Can be removed once all BOOTBRANCH versions in Armbian are >= v2025.10.

Tested:
- tritium-h5 (sunxi, U-Boot v2024.01): patch applied, build OK
- odroidc4 (meson-sm1, U-Boot v2022.07): patch applied, build OK
- odroidm2 (rk3588, U-Boot v2025.10): no-op as expected, build OK

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enable the binman pkg_resources fix for all builds.
The extension is a no-op for U-Boot >= v2025.10.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iav iav force-pushed the dependabot/pip/setuptools-82.0.0 branch from 2b77d76 to d9095d7 Compare March 26, 2026 03:21
@iav
Copy link
Copy Markdown
Contributor

iav commented Mar 26, 2026

It does nothing if tools/binman/control.py doesn't exist or doesn't contain import pkg_resources.
The replacement code (importlib.resources.files()) is exactly what upstream U-Boot adopted in commit 538719cb6a (v2025.10) u-boot/u-boot@538719cb6a

Tested on all 3 code paths with real builds:

  • Old U-Boot (v2022.07, odroidc4)
  • Intermediate U-Boot (v2024.01, tritium-h5)
  • New U-Boot (v2025.10, odroidm2) — no-op

It only touches tools/binman/control.py and only replaces two pkg_resources API calls (resource_string and resource_listdir) which are the only ones binman uses.

It will be possible to simply throw away after all BOOTBRANCH versions in Armbian reach v2025.10+ 😆

Tested on all 3 code paths with real builds:

  • Old U-Boot (v2022.07, odroidc4)
  • Intermediate U-Boot (v2024.01, tritium-h5)
  • New U-Boot (v2025.10, odroidm2) — no-op

I hope it will be reliable enough.

@iav iav changed the title extension: build(deps): bump setuptools from 80.10.2 to 82.0.0 extension: build(deps): bump setuptools from 80.10.2 to 82.0.1 Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

02 Milestone: First quarter release 05 Milestone: Second quarter release Dependencies Pull requests that update a dependency Framework Framework components GitHub Actions GitHub Actions code Needs review Seeking for review Python Pull requests that update Python code size/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

3 participants