New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use modern tomllib/tomli modules for reading TOML files #214
Conversation
I don't think that pylint failure is my fault. |
@mgorny would you mind re pushing? also try a rebase just in case. If it fails again, I suggest following the error message and moving the podman import up |
Re-pushed. There was nothing to rebase on, i.e. it was already at the latest. |
I actually see it with |
Moving the import fixes one error but leaves the two others:
|
I can't find any tomli packages for rhel 8 and 9 so I suspect this would break those distros. Can we please keep toml as a fallback if tomli isn't available? |
I suppose I can make the code compatible with it but I don't see how to make Python-level |
Done that. |
let me try building this on copr for centos before we merge. |
So, if epel repos aren't enabled, centos8 will have trouble finding python3-toml and centos9 will have trouble finding python3-tomli. This would mean rhel8 and rhel9 builds would also have trouble since we can't enable epel repos there. See: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/build/4954089/ for details. @cdoern @umohnani8 how do you wanna go forward with this? Are we ok with having a separate rhel branch or should we make sure main branch itself builds for all rhel8 and rhel9 ? |
@cdoern @umohnani8 PTAL. |
What would it take to get tomllib/tomli into RHEL? Is this something we can just make available for podman-py? How do we handle this with other python tools? |
I guess the typical process to get a package included in RHEL.
You mean like bundling tomllib in the podman-py RPM for rhel? No idea how ugly that might get.
I guess other deps have been available on RHEL so far. Don't quite remember bundling a python dependency in another python-based RPM |
Bottom line, I don't believe we should block Upstream based on Downstream packaging. We can work to get this packaged in RHEL in the future, but by the same token, we should be careful not to bring in huge libraries, which add little value. |
Since we're keeping podman-py versions in sync with podman, RHEL packaging would have to be dealt with rather sooner. If we don't wanna block upstream on RHEL packaging, then having a separate rhel branch seems to be the way to go. |
How much effort would it be to maintain a separate rhel branch on github? We would have to make sure we push any new commits to both the main and rhel branch right? |
I think is it a mistake to branch them. We are doubling our work rather then just getting the new libraries into RHEL. |
I'm fine with that. I guess we can continue RHEL discussion elsewhere (cc: @TomSweeneyRedHat @jnovy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds fine on Fedora and CentOS Stream. So LGTM from me.
@cdoern @umohnani8 PTAL for final review and merge.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lsm5, mgorny The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@mgorny needs a rebase. |
Rebased. |
@mgorny there is still a conflict, can you please rebase again. |
Replace the unmaintained `toml`/`pytoml` dependencies with the modern alternatives: the built-in `tomllib` module in Python 3.11, and `tomli` in older Python versions. Preserving backwards compatibility does not seem necessary, as podman-py no longer supports Python versions older than 3.6. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Rebased again. |
LGTM |
Thanks! |
Replace the unmaintained
toml
/pytoml
dependencies with the modern alternatives: the built-intomllib
module in Python 3.11, andtomli
in older Python versions. Preserving backwards compatibility does not seem necessary, as podman-py no longer supports Python versions older than 3.6.Signed-off-by: Michał Górny mgorny@gentoo.org