Skip to content

Commit

Permalink
Rename variables for readibility
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke committed Aug 28, 2024
1 parent 402546f commit 14853e6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/playwright/utils/deploy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys
import tempfile
import time
from typing import Any, Callable, TypeVar
from typing import Any, Callable, List, TypeVar

import pytest
import requests
Expand All @@ -30,12 +30,12 @@
server_url = os.environ.get("DEPLOY_CONNECT_SERVER_URL")
api_key = os.environ.get("DEPLOY_CONNECT_SERVER_API_KEY")
# shinyapps.io
name = os.environ.get("DEPLOY_SHINYAPPS_NAME")
token = os.environ.get("DEPLOY_SHINYAPPS_TOKEN")
secret = os.environ.get("DEPLOY_SHINYAPPS_SECRET")
shinyappsio_name = os.environ.get("DEPLOY_SHINYAPPS_NAME")
shinyappsio_token = os.environ.get("DEPLOY_SHINYAPPS_TOKEN")
shinyappsio_secret = os.environ.get("DEPLOY_SHINYAPPS_SECRET")

deploy_locations: List[str] = ["connect", "shinyapps"]

deploy_locations = ["connect", "shinyapps"]

CallableT = TypeVar("CallableT", bound=Callable[..., Any])

Expand Down Expand Up @@ -105,9 +105,9 @@ def deploy_to_connect(app_name: str, app_dir: str) -> str:
# TODO-future: Supress web browser from opening after deploying - https://github.com/rstudio/rsconnect-python/issues/462
def deploy_to_shinyapps(app_name: str, app_dir: str) -> str:
# Deploy to shinyapps.io
shinyapps_deploy = f"rsconnect deploy shiny {app_dir} --account {name} --token {token} --secret {secret} --title {app_name} --verbose"
shinyapps_deploy = f"rsconnect deploy shiny {app_dir} --account {shinyappsio_name} --token {shinyappsio_token} --secret {shinyappsio_secret} --title {app_name} --verbose"
run_command(shinyapps_deploy)
return f"https://{name}.shinyapps.io/{app_name}/"
return f"https://{shinyappsio_name}.shinyapps.io/{app_name}/"


# Since connect parses python packages, we need to get latest version of shiny on HEAD
Expand Down Expand Up @@ -185,6 +185,7 @@ def create_deploys_app_url_fixture(
):
@pytest.fixture(scope=scope, params=[*deploy_locations, LOCAL_LOCATION])
def fix_fn(request: pytest.FixtureRequest):

app_file = os.path.join(os.path.dirname(request.path), "app.py")
deploy_location = request.param

Expand Down

0 comments on commit 14853e6

Please sign in to comment.