| Summary: | setuptools3.bbclass: Add check for pyproject.toml and [build-system] to advise users | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Tim Orling <tim.orling> |
| Component: | core | Assignee: | Ross Burton <ross.burton> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | meta.mr.watcher, meta.watcher, peter.kjellerstedt, randy.macleod, ross.burton |
| Version: | 4.0 | ||
| Target Milestone: | 5.1 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Yes (doc changes required) | |
|
Description
Tim Orling
2022-02-22 23:00:08 UTC
Patch submitted: https://lore.kernel.org/openembedded-core/20220224041200.2645054-1-tim.orling@konsulko.com/T/#t You can simplify guess_pip_install_package_name() to: +def guess_pip_install_package_name(d): + '''https://www.python.org/dev/peps/pep-0491/#escaping-and-unicode''' + return (d.getVar('PYPI_PACKAGE') or d.getVar('PN')).replace('-', '_')) Correction: +def guess_pip_install_package_name(d): + '''https://www.python.org/dev/peps/pep-0491/#escaping-and-unicode''' + return (d.getVar('PYPI_PACKAGE') or d.getVar('PN')).replace('-', '_') Merged. https://git.openembedded.org/openembedded-core/commit/?id=9fc8e55892374f1e63b4c995fe1a5539c42d24e0 If there are any further issues, please send an email to oe-core mailing list or file a new bug. Oops. Wrong patch. version 3 of the setuptools3.bbclass patch: https://patchwork.yoctoproject.org/project/oe-core/patch/20220225234317.668778-1-tim.orling@konsulko.com/ You can do away with one of the warn*string variables if you use: warn_string = "The source has a pyproject.toml which declares '%s' as a build backend, please consider 'inherit %s' %sinstead of inheriting setuptools3." and then either pass '' or 'from meta-python ' as third argument. The main issue is that we need a TOML parser, e.g. python3-tomli on the host. The reason this worked was because I already had the deb installed. While using something like python3-tomli certainly is more correct, for the purpose of setuptools3.bbclass, reading the file and looking for the first line that matches r'build-backend\s*=\s*"(.*)"' is probably good enough. You can of course also make sure it is inside the "[build-system]" section, but it is most likely not really needed. New commit from RP fixes Toaster: https://patchwork.yoctoproject.org/project/bitbake/patch/20220310135344.612089-1-richard.purdie@linuxfoundation.org/ For unknown _reasons_ this is still failing on my local machine (Debian 11 and Python 3.9.2). However, I can confirm that a web UI build of quilt-native succeeds using master-next and the following toaster-container distro combinations: ubuntu-18.04 ubutnu-20.04 debian-10 debian-11 That is significant evidence that this issue has been fixed. and that was the wrong bug again Needs to be revisited when Python 3.11 (with built-in toml support) lands in "master". "master" has Python 3.11 now, so time to revisit this. Bumping to 5.1, since we are too late in the 5.0M3 cycle to be introducing new warnings. Changing to IN PROGRESS IMPLEMENTATION, since the regex check (not needing tomli nor tomllib on the host python) has not yet been implemented. WIP branch with a check for tomllib and then falling back to tomli (but not then falling back to regex yet): https://git.yoctoproject.org/poky-contrib/log/?h=timo/setuptools3-pyproject.toml-check Patch on the list. https://lore.kernel.org/openembedded-core/20240725153029.828624-1-ross.burton@arm.com/T/#t Merged. Hurrah! Thank you Ross for carrying this across the finish line. https://git.openembedded.org/openembedded-core/commit/?id=a9d800f6cdfcedbe3de8366d935ee5f0c8557c06 https://git.openembedded.org/openembedded-core/commit/?id=27597d986ad7b3a6c2d36150a163951be7c640f1 An examples of how to turn it off: https://git.openembedded.org/openembedded-core/commit/?id=a09ad3838a00d2b4781850759ca857822ba330e1 https://git.openembedded.org/openembedded-core/commit/?id=824009560776933922a92a00c2199c28c9c8379c |