extension: build(deps): bump setuptools from 80.10.2 to 82.0.0#9407
extension: build(deps): bump setuptools from 80.10.2 to 82.0.0#9407dependabot[bot] wants to merge 3 commits intomainfrom
Conversation
Bumps [setuptools](https://github.com/pypa/setuptools) from 80.10.2 to 82.0.0. - [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.0) --- updated-dependencies: - dependency-name: setuptools dependency-version: 82.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
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. Comment |
There was a problem hiding this comment.
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.
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 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>
7b49673 to
e9ce784
Compare
|
Hmm -- what is the point of the major 80 -> 82 upgrade to begin with? Yes, we can work-around it, but... why? |
|
Right now, urgent — there is no point. |
|
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. |
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_resourcesmodule. U-Boot's binman (tools/binman/control.py) usesimport pkg_resourcesfor reading package resources in all versions prior to v2025.10. The upstream fix landed in U-Boot v2025.10 (commit538719cb6a), 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-resourcespatchestools/binman/control.pyat build time via thepre_config_uboot_targethook. This approach was chosen over adding patch files toBOOTPATCHDIRbecause:BOOTPATCHDIRvaries across ~15 board familiescontrol.pydiffers between U-Boot versions (would need 2+ patch variants)pre_config_uboot_targethook is already included in artifact hash computation (H-part)What the extension does
tools/binman/control.pyexists and containsimport pkg_resources(idempotency)importlib.resourcespresent — addstry/exceptimport block (matching upstream pattern)import importlib.resources as importlib_resources, updates existing usageimport pkg_resources— extension is a no-oppkg_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
BOOTBRANCHversions in Armbian are >= v2025.10.Test results
All three code paths verified with real builds on an ARM64 host:
pkg_resources)try/exceptblock addedKey files
extensions/uboot-binman-fix-pkg-resources.sh— the extensionlib/functions/configuration/main-config.sh—enable_extensioncalllib/functions/compilation/uboot.sh:94-98—pre_config_uboot_targethook invocation (cwd = U-Boot sources)lib/functions/artifacts/artifact-uboot.sh:74-79— hook hashing for artifact versioningSummary by CodeRabbit
Release Notes