diff --git a/developers_chamber/bin/pydev.py b/developers_chamber/bin/pydev.py index ca0906c..95da201 100644 --- a/developers_chamber/bin/pydev.py +++ b/developers_chamber/bin/pydev.py @@ -33,6 +33,7 @@ from developers_chamber.scripts.toggle import * from developers_chamber.scripts.version import * from developers_chamber.scripts.init_aliasses import * + click_completion.init() diff --git a/developers_chamber/git_utils.py b/developers_chamber/git_utils.py index 50a4f4a..06d9626 100644 --- a/developers_chamber/git_utils.py +++ b/developers_chamber/git_utils.py @@ -60,7 +60,7 @@ def create_release(version_file, release_type, remote_name=None, branch_name=Non g.tag("-d", str(version)) g.checkout(branch_name or "HEAD", b=release_branch_name) - g.commit(message=f'Bump version to "{version}"') + g.commit(message=f"Bump version to '{version}'") g.tag(str(version)) if remote_name: @@ -102,7 +102,7 @@ def create_deployment_branch(environment, remote_name=None, is_hot=False): pass g.checkout("HEAD", b=deployment_branch_name) - g.commit("--allow-empty", message='Deployment of "{}"'.format(source_branch_name)) + g.commit("--allow-empty", message="Deployment of '{}'".format(source_branch_name)) if remote_name: g.push(remote_name, deployment_branch_name, force=True) @@ -181,7 +181,7 @@ def merge_release_branch(to_branch_name=None, remote_name=None): # GitPython does not support merge --no-ff or what? git_cmd = git.cmd.Git(".") - no_ff_commit = 'Merge branch "{}"'.format(source_branch_name) + no_ff_commit = f"Merge branch '{source_branch_name}'" git_cmd.execute( ("git", "merge", "--no-ff", "-m", no_ff_commit, str(source_branch_name)) ) diff --git a/developers_chamber/project_utils.py b/developers_chamber/project_utils.py index 2de976b..447b7a9 100644 --- a/developers_chamber/project_utils.py +++ b/developers_chamber/project_utils.py @@ -12,17 +12,27 @@ from python_hosts.exception import UnableToWriteHosts from python_hosts.hosts import Hosts, HostsEntry -from developers_chamber.bitbucket_utils import \ - create_pull_request as bitbucket_create_pull_request +from developers_chamber.bitbucket_utils import ( + create_pull_request as bitbucket_create_pull_request, +) from developers_chamber.git_utils import get_current_branch_name -from developers_chamber.jira_utils import (clean_issue_key, get_issue_fields, - log_issue_time) -from developers_chamber.toggle_utils import (check_workspace_and_project, - get_full_timer_report, - get_running_timer_data, - start_timer, stop_running_timer) -from developers_chamber.utils import (call_command, call_compose_command, - pretty_time_delta) +from developers_chamber.jira_utils import ( + clean_issue_key, + get_issue_fields, + log_issue_time, +) +from developers_chamber.toggle_utils import ( + check_workspace_and_project, + get_full_timer_report, + get_running_timer_data, + start_timer, + stop_running_timer, +) +from developers_chamber.utils import ( + call_command, + call_compose_command, + pretty_time_delta, +) LOGGER = logging.getLogger() diff --git a/developers_chamber/scripts/bitbucket.py b/developers_chamber/scripts/bitbucket.py index 2a515e5..1a5c49a 100644 --- a/developers_chamber/scripts/bitbucket.py +++ b/developers_chamber/scripts/bitbucket.py @@ -2,8 +2,9 @@ import click -from developers_chamber.bitbucket_utils import \ - create_merge_release_pull_request as create_merge_release_pull_request_func +from developers_chamber.bitbucket_utils import ( + create_merge_release_pull_request as create_merge_release_pull_request_func, +) from developers_chamber.git_utils import get_current_branch_name from developers_chamber.scripts import cli diff --git a/developers_chamber/scripts/ecs.py b/developers_chamber/scripts/ecs.py index deb9f50..2415c96 100644 --- a/developers_chamber/scripts/ecs.py +++ b/developers_chamber/scripts/ecs.py @@ -2,41 +2,46 @@ import click -from developers_chamber.ecs_utils import \ - deploy_new_task_definition as deploy_new_task_definition_func -from developers_chamber.ecs_utils import \ - get_services_names as get_services_names_func -from developers_chamber.ecs_utils import \ - get_task_definition_for_service as get_task_definition_for_service_func -from developers_chamber.ecs_utils import \ - get_tasks_for_service as get_tasks_for_service_func -from developers_chamber.ecs_utils import \ - redeploy_cluster_services as redeploy_cluster_services_func -from developers_chamber.ecs_utils import \ - redeploy_services as redeploy_services_func -from developers_chamber.ecs_utils import \ - register_new_task_definition as register_new_task_definition_func -from developers_chamber.ecs_utils import \ - run_service_task as run_service_task_func +from developers_chamber.ecs_utils import ( + deploy_new_task_definition as deploy_new_task_definition_func, +) +from developers_chamber.ecs_utils import get_services_names as get_services_names_func +from developers_chamber.ecs_utils import ( + get_task_definition_for_service as get_task_definition_for_service_func, +) +from developers_chamber.ecs_utils import ( + get_tasks_for_service as get_tasks_for_service_func, +) +from developers_chamber.ecs_utils import ( + redeploy_cluster_services as redeploy_cluster_services_func, +) +from developers_chamber.ecs_utils import redeploy_services as redeploy_services_func +from developers_chamber.ecs_utils import ( + register_new_task_definition as register_new_task_definition_func, +) +from developers_chamber.ecs_utils import run_service_task as run_service_task_func from developers_chamber.ecs_utils import run_task as run_task_func -from developers_chamber.ecs_utils import \ - run_task_and_wait_for_success as run_task_and_wait_for_success_func -from developers_chamber.ecs_utils import \ - start_cluster_services as start_cluster_services_func +from developers_chamber.ecs_utils import ( + run_task_and_wait_for_success as run_task_and_wait_for_success_func, +) +from developers_chamber.ecs_utils import ( + start_cluster_services as start_cluster_services_func, +) from developers_chamber.ecs_utils import start_service as start_service_func from developers_chamber.ecs_utils import start_services as start_services_func from developers_chamber.ecs_utils import stop_service as stop_service_func -from developers_chamber.ecs_utils import \ - stop_service_and_wait_for_tasks_to_stop as \ - stop_service_and_wait_for_tasks_to_stop_func -from developers_chamber.ecs_utils import \ - stop_services_and_wait_for_tasks_to_stop as \ - stop_services_and_wait_for_tasks_to_stop_func -from developers_chamber.ecs_utils import \ - update_service_to_latest_task_definition as \ - update_service_to_latest_task_definition_func -from developers_chamber.ecs_utils import \ - wait_for_services_stable as wait_for_services_stable_func +from developers_chamber.ecs_utils import ( + stop_service_and_wait_for_tasks_to_stop as stop_service_and_wait_for_tasks_to_stop_func, +) +from developers_chamber.ecs_utils import ( + stop_services_and_wait_for_tasks_to_stop as stop_services_and_wait_for_tasks_to_stop_func, +) +from developers_chamber.ecs_utils import ( + update_service_to_latest_task_definition as update_service_to_latest_task_definition_func, +) +from developers_chamber.ecs_utils import ( + wait_for_services_stable as wait_for_services_stable_func, +) from developers_chamber.scripts import cli default_region = os.environ.get("AWS_REGION") diff --git a/developers_chamber/scripts/git.py b/developers_chamber/scripts/git.py index 85eea44..65af4be 100644 --- a/developers_chamber/scripts/git.py +++ b/developers_chamber/scripts/git.py @@ -4,18 +4,23 @@ import click -from developers_chamber.git_utils import \ - bump_version_from_release_tag as bump_version_from_release_tag_func -from developers_chamber.git_utils import \ - checkout_to_release_branch as checkout_to_release_branch_func +from developers_chamber.git_utils import ( + bump_version_from_release_tag as bump_version_from_release_tag_func, +) +from developers_chamber.git_utils import ( + checkout_to_release_branch as checkout_to_release_branch_func, +) from developers_chamber.git_utils import commit_version as commit_version_func -from developers_chamber.git_utils import \ - create_deployment_branch as create_deployment_branch_func +from developers_chamber.git_utils import ( + create_deployment_branch as create_deployment_branch_func, +) from developers_chamber.git_utils import create_release as create_release_func -from developers_chamber.git_utils import \ - create_release_branch as create_release_branch_func -from developers_chamber.git_utils import \ - merge_release_branch as merge_release_branch_func +from developers_chamber.git_utils import ( + create_release_branch as create_release_branch_func, +) +from developers_chamber.git_utils import ( + merge_release_branch as merge_release_branch_func, +) from developers_chamber.scripts import cli from developers_chamber.types import EnumType, ReleaseType from developers_chamber.version_utils import get_next_version, get_version diff --git a/developers_chamber/scripts/gitlab.py b/developers_chamber/scripts/gitlab.py index 04e92fe..134c073 100644 --- a/developers_chamber/scripts/gitlab.py +++ b/developers_chamber/scripts/gitlab.py @@ -3,8 +3,9 @@ import click from developers_chamber.git_utils import get_current_branch_name -from developers_chamber.gitlab_utils import \ - create_merge_request as create_merge_request_func +from developers_chamber.gitlab_utils import ( + create_merge_request as create_merge_request_func, +) from developers_chamber.scripts import cli DEFAULT_API_URL = os.environ.get("GITLAB_API_URL", "https://gitlab.com/api/v4") diff --git a/developers_chamber/scripts/jira.py b/developers_chamber/scripts/jira.py index 2f08db2..49803c7 100644 --- a/developers_chamber/scripts/jira.py +++ b/developers_chamber/scripts/jira.py @@ -2,12 +2,11 @@ import click -from developers_chamber.jira_utils import \ - get_branch_name as get_branch_name_func -from developers_chamber.jira_utils import (get_current_user_issues, - get_issue_worklog) -from developers_chamber.jira_utils import \ - invoke_issues_transition as invoke_issues_transition_func +from developers_chamber.jira_utils import get_branch_name as get_branch_name_func +from developers_chamber.jira_utils import get_current_user_issues, get_issue_worklog +from developers_chamber.jira_utils import ( + invoke_issues_transition as invoke_issues_transition_func, +) from developers_chamber.jira_utils import log_issue_time as log_issue_time_func from developers_chamber.jira_utils import show_issue as show_issue_func from developers_chamber.scripts import cli diff --git a/developers_chamber/scripts/project.py b/developers_chamber/scripts/project.py index 928c73b..2fec34c 100644 --- a/developers_chamber/scripts/project.py +++ b/developers_chamber/scripts/project.py @@ -4,25 +4,37 @@ import click from developers_chamber.bitbucket_utils import get_commit_builds -from developers_chamber.click.options import (ContainerCommandType, - ContainerDirToCopyType, - ContainerEnvironment) +from developers_chamber.click.options import ( + ContainerCommandType, + ContainerDirToCopyType, + ContainerEnvironment, +) from developers_chamber.git_utils import create_branch as create_branch_func -from developers_chamber.git_utils import (get_commit_hash, - get_current_branch_name) +from developers_chamber.git_utils import get_commit_hash, get_current_branch_name from developers_chamber.jira_utils import get_branch_name from developers_chamber.project_utils import bind_library as bind_library_func -from developers_chamber.project_utils import (compose_build, compose_exec, - compose_install, - compose_kill_all, compose_run, - compose_stop, compose_up) -from developers_chamber.project_utils import \ - copy_containers_dirs as copy_containers_dirs_func -from developers_chamber.project_utils import \ - create_or_update_pull_request as create_or_update_pull_request_func -from developers_chamber.project_utils import (docker_clean, set_hosts, - start_task, stop_task, - sync_timer_to_jira) +from developers_chamber.project_utils import ( + compose_build, + compose_exec, + compose_install, + compose_kill_all, + compose_run, + compose_stop, + compose_up, +) +from developers_chamber.project_utils import ( + copy_containers_dirs as copy_containers_dirs_func, +) +from developers_chamber.project_utils import ( + create_or_update_pull_request as create_or_update_pull_request_func, +) +from developers_chamber.project_utils import ( + docker_clean, + set_hosts, + start_task, + stop_task, + sync_timer_to_jira, +) from developers_chamber.scripts import cli default_project_name = os.environ.get("PROJECT_DOCKER_COMPOSE_PROJECT_NAME") diff --git a/developers_chamber/scripts/qa.py b/developers_chamber/scripts/qa.py index 909c459..f403e82 100644 --- a/developers_chamber/scripts/qa.py +++ b/developers_chamber/scripts/qa.py @@ -1,11 +1,13 @@ from developers_chamber.qa.base import QACheck, QACheckRunner -from developers_chamber.qa.checks import (ImportOrderQACheck, - MigrationFilenamesQACheck, - MissingMigrationsQACheck, - MissingTranslationsQACheck, - PrintStatementsQACheck, - TestMethodNamesQACheck, - UnusedImportsQACheck) +from developers_chamber.qa.checks import ( + ImportOrderQACheck, + MigrationFilenamesQACheck, + MissingMigrationsQACheck, + MissingTranslationsQACheck, + PrintStatementsQACheck, + TestMethodNamesQACheck, + UnusedImportsQACheck, +) from developers_chamber.scripts import cli diff --git a/developers_chamber/scripts/slack.py b/developers_chamber/scripts/slack.py index ee9c3d4..56ad0f4 100644 --- a/developers_chamber/scripts/slack.py +++ b/developers_chamber/scripts/slack.py @@ -3,8 +3,9 @@ import click from developers_chamber.scripts import cli -from developers_chamber.slack_utils import \ - upload_new_migration as upload_new_migration_func +from developers_chamber.slack_utils import ( + upload_new_migration as upload_new_migration_func, +) from developers_chamber.utils import MIGRATIONS_PATTERN slack_bot_token = os.environ.get("SLACK_BOT_TOKEN") diff --git a/developers_chamber/scripts/toggle.py b/developers_chamber/scripts/toggle.py index 9f7dd2b..93c67ed 100644 --- a/developers_chamber/scripts/toggle.py +++ b/developers_chamber/scripts/toggle.py @@ -4,10 +4,13 @@ import click from developers_chamber.scripts import cli -from developers_chamber.toggle_utils import (get_full_timer_report, - get_running_timer_data, - get_timer_report, start_timer, - stop_running_timer) +from developers_chamber.toggle_utils import ( + get_full_timer_report, + get_running_timer_data, + get_timer_report, + start_timer, + stop_running_timer, +) from developers_chamber.utils import pretty_time_delta api_key = os.environ.get("TOGGL_API_KEY") diff --git a/developers_chamber/scripts/version.py b/developers_chamber/scripts/version.py index f1c8a91..6711559 100644 --- a/developers_chamber/scripts/version.py +++ b/developers_chamber/scripts/version.py @@ -4,8 +4,9 @@ from developers_chamber.scripts import cli from developers_chamber.types import EnumType, ReleaseType -from developers_chamber.version_utils import \ - bump_to_next_version as bump_to_next_version_func +from developers_chamber.version_utils import ( + bump_to_next_version as bump_to_next_version_func, +) from developers_chamber.version_utils import get_next_version, get_version default_version_files = os.environ.get("VERSION_FILES", "version.json").split(",") diff --git a/setup.py b/setup.py index d2e393e..56044dd 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='developers-chamber', - version='0.1.4', + version='0.1.5', description='A small plugin which help with development, deployment, git', keywords='django, skripts, easy live, git, bitbucket, Jira', author='Druids team',