Remove remaining relative imports

This commit is contained in:
David Boreham 2023-07-05 11:36:07 -06:00
parent 0358f5e1f1
commit d7491d26c9
5 changed files with 12 additions and 12 deletions

View File

@ -25,8 +25,8 @@ from decouple import config
import click import click
import importlib.resources import importlib.resources
from python_on_whales import docker, DockerException from python_on_whales import docker, DockerException
from .base import get_stack from app.base import get_stack
from .util import include_exclude_check, get_parsed_stack_config from app.util import include_exclude_check, get_parsed_stack_config
builder_js_image_name = "cerc/builder-js:local" builder_js_image_name = "cerc/builder-js:local"
@ -81,7 +81,7 @@ def command(ctx, include, exclude, force_rebuild, extra_build_args):
os.makedirs(build_root_path) os.makedirs(build_root_path)
# See: https://stackoverflow.com/a/20885799/1701505 # See: https://stackoverflow.com/a/20885799/1701505
from . import data from app import data
with importlib.resources.open_text(data, "npm-package-list.txt") as package_list_file: with importlib.resources.open_text(data, "npm-package-list.txt") as package_list_file:
all_packages = package_list_file.read().splitlines() all_packages = package_list_file.read().splitlines()

View File

@ -26,9 +26,9 @@ import subprocess
from python_on_whales import DockerClient, DockerException from python_on_whales import DockerClient, DockerException
import click import click
from pathlib import Path from pathlib import Path
from .util import include_exclude_check, get_parsed_stack_config, global_options2 from app.util import include_exclude_check, get_parsed_stack_config, global_options2
from .deployment_create import create as deployment_create from app.deployment_create import create as deployment_create
from .deployment_create import init as deployment_init from app.deployment_create import init as deployment_init
class DeployCommandContext(object): class DeployCommandContext(object):
@ -263,7 +263,7 @@ def _make_cluster_context(ctx, stack, include, exclude, cluster, env_file):
print(f"Using cluster name: {cluster}") print(f"Using cluster name: {cluster}")
# See: https://stackoverflow.com/a/20885799/1701505 # See: https://stackoverflow.com/a/20885799/1701505
from . import data from app import data
with resources.open_text(data, "pod-list.txt") as pod_list_file: with resources.open_text(data, "pod-list.txt") as pod_list_file:
all_pods = pod_list_file.read().splitlines() all_pods = pod_list_file.read().splitlines()

View File

@ -17,8 +17,8 @@ import click
from dataclasses import dataclass from dataclasses import dataclass
from pathlib import Path from pathlib import Path
import sys import sys
from .deploy import up_operation, down_operation, ps_operation, port_operation, exec_operation, logs_operation, create_deploy_context from app.deploy import up_operation, down_operation, ps_operation, port_operation, exec_operation, logs_operation, create_deploy_context
from .util import global_options from app.util import global_options
@dataclass @dataclass

View File

@ -25,7 +25,7 @@ import click
import importlib.resources import importlib.resources
from pathlib import Path from pathlib import Path
import yaml import yaml
from .util import include_exclude_check from app.util import include_exclude_check
class GitProgress(git.RemoteProgress): class GitProgress(git.RemoteProgress):
@ -227,7 +227,7 @@ def command(ctx, include, exclude, git_ssh, check_only, pull, branches, branches
os.makedirs(dev_root_path) os.makedirs(dev_root_path)
# See: https://stackoverflow.com/a/20885799/1701505 # See: https://stackoverflow.com/a/20885799/1701505
from . import data from app import data
with importlib.resources.open_text(data, "repository-list.txt") as repository_list_file: with importlib.resources.open_text(data, "repository-list.txt") as repository_list_file:
all_repos = repository_list_file.read().splitlines() all_repos = repository_list_file.read().splitlines()

View File

@ -22,7 +22,7 @@ def command(ctx):
'''print tool version''' '''print tool version'''
# See: https://stackoverflow.com/a/20885799/1701505 # See: https://stackoverflow.com/a/20885799/1701505
from . import data from app import data
with importlib.resources.open_text(data, "build_tag.txt") as version_file: with importlib.resources.open_text(data, "build_tag.txt") as version_file:
# TODO: code better version that skips comment lines # TODO: code better version that skips comment lines
version_string = version_file.read().splitlines()[1] version_string = version_file.read().splitlines()[1]