Skip to content

Commit

Permalink
sonar on _config
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Jun 5, 2024
1 parent 6cc7039 commit 0a27dc9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ def main(
# legacy
app.command("bump-version")(_metadata.bump_version)
app.command("get-version")(_metadata.get_version)
app.command("run-creator")(_run_creator.main)
app.command("run-creator")(_run_creator.run_creator)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import typer
import yaml

from ..osparc_config import OSPARC_CONFIG_DIRNAME
from ..osparc_config import OSPARC_CONFIG_DIRNAME, OSPARC_CONFIG_METADATA_NAME


def get_input_config(metadata_file: Path) -> dict:
Expand All @@ -17,7 +17,7 @@ def get_input_config(metadata_file: Path) -> dict:
return inputs


def main(
def run_creator(
run_script_file_path: Annotated[
Path,
typer.Option(
Expand All @@ -31,7 +31,7 @@ def main(
"--metadata",
help="The metadata yaml of the node",
),
] = Path(f"{OSPARC_CONFIG_DIRNAME}/metadata.yml"),
] = Path(f"{OSPARC_CONFIG_DIRNAME}/{OSPARC_CONFIG_METADATA_NAME}"),
):
"""Creates a sh script that uses jq tool to retrieve variables
to use in sh from a json file for use in an osparc service (legacy).
Expand Down Expand Up @@ -84,8 +84,3 @@ def main(
run_script_file_path.write_text(shell_script)
st = run_script_file_path.stat()
run_script_file_path.chmod(st.st_mode | stat.S_IEXEC)


if __name__ == "__main__":
# pylint: disable=no-value-for-parameter
main()
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import logging
from pathlib import Path
from typing import Any, Literal
from typing import Any, Final, Literal

from models_library.callbacks_mapping import CallbacksMapping
from models_library.service_settings_labels import (
Expand Down Expand Up @@ -48,10 +48,10 @@

_logger = logging.getLogger(__name__)

OSPARC_CONFIG_DIRNAME = ".osparc"
OSPARC_CONFIG_COMPOSE_SPEC_NAME = "docker-compose.overwrite.yml"
OSPARC_CONFIG_METADATA_NAME = "metadata.yml"
OSPARC_CONFIG_RUNTIME_NAME = "runtime.yml"
OSPARC_CONFIG_DIRNAME: Final[str] = ".osparc"
OSPARC_CONFIG_COMPOSE_SPEC_NAME: Final[str] = "docker-compose.overwrite.yml"
OSPARC_CONFIG_METADATA_NAME: Final[str] = "metadata.yml"
OSPARC_CONFIG_RUNTIME_NAME: Final[str] = "runtime.yml"


SERVICE_KEY_FORMATS = {
Expand Down

0 comments on commit 0a27dc9

Please sign in to comment.