Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 12, 2022
1 parent 8522343 commit 8751291
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/lightning_app/runners/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
from lightning_app.storage import Drive
from lightning_app.utilities.app_helpers import Logger
from lightning_app.utilities.cloud import _get_project
from lightning_app.utilities.secrets import _names_to_ids
from lightning_app.utilities.dependency_caching import get_hash
from lightning_app.utilities.packaging.app_config import AppConfig, find_config_file
from lightning_app.utilities.packaging.lightning_utils import _prepare_lightning_wheels_and_requirements
from lightning_app.utilities.secrets import _names_to_ids

logger = Logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/lightning_app/runners/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def dispatch(
host=host,
port=port,
env_vars=env_vars,
secrets=secrets
secrets=secrets,
)
# a cloud dispatcher will return the result while local
# dispatchers will be running the app in the main process
Expand Down
8 changes: 4 additions & 4 deletions src/lightning_app/utilities/secrets.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Dict, List

from lightning_app.utilities.network import LightningClient
from lightning_app.utilities.cloud import _get_project
from lightning_app.utilities.network import LightningClient


def _names_to_ids(secret_names: List[str]) -> Dict[str, str]:
"""
Returns the name/ID pair for each given Secret name.
"""Returns the name/ID pair for each given Secret name.
Raises a `ValueError` if any of the given Secret names do not exist.
"""
lightning_client = LightningClient()
Expand All @@ -21,6 +21,6 @@ def _names_to_ids(secret_names: List[str]) -> Dict[str, str]:

for secret_name in secret_names:
if secret_name not in secret_names_to_ids.keys():
raise ValueError(f"Secret with name '{secret.name}' not found")
raise ValueError(f"Secret with name '{secret.name}' not found")

return secret_names_to_ids
9 changes: 2 additions & 7 deletions tests/tests_app/utilities/test_secrets.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import pytest
from typing import Dict, List
from unittest import mock
from unittest.mock import MagicMock

from lightning_cloud.openapi import (
V1ListMembershipsResponse,
V1Membership,
V1ListSecretsResponse,
V1Secret,
)
import pytest
from lightning_cloud.openapi import V1ListMembershipsResponse, V1ListSecretsResponse, V1Membership, V1Secret

from lightning_app.utilities.secrets import _names_to_ids

Expand Down

0 comments on commit 8751291

Please sign in to comment.