diff --git a/pyproject.toml b/pyproject.toml index cdb00f2f..ce3f2e4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ classifiers = [ requires-python = ">=3.8" dependencies = [ # building widgets + "tomli", "ipykernel", "ipyvuetify", "markdown", @@ -70,7 +71,7 @@ dev = [ "pre-commit>=2.18.0", "commitizen", "nox", - "toml", + "tomli", "jupyter", "voila", "mypy", diff --git a/sepal_ui/bin/module_deploy.py b/sepal_ui/bin/module_deploy.py index 421e1be0..56e54412 100755 --- a/sepal_ui/bin/module_deploy.py +++ b/sepal_ui/bin/module_deploy.py @@ -18,6 +18,7 @@ from pathlib import Path from typing import Union +import tomli from colorama import Fore, Style, init import sepal_ui @@ -66,7 +67,7 @@ def clean_dulpicate(file: Union[str, Path]) -> None: file: the requirements file """ # already available libs - libs = ["jupyter", "voila", "toml", "sepal_ui"] + libs = ["jupyter", "voila", "tomli", "sepal_ui"] file = Path(file) text = file.read_text().split("\n") @@ -195,9 +196,8 @@ def main() -> None: print("Export the env configuration of your module...") # check that the local folder is a module folder - toml = Path.cwd() / "pyproject.toml" try: - toml.load("pyproject.toml")["sepal-ui"]["init-notebook"] + tomli.load("pyproject.toml")["sepal-ui"]["init-notebook"] except FileNotFoundError as e: raise Exception(f"{Fore.RED}This module folder has no pyproject.toml ({e})") diff --git a/sepal_ui/frontend/js/fontawesome.js b/sepal_ui/frontend/js/fontawesome.js index f35ede1d..273f7b55 100644 --- a/sepal_ui/frontend/js/fontawesome.js +++ b/sepal_ui/frontend/js/fontawesome.js @@ -4,7 +4,7 @@ */ function remove_fa5() { - links = document.querySelectorAll( + let links = document.querySelectorAll( "link[href^='https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@^5']" ); @@ -12,4 +12,4 @@ function remove_fa5() { } if (document.readyState != "loading") remove_fa5(); -else document.addEventListener("DOMContentLoader", remove_fa5()); +else document.addEventListener("DOMContentLoaded", remove_fa5); diff --git a/sepal_ui/templates/map_app/noxfile.py b/sepal_ui/templates/map_app/noxfile.py index e0add022..30c07dd9 100644 --- a/sepal_ui/templates/map_app/noxfile.py +++ b/sepal_ui/templates/map_app/noxfile.py @@ -4,7 +4,7 @@ """ import nox -import toml +import tomli @nox.session(reuse_venv=True) @@ -17,7 +17,7 @@ def lint(session): @nox.session(reuse_venv=True) def app(session): """Run the application.""" - init_notebook = toml.load("pyproject.toml")["sepal-ui"]["init-notebook"] + init_notebook = tomli.load("pyproject.toml")["sepal-ui"]["init-notebook"] session.install("-r", "requirements.txt") session.run("jupyter", "trust", init_notebook) session.run("voila", "--debug", init_notebook) diff --git a/sepal_ui/templates/map_app/requirements.txt b/sepal_ui/templates/map_app/requirements.txt index 06247c3e..133c0481 100644 --- a/sepal_ui/templates/map_app/requirements.txt +++ b/sepal_ui/templates/map_app/requirements.txt @@ -1,7 +1,7 @@ # these libs are requested to build application env jupyter voila -toml +tomli # the base lib to run any sepal_ui based app # don't forget to fix it to a specific version when you're app is ready diff --git a/sepal_ui/templates/panel_app/noxfile.py b/sepal_ui/templates/panel_app/noxfile.py index bacc0c54..e48f1b89 100644 --- a/sepal_ui/templates/panel_app/noxfile.py +++ b/sepal_ui/templates/panel_app/noxfile.py @@ -4,7 +4,7 @@ """ import nox -import toml +import tomli @nox.session(reuse_venv=True) @@ -17,7 +17,7 @@ def lint(session): @nox.session(reuse_venv=True) def app(session): """Run the application.""" - init_notebook = toml.load("pyproject.toml")["sepal-ui"]["init-notebook"] + init_notebook = tomli.load("pyproject.toml")["sepal-ui"]["init-notebook"] session.install("-r", "requirements.txt") session.run("jupyter", "trust", init_notebook) session.run("voila", "--debug", init_notebook) diff --git a/sepal_ui/templates/panel_app/requirements.txt b/sepal_ui/templates/panel_app/requirements.txt index 06247c3e..133c0481 100644 --- a/sepal_ui/templates/panel_app/requirements.txt +++ b/sepal_ui/templates/panel_app/requirements.txt @@ -1,7 +1,7 @@ # these libs are requested to build application env jupyter voila -toml +tomli # the base lib to run any sepal_ui based app # don't forget to fix it to a specific version when you're app is ready