Skip to content

Commit

Permalink
Merge branch 'main' into version_card
Browse files Browse the repository at this point in the history
  • Loading branch information
dfguerrerom committed Oct 5, 2023
2 parents 1aefe86 + b91b2a2 commit 01f6ffe
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
requires-python = ">=3.8"
dependencies = [
# building widgets
"tomli",
"ipykernel",
"ipyvuetify",
"markdown",
Expand Down Expand Up @@ -70,7 +71,7 @@ dev = [
"pre-commit>=2.18.0",
"commitizen",
"nox",
"toml",
"tomli",
"jupyter",
"voila",
"mypy",
Expand Down
6 changes: 3 additions & 3 deletions sepal_ui/bin/module_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from pathlib import Path
from typing import Union

import tomli
from colorama import Fore, Style, init

import sepal_ui
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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})")

Expand Down
4 changes: 2 additions & 2 deletions sepal_ui/frontend/js/fontawesome.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
*/

function remove_fa5() {
links = document.querySelectorAll(
let links = document.querySelectorAll(
"link[href^='https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@^5']"
);

links.forEach((link) => link.remove());
}

if (document.readyState != "loading") remove_fa5();
else document.addEventListener("DOMContentLoader", remove_fa5());
else document.addEventListener("DOMContentLoaded", remove_fa5);
4 changes: 2 additions & 2 deletions sepal_ui/templates/map_app/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import nox
import toml
import tomli


@nox.session(reuse_venv=True)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion sepal_ui/templates/map_app/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions sepal_ui/templates/panel_app/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import nox
import toml
import tomli


@nox.session(reuse_venv=True)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion sepal_ui/templates/panel_app/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 01f6ffe

Please sign in to comment.