Overview
Request 1068072 superseded
Simplify spec file by dropping Python multi-spec and update-alternatives facilities, among other things.
- Created by luc14n0
- In state superseded
- Supersedes 1067844
- Superseded by 1078338
Now it should be Ok after adjusting to python3-foo run-time requirements and manually providing python3-gi-docgen.
There is no module toml_module tomllib
its called tomli
And I wonder if we should switch to using meson to build this thing See https://build.opensuse.org/package/rdiff/home:iznogood:branches:home:luc14n0:branches:GNOME:Next/python-gi-docgen?opackage=python-gi-docgen&oproject=home%3Aluc14n0%3Abranches%3AGNOME%3ANext&rev=7
We will lose manpages, but we can even req tomli even if toml ends up being used for 3.10
or is the meson build option only there for usage as sub-project in other projects?
That's true, I remember figuring that out before but dunno why I used tomlib.
Ah, I think I remember now. I was in the hope the tomllib module would be added/packaged at some point, I suppose.
OK. I made a mistake, tomllib is provided by Python's 3.11 standard library. I remember figuring this out before but somehow I managed to mess it up :~p
Let me fix it.
Now, about using Meson. I think I planned to switch it at some point.
And the manpage won't be missed, honestly, due to the nature of gi-docgen being meant for generating API reference docs for GTK and its immediate dependencies.
Request History
luc14n0 created request
Simplify spec file by dropping Python multi-spec and update-alternatives facilities, among other things.
gnome-review-bot accepted review
Check script succeeded
gnome-review-bot approved review
Check script succeeded
superseded by 1078338
Are you sure about this:
- Use tomli module buildtime/runtime requirement for Python older than 3.11. Otherwise, the tomllib module from the standard library is going to be used instead.
I ask cause when looking at upstream code in meson.build, I'm starting to think that the changes are just wrong.Please see
https://gitlab.gnome.org/GNOME/gi-docgen/-/blob/main/meson.build
Yes, I am. All that meson.build and pyproject.toml are saying is that if the Python version is less than 3.11 it will fallback to tomli/toml (external modules):
That part of the code is nested inside the IF statement:
if py.language_version().version_compare('<3.11')
. So, ifPython < 3.11
use the tomli module. And iftomli >= 1.0
(if tomli_version.version_compare('>=1.0')
) use the deprecated toml module.You can see that
if py.language_version().version_compare('<3.11')
has no else statements and that's because in Python 3.11 the tomllib module, that's provided by the standard library, is used instead. Thus there's no need to use additional requirements other than Python 3.11.OBS won't see this - python_version is only known once the buildroot is setup
Argh, that's true. %python_version is setup in macros.python_all. Is there an easy way to go about this?
Maybe:
Or just:
obs scheduler does not execute
%()
BuildRequires: ( python3-tomli if python311-base)
?Oh, boolean deps! Yes, they should work. But we want this instead, to install
python3-tomli
whenpython311-base
is not present:BuldRequires: (python3-tomli unless python311-base)
.It would be handy if boolean deps could support some from of globbing or versioning, though. Otherwise we're going to have:
BuldRequires: (python3-tomli unless python311-base or python312-base [or ...])
.Ah, unless we'd have a
python3-base
meta-package, versioning won't work (even though we can use version with boolean deps).