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:
parent
caddf0adfb
commit
4e3fc6a625
2 changed files with 8 additions and 4 deletions
|
|
@ -3,7 +3,11 @@
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytoml
|
|
||||||
|
try:
|
||||||
|
import toml
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
import pytoml as toml
|
||||||
|
|
||||||
import osbuild.meta
|
import osbuild.meta
|
||||||
from osbuild.testutil import assert_dict_has
|
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)
|
assert os.path.exists(confpath)
|
||||||
|
|
||||||
conf = None
|
conf = None
|
||||||
with open(confpath, 'rb') as f:
|
with open(confpath, 'r', encoding="utf-8") as f:
|
||||||
conf = pytoml.load(f)
|
conf = toml.load(f)
|
||||||
|
|
||||||
assert conf is not None
|
assert conf is not None
|
||||||
|
|
||||||
|
|
|
||||||
2
tox.ini
2
tox.ini
|
|
@ -18,7 +18,7 @@ deps =
|
||||||
mako
|
mako
|
||||||
iniparse
|
iniparse
|
||||||
pyyaml
|
pyyaml
|
||||||
pytoml
|
toml
|
||||||
pykickstart
|
pykickstart
|
||||||
# required by pykickstart but not pulled in automatically :/
|
# required by pykickstart but not pulled in automatically :/
|
||||||
requests
|
requests
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue