osbuild: pytoml is deprecated, replace with toml

Pytoml is no longer being maintained: https://github.com/avakar/pytoml
The author suggest switching to toml.

We already use the
```
try:
    import toml
except ModuleNotFoundError:
    import pytoml as toml
```
pattern in stages/org.osbuild.containers.storage.conf so use it in the tests too to prefer "toml" instead of pytoml.
This commit is contained in:
Michael Vogt 2023-12-12 17:54:31 +01:00 committed by Brian C. Lane
parent caddf0adfb
commit 4e3fc6a625
2 changed files with 8 additions and 4 deletions

View file

@ -3,7 +3,11 @@
import os.path
import pytest
import pytoml
try:
import toml
except ModuleNotFoundError:
import pytoml as toml
import osbuild.meta
from osbuild.testutil import assert_dict_has
@ -45,8 +49,8 @@ def test_containers_storage_conf_integration(tmp_path, test_filename, test_stora
assert os.path.exists(confpath)
conf = None
with open(confpath, 'rb') as f:
conf = pytoml.load(f)
with open(confpath, 'r', encoding="utf-8") as f:
conf = toml.load(f)
assert conf is not None

View file

@ -18,7 +18,7 @@ deps =
mako
iniparse
pyyaml
pytoml
toml
pykickstart
# required by pykickstart but not pulled in automatically :/
requests