Bug 15573 - Python recipes: Required dependency versions not being properly detected?
Summary: Python recipes: Required dependency versions not being properly detected?
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 5.1
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 6.1 M2
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-08-08 15:19 UTC by Tim Orling
Modified: 2026-05-28 13:17 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Orling 2024-08-08 15:19:15 UTC
We've had some trouble with python3-pydantic being upgraded and the required version of python3-pydantic-core not being present. This caused 'scarthgap' to ship with a broken version of python3-pydantic. It's still a problem in master because folks are sending upgrades to python3-pydantic when the underlying python3-pydantic-core version requirement is unmet.
Comment 1 Tim Orling 2024-08-08 15:32:13 UTC
In IRC, Ross commented that "python3 -m build" should have caught such unmet version dependency.
Comment 2 Ross Burton 2024-08-09 12:54:20 UTC
So the problem is probably the difference between build depends and runtime depends.

-mbuild _should_ be validating build depends in do_compile, but that's a much smaller subset of requirements than you'd expect.  In do_install -minstaller doesn't check for dependencies because it's installing into a destdir.

However at no point do the *runtime* depends turn into package dependencies.

I've been thinking about this in the past and think this could be doable.

At do_package time, inject RPROVIDES of the python package name.  A not great implementation would simply be RPROVIDES:append = "python-module(${PYPI_PACKAGE})" but a better solution would be to programatically sweep what was installed.

Also, scan pyproject.toml and translate the [dependencies] into versioned RDEPENDS with the same python-module(foo) syntax.
Comment 3 Tim Orling 2024-08-15 14:39:34 UTC
Early PoC implementation in: https://git.yoctoproject.org/poky-contrib/log/?h=ross/pypi-deps

Which also starts off with a possible fix for the way the sdist tarballs are named on pypi. Since "PEP 625 – Filename of a Source Distribution" https://peps.python.org/pep-0625/ filenames are now normalized. This leaves older sdist tarballs on pypi in the old randomized state however.

This has some impact in meta-openembedded as well (about 146 recipes need to be fixed for do_fetch due to the change).
Comment 4 Randy MacLeod 2025-01-30 16:06:35 UTC
Bulk move to 5.2-M3.
Comment 5 Randy MacLeod 2025-01-30 16:17:03 UTC
Bulk move to 5.2-M3 and this time I'll actually specify M3!
Comment 6 Tim Orling 2026-03-05 16:22:14 UTC
Related update to the pydeps WIP:
https://git.openembedded.org/openembedded-core-contrib/commit/?h=ross/split/pydeps
Comment 7 Randy MacLeod 2026-05-28 13:17:56 UTC
Bulk move of unassigned 6.0-M* bugs to 6.1-M2.