Use get_packit_api in propose-update CLI function
@@ -7,10 +7,9 @@ import os
import click
-from packit.api import PackitAPI
from packit.cli.types import LocalProjectParameter
-from packit.cli.utils import cover_packit_exception
-from packit.config import pass_config, get_context_settings, get_local_package_config
+from packit.cli.utils import cover_packit_exception, get_packit_api
+from packit.config import pass_config, get_context_settings
logger = logging.getLogger(__file__)
@@ -42,8 +41,5 @@ def update(config, dist_git_path, dist_git_branch, repo, version):
VERSION argument is optional, the latest upstream version
will be used by default
"""
- package_config = get_local_package_config(directory=repo.working_dir)
- package_config.downstream_project_url = dist_git_path
- package_config.upstream_project_url = repo.working_dir
- api = PackitAPI(config=config, package_config=package_config)
+ api = get_packit_api(config=config, dist_git_path=dist_git_path, repo=repo)
api.sync_release(dist_git_branch, version=version)
