Skip to content

Commit

Permalink
fix: typing added
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeWithEmad authored and Faraz32123 committed Nov 24, 2023
1 parent ed0935d commit e18fede
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions tutordiscovery/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@

HERE = os.path.abspath(os.path.dirname(__file__))


config = {
"unique": {
"MYSQL_PASSWORD": "{{ 8|random_string }}",
"SECRET_KEY": "{{ 20|random_string }}",
"OAUTH2_SECRET": "{{ 8|random_string }}",
"OAUTH2_SECRET_SSO": "{{ 8|random_string }}",
},
config: t.Dict[str, t.Dict[str, t.Any]] = {
"defaults": {
"VERSION": __version__,
"DOCKER_IMAGE": "{{ DOCKER_REGISTRY}}overhangio/openedx-discovery:{{ DISCOVERY_VERSION }}",
Expand Down Expand Up @@ -91,15 +84,19 @@

# Automount /openedx/discovery folder from the container
@tutor_hooks.Filters.COMPOSE_MOUNTS.add()
def _mount_course_discovery(mounts, name):
def _mount_course_discovery(
mounts: list[tuple[str, str]], name: str
) -> list[tuple[str, str]]:
if name == REPO_NAME:
mounts.append((APP_NAME, "/openedx/discovery"))
return mounts


# Bind-mount repo at build-time, both for prod and dev images
@tutor_hooks.Filters.IMAGES_BUILD_MOUNTS.add()
def _mount_course_discovery_on_build(mounts: list[tuple[str, str]], host_path: str) -> list[tuple[str, str]]:
def _mount_course_discovery_on_build(
mounts: list[tuple[str, str]], host_path: str
) -> list[tuple[str, str]]:
path_basename = os.path.basename(host_path)
if path_basename == REPO_NAME:
mounts.append((APP_NAME, f"{APP_NAME}-src"))
Expand Down Expand Up @@ -143,7 +140,9 @@ def _mount_course_discovery_on_build(mounts: list[tuple[str, str]], host_path: s


@tutor_hooks.Filters.APP_PUBLIC_HOSTS.add()
def _print_discovery_public_hosts(hosts: list[str], context_name: t.Literal["local", "dev"]) -> list[str]:
def _print_discovery_public_hosts(
hosts: list[str], context_name: t.Literal["local", "dev"]
) -> list[str]:
if context_name == "dev":
hosts += ["{{ DISCOVERY_HOST }}:8381"]
else:
Expand Down

0 comments on commit e18fede

Please sign in to comment.