Bug 16019

Summary: Review python standard library splitting
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: devtools / tool chainAssignee: Trevor Gamblin <tgamblin>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, tim.orling
Version: 5.2   
Target Milestone: 6.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)
Bug Depends on:    
Bug Blocks: 15977    

Description Ross Burton 2025-10-17 16:41:49 UTC
I think the current python standard library splitting is too split up and results in either overcomplicated dependencies, or broken python.

For example, currently importlib.metadata is part of python3-core but it should depend on python3-email and python3-zipfile (see https://bugzilla.yoctoproject.org/show_bug.cgi?id=15977). Thus, a package that is in core isn't usable without further dependencies.

I believe we should revisit the splitting and see if we can bundle more into the 'core' package without increasing the size too much, meaning more packages will be able to depend on just core unless they use rarer parts of the standard library.

In prior art, Debian has python3-minimal which is a subset of the standard library and python3-stdlib which depends on -minimal and provides the rest of the standard library.

https://packages.debian.org/sid/libpython3.13-minimal (~5MB)
https://packages.debian.org/sid/libpython3.13-stdlib (~10MB)

Their tooling to produce this split is https://salsa.debian.org/cpython-team/python3/-/blob/python3.13/debian/pymindeps.py