Bug 2175215

Summary: RFE: Add python-tomli to RHEL 8
Product: Red Hat Enterprise Linux 8 Reporter: Miro Hrončok <mhroncok>
Component: python-tomliAssignee: Python Maintainers <python-maint>
Status: VERIFIED --- QA Contact: Lukáš Zachar <lzachar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.9CC: bstinson, jwboyer, maxwell, mhroncok, pviktori, python-maint, torsava
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-tomli-1.2.3-4.el8 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2178565, 2177271, 2178577    
Bug Blocks:    

Description Miro Hrončok 2023-03-03 15:06:03 UTC
I would very much like to add python3-tomli to RHEL 8.

The currently shipped TOML-parsing module in python3-pytoml is deprecated in Fedora [1] and unwanted in RHEL 9+ [2]. Projects that wish to support RHEL 8 as well as Fedora and RHEL 9+ need to maintain a complex spaghetti of ifs or try-excepts to choose their TOML-parsing module.

Some Red Hat upstream projects even justify reverting community contributions to migrate to a modern and upstream-maintained TOML parser by the absence of tomli in RHEL 8 [3]. We don't want that. We want all upstreams to be able to switch to tomllib on Python 3.11+ with a fallback to tomli. In order to make that easier for them, we should make tomli available in RHEL 8.

The package is already available in EPEL 8 [4] where I helped with the initial review and the EPEL maintainer is on board with us introducing this package to RHEL proper [5].


[1] https://fedoraproject.org/wiki/Changes/DeprecatePytoml
[2] https://tiny.distro.builders/config-unwanted--sst_cs_apps-unwanted-python3.html
[3] https://github.com/containers/podman-py/pull/240
[4] https://src.fedoraproject.org/rpms/python-tomli/tree/epel8
[5] https://github.com/containers/podman-py/pull/240#issuecomment-1440308239

Comment 1 Petr Viktorin 2023-03-06 08:42:21 UTC
For context, `tomli` was added to the Python 3.11+ standard library as `tomllib`.
I reviewed it for inclusion there. It's written with decades of maintenance in mind.

Comment 6 Miro Hrončok 2023-03-08 16:08:01 UTC
Diff against EPEL 8: https://src.fedoraproject.org/rpms/python-tomli/pull-request/22

Comment 7 Miro Hrončok 2023-03-09 15:39:39 UTC
(In reply to Miro Hrončok from comment #6)
> Diff against EPEL 8:
> https://src.fedoraproject.org/rpms/python-tomli/pull-request/22

I went ahead and added a smoke test TMT plan to the PR as I anticipated it will be required.

Comment 8 Miro Hrončok 2023-03-16 09:41:30 UTC
With mock-core-configs at least 38.3-1.fc37 (currently a pending update):

$ mock -r centos-stream-8-x86_64 init
...
$ mock -r centos-stream-8-x86_64 --enablerepo=local install python3-tomli
...
Installed:
  python3-tomli-1.2.3-4.el8.noarch

Comment 9 Miro Hrončok 2023-03-22 17:45:47 UTC
$ repoquery -q --repo=c8s-appstream python3-tomli
python3-tomli-0:1.2.3-4.el8.noarch

$ repoquery -q --repo=RHEL8.9-AppStream python3-tomli
python3-tomli-0:1.2.3-4.el8.noarch

Yay \o/