Skip to content

Commit

Permalink
Merge pull request #169 from YunoHost/use_tomllib
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamandar authored Nov 16, 2024
2 parents 61fceb0 + 34cb83f commit 675a1fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import subprocess
import sys

import toml
import tomllib
from lib.lib_package_linter import (
Error,
Info,
Expand Down Expand Up @@ -564,7 +564,7 @@ def config_panel(app):
yield from validate_schema(
"config_panel",
json.loads(config_panel_v1_schema()),
toml.load(app.path + "/config_panel.toml"),
tomllib.load(open(app.path + "/config_panel.toml", "rb")),
)

@test()
Expand Down
6 changes: 3 additions & 3 deletions tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import time
from datetime import datetime

import toml
import tomllib
from lib.lib_package_linter import (
Critical,
Error,
Expand Down Expand Up @@ -42,7 +42,7 @@ def __init__(self, app_id):
self._fetch_app_repo()

try:
self.app_list = toml.loads(open("./.apps/apps.toml").read())
self.app_list = tomllib.load(open("./.apps/apps.toml", "rb"))
except Exception:
_print("Failed to read apps.toml :/")
sys.exit(-1)
Expand Down Expand Up @@ -205,7 +205,7 @@ def get_history(N):

elif os.system(f"git -C ./.apps cat-file -e {commit}:apps.toml") == 0:
raw_catalog_at_this_date = git(["show", f"{commit}:apps.toml"])
loader = toml
loader = tomllib
else:
raise Exception("No apps.json/toml at this point in history?")

Expand Down
4 changes: 2 additions & 2 deletions tests/test_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import re
import subprocess

import toml
import tomllib
from lib.lib_package_linter import (
Error,
Info,
Expand Down Expand Up @@ -49,7 +49,7 @@ def tests_toml(self):
yield from validate_schema(
"tests.toml",
json.loads(tests_v1_schema()),
toml.load(app.path + "/tests.toml"),
tomllib.load(open(app.path + "/tests.toml", "rb")),
)

@test()
Expand Down
4 changes: 2 additions & 2 deletions tests/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import re
import sys

import toml
import tomllib
from lib.lib_package_linter import (
Critical,
Error,
Expand Down Expand Up @@ -89,7 +89,7 @@ def check_for_duplicate_keys(ordered_pairs):

self.raw_manifest = open(manifest_path, encoding="utf-8").read()
try:
self.manifest = toml.loads(self.raw_manifest)
self.manifest = tomllib.loads(self.raw_manifest)
except Exception as e:
print(
c.FAIL
Expand Down

0 comments on commit 675a1fb

Please sign in to comment.