diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 45decc9..d276ebc 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -29,10 +29,9 @@ jobs: os: - ubuntu python-version: - - '3.6' - - '3.7' - - '3.8' - - '3.9' + - "3.7" + - "3.8" + - "3.9" steps: - name: Repo Checkout @@ -115,5 +114,5 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} report_individual_runs: true hide_comments: orphaned commits - check_run_annotations_branch: '*' - files: 'artifacts/python-test-results/*.xml' + check_run_annotations_branch: "*" + files: "artifacts/python-test-results/*.xml" diff --git a/looker_deployer/commands/deploy_boards.py b/looker_deployer/commands/deploy_boards.py index 85601b3..317756e 100644 --- a/looker_deployer/commands/deploy_boards.py +++ b/looker_deployer/commands/deploy_boards.py @@ -198,7 +198,7 @@ def board_content_lists(board_object): if j.look_id: look_list.append(j.look_id) - return(dash_list, look_list) + return (dash_list, look_list) def audit_board_content(board_object, source_sdk, target_sdk): diff --git a/looker_deployer/commands/deploy_content.py b/looker_deployer/commands/deploy_content.py index 77d8122..01b1c74 100644 --- a/looker_deployer/commands/deploy_content.py +++ b/looker_deployer/commands/deploy_content.py @@ -149,7 +149,7 @@ def build_spaces(spaces, sdk): return id_tracker[0] -def deploy_space(s, sdk, env, ini, recursive, debug=False, target_base=None): +def deploy_space(s, sdk, env, ini, recursive, target_base, debug=False): logger.debug("working folder", extra={"working_folder": s}) @@ -202,12 +202,12 @@ def deploy_space(s, sdk, env, ini, recursive, debug=False, target_base=None): if recursive and space_children: logger.info("Attemting Recursion of children folders", extra={"children_folders": space_children}) for child in space_children: - deploy_space(child, sdk, env, ini, recursive, debug, target_base) + deploy_space(child, sdk, env, ini, recursive, target_base, debug) else: logger.info("No Recursion specified or empty child list", extra={"children_folders": space_children}) -def deploy_content(content_type, content, sdk, env, ini, debug=False, target_base=None): +def deploy_content(content_type, content, sdk, env, ini, target_base, debug=False): # extract directory path dirs = content.rpartition(os.sep)[0] + os.sep @@ -243,10 +243,10 @@ def send_content( # copy the source space directory tree to target space override shutil.copytree(s, updated_space) # kick off the job from the new space - deploy_space(updated_space, sdk, env, ini, recursive, debug, target_base) + deploy_space(updated_space, sdk, env, ini, recursive, target_base, debug) # If no target space override, kick off job normally else: - deploy_space(s, sdk, env, ini, recursive, debug, target_base) + deploy_space(s, sdk, env, ini, recursive, target_base, debug) if dashboards: logger.debug("Deploying dashboards", extra={"dashboards": dashboards}) for dash in dashboards: @@ -263,9 +263,9 @@ def send_content( shutil.copy(dash, target_dir) new_dash_path = [os.path.join(target_dir, f) for f in os.listdir(target_dir)][0] # kick off the job from the new space - deploy_content("dashboard", new_dash_path, sdk, env, ini, debug) + deploy_content("dashboard", new_dash_path, sdk, env, ini, target_base, debug) else: - deploy_content("dashboard", dash, sdk, env, ini, debug) + deploy_content("dashboard", dash, sdk, env, ini, target_base, debug) if looks: logger.debug("Deploying looks", extra={"looks": looks}) for look in looks: @@ -282,9 +282,9 @@ def send_content( shutil.copy(look, target_dir) new_look_path = [os.path.join(target_dir, f) for f in os.listdir(target_dir)][0] # kick off the job from the new space - deploy_content("look", new_look_path, sdk, env, ini, debug) + deploy_content("look", new_look_path, sdk, env, ini, target_base, debug) else: - deploy_content("look", look, sdk, env, ini, debug) + deploy_content("look", look, sdk, env, ini, target_base, debug) def main(args): diff --git a/setup.py b/setup.py index a0c5fc5..05dba40 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,6 @@ name=NAME, packages=["looker_deployer", "looker_deployer/commands", "looker_deployer/utils"], entry_points={"console_scripts": ["ldeploy=looker_deployer.cli:main"]}, - python_requires=">=3.6.0, <=3.9.13", + python_requires=">=3.6.0, <3.10", version=VERSION ) diff --git a/tests/test_deploy_content.py b/tests/test_deploy_content.py index 28eb3da..4f4ed1c 100644 --- a/tests/test_deploy_content.py +++ b/tests/test_deploy_content.py @@ -221,7 +221,7 @@ def test_deploy_space_build_call(mocker): mocker.patch("looker_deployer.commands.deploy_content.build_spaces") mocker.patch("looker_deployer.commands.deploy_content.import_content") - deploy_content.deploy_space("Foo/Shared/Bar/", "sdk", "env", "ini", False, False, "Shared") + deploy_content.deploy_space("Foo/Shared/Bar/", "sdk", "env", "ini", False, "Shared", False) deploy_content.build_spaces.assert_called_with(["Shared", "Bar"], "sdk") @@ -239,7 +239,7 @@ def test_deploy_space_look_call(mocker): deploy_content.build_spaces.return_value = "42" mocker.patch("looker_deployer.commands.deploy_content.import_content") - deploy_content.deploy_space("Foo/Shared/Bar", "sdk", "env", "ini", False, False, "Shared") + deploy_content.deploy_space("Foo/Shared/Bar", "sdk", "env", "ini", False, "Shared", False) deploy_content.import_content.assert_called_once_with("look", "Foo/Shared/Bar/Look_test", "42", "env", "ini", False) @@ -257,22 +257,15 @@ def test_deploy_space_dashboard_call(mocker): deploy_content.build_spaces.return_value = "42" mocker.patch("looker_deployer.commands.deploy_content.import_content") - deploy_content.deploy_space("Foo/Shared/Bar", "sdk", "env", "ini", False, False, "Shared") - deploy_content.import_content.assert_called_once_with( - "dashboard", - "Foo/Shared/Bar/Dashboard_test", - "42", - "env", - "ini", - False - ) + deploy_content.deploy_space("Foo/Shared/Bar", "sdk", "env", "ini", False, "Shared", False) + deploy_content.import_content.assert_called_once_with("dashboard", "Foo/Shared/Bar/Dashboard_test", "42", "env", "ini", False) def test_deploy_content_build_call(mocker): mocker.patch("looker_deployer.commands.deploy_content.build_spaces") mocker.patch("looker_deployer.commands.deploy_content.import_content") - deploy_content.deploy_content("look", "Foo/Shared/Bar/Baz/Dashboard_test.json", "sdk", "env", "ini", False, "Shared") + deploy_content.deploy_content("look", "Foo/Shared/Bar/Baz/Dashboard_test.json", "sdk", "env", "ini", "Shared") deploy_content.build_spaces.assert_called_with(["Shared", "Bar", "Baz"], "sdk") @@ -281,5 +274,5 @@ def test_deploy_content_import_content_call(mocker): deploy_content.build_spaces.return_value = "42" mocker.patch("looker_deployer.commands.deploy_content.import_content") - deploy_content.deploy_content("look", "Foo/Shared/Bar/Look_test.json", "sdk", "env", "ini", False, "Shared") + deploy_content.deploy_content("look", "Foo/Shared/Bar/Look_test.json", "sdk", "env", "ini", "Shared") deploy_content.import_content.assert_called_with("look", "Foo/Shared/Bar/Look_test.json", "42", "env", "ini", False)