diff --git a/conan/api/conan_api.py b/conan/api/conan_api.py index a3961ec967e..cc9b8c84dd4 100644 --- a/conan/api/conan_api.py +++ b/conan/api/conan_api.py @@ -61,6 +61,7 @@ def __init__(self, cache_folder=None): def reinit(self): self.config.reinit() + self.config.migrate() self.remotes.reinit() self.local.reinit() diff --git a/conan/api/subapi/cache.py b/conan/api/subapi/cache.py index 8c2dd089784..b3cf0b2159c 100644 --- a/conan/api/subapi/cache.py +++ b/conan/api/subapi/cache.py @@ -243,7 +243,6 @@ def get_backup_sources(self, package_list=None, exclude=True, only_upload=True): return download_cache.get_backup_sources_files(excluded_urls, package_list, only_upload) - def _resolve_latest_ref(cache, ref): if ref.revision is None or ref.revision == "latest": ref.revision = None diff --git a/conan/api/subapi/config.py b/conan/api/subapi/config.py index dd1daf72f00..e1942c4928d 100644 --- a/conan/api/subapi/config.py +++ b/conan/api/subapi/config.py @@ -194,13 +194,12 @@ def appending_recursive_dict_update(d, u): def migrate(self): # Migration system - # TODO: Still needs refactoring - using it here for now for tests + # TODO: A prettier refactoring of migrators would be nice from conans.client.migrations import ClientMigrator migrator = ClientMigrator(self.home(), conan_version) migrator.migrate() def clean(self): - # TODO: Check what we're deleting contents = os.listdir(self.home()) for content in contents: # keep packages diff --git a/conan/cli/commands/config.py b/conan/cli/commands/config.py index 0512a4db09b..8454d1401b3 100644 --- a/conan/cli/commands/config.py +++ b/conan/cli/commands/config.py @@ -140,9 +140,5 @@ def config_clean(conan_api, parser, subparser, *args): """ Clean the configuration files in the Conan home folder. (Keeping installed packages) """ - subparser.add_argument("-c", "--confirm", action='store_true', - help="Do not request confirmation") - args = parser.parse_args(*args) - ui = UserInput(conan_api.config.get("core:non_interactive")) - if args.confirm or ui.request_boolean("Clear all configuration files?"): - conan_api.config.clean() + parser.parse_args(*args) + conan_api.config.clean() diff --git a/test/integration/command/config_test.py b/test/integration/command/config_test.py index 68ba1f4d0ec..a742ab06d54 100644 --- a/test/integration/command/config_test.py +++ b/test/integration/command/config_test.py @@ -211,7 +211,7 @@ def test_config_clean(): "extensions/compatibility/mycomp.py": "", "extensions/commands/cmd_foo.py": "", }) - tc.run("config clean -c") + tc.run("config clean") tc.run("profile list") assert "foo" not in tc.out tc.run("remote list")