diff --git a/conan/api/conan_api.py b/conan/api/conan_api.py index 604e205e85e..7c5f364bd0e 100644 --- a/conan/api/conan_api.py +++ b/conan/api/conan_api.py @@ -19,7 +19,7 @@ from conan.api.subapi.upload import UploadAPI from conans.client.migrations import ClientMigrator from conans.client.userio import init_colorama -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.version import Version from conan.internal.paths import get_conan_user_home from conans.model.version_range import validate_conan_version diff --git a/conan/api/model.py b/conan/api/model.py index abc5ebc84e0..e0c6fe91dd3 100644 --- a/conan/api/model.py +++ b/conan/api/model.py @@ -5,7 +5,8 @@ from conans.client.graph.graph import RECIPE_EDITABLE, RECIPE_CONSUMER, RECIPE_PLATFORM, \ RECIPE_VIRTUAL, BINARY_SKIP, BINARY_MISSING, BINARY_INVALID -from conans.errors import ConanException, NotFoundException +from conan.internal.errors import NotFoundException +from conan.errors import ConanException from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference from conans.util.files import load diff --git a/conan/api/output.py b/conan/api/output.py index f7fc1fe6196..dd4a8e7953d 100644 --- a/conan/api/output.py +++ b/conan/api/output.py @@ -7,7 +7,7 @@ from colorama import Fore, Style from conans.client.userio import color_enabled -from conans.errors import ConanException +from conan.errors import ConanException LEVEL_QUIET = 80 # -q LEVEL_ERROR = 70 # Errors diff --git a/conan/api/subapi/cache.py b/conan/api/subapi/cache.py index dd62c195639..d347b272809 100644 --- a/conan/api/subapi/cache.py +++ b/conan/api/subapi/cache.py @@ -11,7 +11,7 @@ from conan.internal.conan_app import ConanApp from conan.internal.cache.integrity_check import IntegrityChecker from conans.client.downloaders.download_cache import DownloadCache -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference from conans.util.dates import revision_timestamp_now diff --git a/conan/api/subapi/command.py b/conan/api/subapi/command.py index 4405f38923b..950e8bf5c9c 100644 --- a/conan/api/subapi/command.py +++ b/conan/api/subapi/command.py @@ -1,4 +1,4 @@ -from conans.errors import ConanException +from conan.errors import ConanException class CommandAPI: diff --git a/conan/api/subapi/config.py b/conan/api/subapi/config.py index c3ba8032ca9..57d0ec02635 100644 --- a/conan/api/subapi/config.py +++ b/conan/api/subapi/config.py @@ -15,7 +15,7 @@ from conans.client.graph.graph import CONTEXT_HOST, RECIPE_VIRTUAL, Node from conans.client.graph.graph_builder import DepsGraphBuilder from conans.client.graph.profile_node_definer import consumer_definer -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conf import ConfDefinition, BUILT_IN_CONFS from conans.model.pkg_type import PackageType from conans.model.recipe_ref import RecipeReference diff --git a/conan/api/subapi/download.py b/conan/api/subapi/download.py index 2ccb87c5d73..1bd369557ea 100644 --- a/conan/api/subapi/download.py +++ b/conan/api/subapi/download.py @@ -5,7 +5,7 @@ from conan.api.model import Remote, PackagesList from conan.api.output import ConanOutput from conan.internal.conan_app import ConanApp -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference diff --git a/conan/api/subapi/graph.py b/conan/api/subapi/graph.py index 2b526058779..b6ff4f844de 100644 --- a/conan/api/subapi/graph.py +++ b/conan/api/subapi/graph.py @@ -5,7 +5,7 @@ from conans.client.graph.graph_binaries import GraphBinariesAnalyzer from conans.client.graph.graph_builder import DepsGraphBuilder from conans.client.graph.profile_node_definer import initialize_conanfile_profile, consumer_definer -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference diff --git a/conan/api/subapi/install.py b/conan/api/subapi/install.py index adb134bc0f0..cf3a9c4e744 100644 --- a/conan/api/subapi/install.py +++ b/conan/api/subapi/install.py @@ -6,7 +6,7 @@ from conans.client.graph.install_graph import InstallGraph from conans.client.installer import BinaryInstaller -from conans.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration class InstallAPI: diff --git a/conan/api/subapi/list.py b/conan/api/subapi/list.py index fecf61ab398..be074ec0217 100644 --- a/conan/api/subapi/list.py +++ b/conan/api/subapi/list.py @@ -7,7 +7,8 @@ from conan.internal.api.list.query_parse import filter_package_configs from conan.internal.conan_app import ConanApp from conan.internal.paths import CONANINFO -from conans.errors import ConanException, NotFoundException +from conan.internal.errors import NotFoundException +from conan.errors import ConanException from conans.model.info import load_binary_info from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference, ref_matches diff --git a/conan/api/subapi/local.py b/conan/api/subapi/local.py index 224ef3dcd56..7b252a6bd66 100644 --- a/conan/api/subapi/local.py +++ b/conan/api/subapi/local.py @@ -7,7 +7,8 @@ from conans.client.graph.graph import CONTEXT_HOST from conans.client.graph.profile_node_definer import initialize_conanfile_profile from conans.client.source import run_source_method -from conans.errors import ConanException, conanfile_exception_formatter +from conan.internal.errors import conanfile_exception_formatter +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference from conans.util.files import chdir diff --git a/conan/api/subapi/lockfile.py b/conan/api/subapi/lockfile.py index 1d193bbcd79..76a80717976 100644 --- a/conan/api/subapi/lockfile.py +++ b/conan/api/subapi/lockfile.py @@ -3,7 +3,7 @@ from conan.api.output import ConanOutput from conan.cli import make_abs_path from conans.client.graph.graph import Overrides -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.graph_lock import Lockfile, LOCKFILE diff --git a/conan/api/subapi/new.py b/conan/api/subapi/new.py index 46812371887..081f7e75484 100644 --- a/conan/api/subapi/new.py +++ b/conan/api/subapi/new.py @@ -3,7 +3,7 @@ from jinja2 import Template, StrictUndefined -from conans.errors import ConanException +from conan.errors import ConanException from conans.util.files import load from conans import __version__ diff --git a/conan/api/subapi/profiles.py b/conan/api/subapi/profiles.py index d3849525add..065a178d4a4 100644 --- a/conan/api/subapi/profiles.py +++ b/conan/api/subapi/profiles.py @@ -5,7 +5,8 @@ from conans.client.loader import load_python_file from conan.internal.api.profile.profile_loader import ProfileLoader -from conans.errors import ConanException, scoped_traceback +from conan.internal.errors import scoped_traceback +from conan.errors import ConanException from conans.model.profile import Profile DEFAULT_PROFILE_NAME = "default" diff --git a/conan/api/subapi/remotes.py b/conan/api/subapi/remotes.py index 23b31a225ce..77fe0dd3480 100644 --- a/conan/api/subapi/remotes.py +++ b/conan/api/subapi/remotes.py @@ -10,7 +10,7 @@ from conans.client.rest_client_local_recipe_index import add_local_recipes_index_remote, \ remove_local_recipes_index_remote from conan.internal.api.remotes.localdb import LocalDB -from conans.errors import ConanException +from conan.errors import ConanException from conans.util.files import save, load CONAN_CENTER_REMOTE_NAME = "conancenter" diff --git a/conan/api/subapi/upload.py b/conan/api/subapi/upload.py index 47bf8b1c376..0522096e697 100644 --- a/conan/api/subapi/upload.py +++ b/conan/api/subapi/upload.py @@ -8,7 +8,8 @@ gather_metadata from conans.client.pkg_sign import PkgSignaturesPlugin from conans.client.rest.file_uploader import FileUploader -from conans.errors import ConanException, AuthenticationException, ForbiddenException +from conan.internal.errors import AuthenticationException, ForbiddenException +from conan.errors import ConanException class UploadAPI: diff --git a/conan/cli/commands/download.py b/conan/cli/commands/download.py index dbaa4f73e85..a7c72a0ccbd 100644 --- a/conan/cli/commands/download.py +++ b/conan/cli/commands/download.py @@ -4,7 +4,7 @@ from conan.cli import make_abs_path from conan.cli.command import conan_command, OnceArgument from conan.cli.commands.list import print_list_text, print_list_json -from conans.errors import ConanException +from conan.errors import ConanException @conan_command(group="Creator", formatters={"text": print_list_text, diff --git a/conan/cli/commands/export_pkg.py b/conan/cli/commands/export_pkg.py index a47cdfe46a2..e61c5ce7252 100644 --- a/conan/cli/commands/export_pkg.py +++ b/conan/cli/commands/export_pkg.py @@ -7,7 +7,7 @@ from conan.cli.commands.create import _get_test_conanfile_path from conan.cli.formatters.graph import format_graph_json from conan.cli.printers.graph import print_graph_basic -from conans.errors import ConanException +from conan.errors import ConanException @conan_command(group="Creator", formatters={"json": format_graph_json}) diff --git a/conan/cli/commands/graph.py b/conan/cli/commands/graph.py index a929f39f1e9..ee0c4164b6a 100644 --- a/conan/cli/commands/graph.py +++ b/conan/cli/commands/graph.py @@ -15,7 +15,7 @@ from conan.internal.deploy import do_deploys from conans.client.graph.graph import BINARY_MISSING from conans.client.graph.install_graph import InstallGraph -from conans.errors import NotFoundException +from conan.internal.errors import NotFoundException from conans.model.recipe_ref import ref_matches, RecipeReference diff --git a/conan/cli/commands/list.py b/conan/cli/commands/list.py index ed700fe5e15..41c383692ac 100644 --- a/conan/cli/commands/list.py +++ b/conan/cli/commands/list.py @@ -6,7 +6,7 @@ from conan.cli import make_abs_path from conan.cli.command import conan_command, OnceArgument from conan.cli.formatters.list import list_packages_html -from conans.errors import ConanException +from conan.errors import ConanException from conans.util.dates import timestamp_to_str diff --git a/conan/cli/commands/pkglist.py b/conan/cli/commands/pkglist.py index ee8d4aaaa6e..e4dc701a946 100644 --- a/conan/cli/commands/pkglist.py +++ b/conan/cli/commands/pkglist.py @@ -6,7 +6,7 @@ from conan.cli.command import conan_command, conan_subcommand from conan.cli.commands.list import print_list_text, print_list_json from conan.cli.formatters.list import list_packages_html -from conans.errors import NotFoundException +from conan.internal.errors import NotFoundException @conan_command(group="Consumer") diff --git a/conan/cli/commands/remove.py b/conan/cli/commands/remove.py index 74ac93d99dd..85e925e792b 100644 --- a/conan/cli/commands/remove.py +++ b/conan/cli/commands/remove.py @@ -5,7 +5,7 @@ from conan.cli.command import conan_command, OnceArgument from conan.cli.commands.list import print_list_json, print_serial from conans.client.userio import UserInput -from conans.errors import ConanException +from conan.errors import ConanException def summary_remove_list(results): diff --git a/conan/errors.py b/conan/errors.py index 1b237c2a913..b150a729ebe 100644 --- a/conan/errors.py +++ b/conan/errors.py @@ -1,3 +1,22 @@ -from conans.errors import ConanException -from conans.errors import ConanInvalidConfiguration -from conans.errors import ConanMigrationError +class ConanException(Exception): + """ Generic conan exception """ + def __init__(self, msg=None, remote=None): + self.remote = remote + super().__init__(msg) + + def __str__(self): + msg = super().__str__() + if self.remote: + return f"{msg}. [Remote: {self.remote.name}]" + return msg + + +class ConanInvalidConfiguration(ConanException): + """ + This binary, for the requested configuration and package-id cannot be built + """ + pass + + +class ConanMigrationError(ConanException): + pass diff --git a/conan/internal/api/config/config_installer.py b/conan/internal/api/config/config_installer.py index 3a7e63679dd..d31569e90d3 100644 --- a/conan/internal/api/config/config_installer.py +++ b/conan/internal/api/config/config_installer.py @@ -7,7 +7,7 @@ from conan.api.output import ConanOutput from conans.client.downloaders.file_downloader import FileDownloader -from conans.errors import ConanException +from conan.errors import ConanException from conans.util.files import mkdir, rmdir, remove, unzip, chdir from conans.util.runners import detect_runner diff --git a/conan/internal/api/detect/detect_vs.py b/conan/internal/api/detect/detect_vs.py index 34859d7ca9d..6139870398e 100644 --- a/conan/internal/api/detect/detect_vs.py +++ b/conan/internal/api/detect/detect_vs.py @@ -3,7 +3,7 @@ from shutil import which from conan.tools.build import cmd_args_to_string -from conans.errors import ConanException +from conan.errors import ConanException def vs_installation_path(version): diff --git a/conan/internal/api/export.py b/conan/internal/api/export.py index 279693feee3..bc0d09c7abc 100644 --- a/conan/internal/api/export.py +++ b/conan/internal/api/export.py @@ -4,7 +4,8 @@ from conan.tools.files import copy from conan.api.output import ConanOutput from conan.tools.scm import Git -from conans.errors import ConanException, conanfile_exception_formatter +from conan.internal.errors import conanfile_exception_formatter +from conan.errors import ConanException from conans.model.manifest import FileTreeManifest from conans.model.recipe_ref import RecipeReference from conan.internal.paths import DATA_YML diff --git a/conan/internal/api/install/generators.py b/conan/internal/api/install/generators.py index 9b7de140d42..3fd02da74ef 100644 --- a/conan/internal/api/install/generators.py +++ b/conan/internal/api/install/generators.py @@ -5,7 +5,8 @@ from conan.internal.cache.home_paths import HomePaths from conans.client.subsystems import deduce_subsystem, subsystem_path -from conans.errors import ConanException, conanfile_exception_formatter +from conan.internal.errors import conanfile_exception_formatter +from conan.errors import ConanException from conans.util.files import save, mkdir, chdir _generators = {"CMakeToolchain": "conan.tools.cmake", diff --git a/conan/internal/api/profile/profile_loader.py b/conan/internal/api/profile/profile_loader.py index e9047054a49..3ea76a37946 100644 --- a/conan/internal/api/profile/profile_loader.py +++ b/conan/internal/api/profile/profile_loader.py @@ -9,7 +9,7 @@ from conan.internal.api.detect import detect_api from conan.internal.cache.home_paths import HomePaths from conan.tools.env.environment import ProfileEnvironment -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conf import ConfDefinition, CORE_CONF_PATTERN from conans.model.options import Options from conans.model.profile import Profile diff --git a/conan/internal/api/uploader.py b/conan/internal/api/uploader.py index 2cdf1ff2ad7..8d8b8a4d93c 100644 --- a/conan/internal/api/uploader.py +++ b/conan/internal/api/uploader.py @@ -6,7 +6,8 @@ from conan.internal.conan_app import ConanApp from conan.api.output import ConanOutput from conans.client.source import retrieve_exports_sources -from conans.errors import ConanException, NotFoundException +from conan.internal.errors import NotFoundException +from conan.errors import ConanException from conan.internal.paths import (CONAN_MANIFEST, CONANFILE, EXPORT_SOURCES_TGZ_NAME, EXPORT_TGZ_NAME, PACKAGE_TGZ_NAME, CONANINFO) from conans.util.files import (clean_dirty, is_dirty, gather_files, diff --git a/conan/internal/cache/cache.py b/conan/internal/cache/cache.py index 5a8e754f277..870ea2b2924 100644 --- a/conan/internal/cache/cache.py +++ b/conan/internal/cache/cache.py @@ -10,7 +10,8 @@ # TODO: Random folders are no longer accessible, how to get rid of them asap? # TODO: We need the workflow to remove existing references. from conan.internal.cache.db.cache_database import CacheDatabase -from conans.errors import ConanReferenceAlreadyExistsInDB, ConanException +from conan.internal.errors import ConanReferenceAlreadyExistsInDB +from conan.errors import ConanException from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference from conans.util.dates import revision_timestamp_now diff --git a/conan/internal/cache/db/packages_table.py b/conan/internal/cache/db/packages_table.py index a5ec13b7a51..9f066d9b7ef 100644 --- a/conan/internal/cache/db/packages_table.py +++ b/conan/internal/cache/db/packages_table.py @@ -1,7 +1,7 @@ import sqlite3 from conan.internal.cache.db.table import BaseDbTable -from conans.errors import ConanReferenceDoesNotExistInDB, ConanReferenceAlreadyExistsInDB +from conan.internal.errors import ConanReferenceDoesNotExistInDB, ConanReferenceAlreadyExistsInDB from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference from conans.util.dates import timestamp_now diff --git a/conan/internal/cache/db/recipes_table.py b/conan/internal/cache/db/recipes_table.py index fe40ab56782..a6d41363978 100644 --- a/conan/internal/cache/db/recipes_table.py +++ b/conan/internal/cache/db/recipes_table.py @@ -1,7 +1,7 @@ import sqlite3 from conan.internal.cache.db.table import BaseDbTable -from conans.errors import ConanReferenceDoesNotExistInDB, ConanReferenceAlreadyExistsInDB +from conan.internal.errors import ConanReferenceDoesNotExistInDB, ConanReferenceAlreadyExistsInDB from conans.model.recipe_ref import RecipeReference from conans.util.dates import timestamp_now diff --git a/conan/internal/cache/integrity_check.py b/conan/internal/cache/integrity_check.py index fa52d536255..e711701a5b9 100644 --- a/conan/internal/cache/integrity_check.py +++ b/conan/internal/cache/integrity_check.py @@ -1,7 +1,7 @@ import os from conan.api.output import ConanOutput -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference diff --git a/conan/internal/deploy.py b/conan/internal/deploy.py index 05895794ef4..977bb07445f 100644 --- a/conan/internal/deploy.py +++ b/conan/internal/deploy.py @@ -5,7 +5,8 @@ from conan.internal.cache.home_paths import HomePaths from conan.api.output import ConanOutput from conans.client.loader import load_python_file -from conans.errors import ConanException, conanfile_exception_formatter +from conan.internal.errors import conanfile_exception_formatter +from conan.errors import ConanException from conans.util.files import rmdir, mkdir diff --git a/conans/errors.py b/conan/internal/errors.py similarity index 82% rename from conans/errors.py rename to conan/internal/errors.py index 294658603a6..57c559e61a9 100644 --- a/conans/errors.py +++ b/conan/internal/errors.py @@ -1,15 +1,8 @@ -""" - Exceptions raised and handled in Conan - These exceptions are mapped between server (as an HTTP response) and client - through the REST API. When an error happens in server its translated to an HTTP - error code that its sent to client. Client reads the server code and raise the - matching exception. - - see return_plugin.py -""" import traceback from contextlib import contextmanager +from conan.errors import ConanException, ConanInvalidConfiguration + @contextmanager def conanfile_remove_attr(conanfile, names, method): @@ -88,19 +81,6 @@ def scoped_traceback(header_msg, exception, scope): return ret -class ConanException(Exception): - """ Generic conan exception """ - def __init__(self, msg=None, remote=None): - self.remote = remote - super().__init__(msg) - - def __str__(self): - msg = super().__str__() - if self.remote: - return f"{msg}. [Remote: {self.remote.name}]" - return msg - - class ConanReferenceDoesNotExistInDB(ConanException): """ Reference does not exist in cache db """ pass @@ -115,18 +95,6 @@ class ConanConnectionError(ConanException): pass -class ConanInvalidConfiguration(ConanException): - """ - This binary, for the requested configuration and package-id cannot be built - """ - pass - - -class ConanMigrationError(ConanException): - pass - - -# Remote exceptions # class InternalErrorException(ConanException): """ Generic 500 error diff --git a/conan/internal/internal_tools.py b/conan/internal/internal_tools.py index 195b65a7647..ccf594e57ef 100644 --- a/conan/internal/internal_tools.py +++ b/conan/internal/internal_tools.py @@ -1,4 +1,4 @@ -from conans.errors import ConanException +from conan.errors import ConanException universal_arch_separator = '|' diff --git a/conan/internal/runner/docker.py b/conan/internal/runner/docker.py index b9f9ab8f1e4..5e57b066a19 100644 --- a/conan/internal/runner/docker.py +++ b/conan/internal/runner/docker.py @@ -9,7 +9,7 @@ from conan.api.conan_api import ConfigAPI from conan.cli import make_abs_path from conan.internal.runner import RunnerException -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.version import Version diff --git a/conan/internal/runner/ssh.py b/conan/internal/runner/ssh.py index 66aca5bd055..b6fb0ab0083 100644 --- a/conan/internal/runner/ssh.py +++ b/conan/internal/runner/ssh.py @@ -3,7 +3,7 @@ import tempfile from conan.api.output import Color, ConanOutput -from conans.errors import ConanException +from conan.errors import ConanException import os from io import BytesIO diff --git a/conan/internal/runner/wsl.py b/conan/internal/runner/wsl.py index 3e4744b6225..4d42f97e5c3 100644 --- a/conan/internal/runner/wsl.py +++ b/conan/internal/runner/wsl.py @@ -1,6 +1,6 @@ from pathlib import PurePosixPath, PureWindowsPath, Path from conan.api.output import Color, ConanOutput -from conans.errors import ConanException +from conan.errors import ConanException from conans.util.runners import conan_run from conans.client.subsystems import subsystem_path from conan.tools.files import save @@ -61,7 +61,7 @@ def run(self): create_json_wsl = subsystem_path("wsl", create_json) pkglist_json = PureWindowsPath(tmp_dir).joinpath("pkglist.json").as_posix() pkglist_json_wsl = subsystem_path("wsl", pkglist_json) - + saved_cache = PureWindowsPath(tmp_dir).joinpath("saved_cache.tgz").as_posix() saved_cache_wsl = subsystem_path("wsl", saved_cache) conan_run(f"wsl.exe --cd {tmp_dir_wsl} -- CONAN_RUNNER_ENVIRONMENT=1 CONAN_HOME={self.remote_conan_home} {self.remote_conan} list --graph={create_json_wsl} --format=json > {pkglist_json}") @@ -89,7 +89,7 @@ def ensure_runner_environment(self): self.remote_conan_home = conan_home has_conan = conan_run(f"wsl.exe CONAN_HOME={conan_home.as_posix()} {remote_conan} --version", stdout=stdout, stderr=stderr) == 0 - + if not has_conan: wsl_info("Bootstrapping Conan in remote") conan_run(f"wsl.exe mkdir -p {remote_home}/.conan2remote") @@ -109,7 +109,7 @@ def ensure_runner_environment(self): # If this command succeeds, great - if not because it already exists, ignore conan_run(f"wsl.exe CONAN_HOME={conan_home.as_posix()} {remote_conan} profile detect", stdout=stdout, stderr=stderr) - + conf_content = f"core.cache:storage_path={self.remote_conan_cache}\n" if self.shared_cache else "" with tempfile.TemporaryDirectory() as tmp: global_conf = os.path.join(tmp, "global.conf") @@ -117,7 +117,7 @@ def ensure_runner_environment(self): global_conf_wsl = subsystem_path("wsl", global_conf) remote_global_conf = self.remote_conan_home.joinpath("global.conf") conan_run(f"wsl.exe cp {global_conf_wsl} {remote_global_conf}") - + self._copy_profiles() def _copy_profiles(self): @@ -137,7 +137,7 @@ def _copy_profiles(self): save(None, path=outfile, content=contents) outfile_wsl = subsystem_path("wsl", outfile) remote_profile = self.remote_conan_home.joinpath("profiles").as_posix() + "/" - + # This works but copies the file with executable attribute conan_run(f"wsl.exe cp {outfile_wsl} {remote_profile}") diff --git a/conan/test/utils/artifactory.py b/conan/test/utils/artifactory.py index b3ab0fbe864..11e62ca0a53 100644 --- a/conan/test/utils/artifactory.py +++ b/conan/test/utils/artifactory.py @@ -4,7 +4,7 @@ import requests -from conans.errors import RecipeNotFoundException, PackageNotFoundException +from conan.internal.errors import RecipeNotFoundException, PackageNotFoundException from conans.server.revision_list import _RevisionEntry ARTIFACTORY_DEFAULT_USER = os.getenv("ARTIFACTORY_DEFAULT_USER", "admin") diff --git a/conan/test/utils/mocks.py b/conan/test/utils/mocks.py index bfed795b61b..acdb379c032 100644 --- a/conan/test/utils/mocks.py +++ b/conan/test/utils/mocks.py @@ -3,7 +3,7 @@ from conan import ConanFile from conan.internal.conan_app import ConanFileHelpers -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conf import Conf from conans.model.layout import Folders, Infos from conans.model.options import Options diff --git a/conan/test/utils/test_files.py b/conan/test/utils/test_files.py index fa88b3bf2e2..d45701752c3 100644 --- a/conan/test/utils/test_files.py +++ b/conan/test/utils/test_files.py @@ -10,7 +10,7 @@ from conan.tools.files.files import untargz from conans.client.subsystems import get_cased_path -from conans.errors import ConanException +from conan.errors import ConanException from conan.internal.paths import PACKAGE_TGZ_NAME from conans.util.files import gzopen_without_timestamps diff --git a/conan/test/utils/tools.py b/conan/test/utils/tools.py index a1f98a39a90..f86cc8ce3a7 100644 --- a/conan/test/utils/tools.py +++ b/conan/test/utils/tools.py @@ -32,7 +32,8 @@ from conan.api.model import Remote from conan.cli.cli import Cli, _CONAN_INTERNAL_CUSTOM_COMMANDS_PATH from conan.test.utils.env import environment_update -from conans.errors import NotFoundException, ConanException +from conan.internal.errors import NotFoundException +from conan.errors import ConanException from conans.model.manifest import FileTreeManifest from conans.model.package_ref import PkgReference from conans.model.profile import Profile diff --git a/conan/tools/cmake/cmakedeps/templates/config_version.py b/conan/tools/cmake/cmakedeps/templates/config_version.py index 8fdaa234c57..db42be948a7 100644 --- a/conan/tools/cmake/cmakedeps/templates/config_version.py +++ b/conan/tools/cmake/cmakedeps/templates/config_version.py @@ -1,7 +1,7 @@ import textwrap from conan.tools.cmake.cmakedeps.templates import CMakeDepsFileTemplate -from conans.errors import ConanException +from conan.errors import ConanException """ foo-config-version.cmake diff --git a/conan/tools/files/copy_pattern.py b/conan/tools/files/copy_pattern.py index ef0796da0ff..93de39d1eac 100644 --- a/conan/tools/files/copy_pattern.py +++ b/conan/tools/files/copy_pattern.py @@ -3,7 +3,7 @@ import os import shutil -from conans.errors import ConanException +from conan.errors import ConanException from conans.util.files import mkdir diff --git a/conan/tools/gnu/gnutoolchain.py b/conan/tools/gnu/gnutoolchain.py index d154f1cfbf7..96d90db0df0 100644 --- a/conan/tools/gnu/gnutoolchain.py +++ b/conan/tools/gnu/gnutoolchain.py @@ -11,7 +11,7 @@ from conan.tools.env import Environment from conan.tools.gnu.get_gnu_triplet import _get_gnu_triplet from conan.tools.microsoft import VCVars, msvc_runtime_flag, unix_path, check_min_vs, is_msvc -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.pkg_type import PackageType diff --git a/conans/client/conanfile/build.py b/conans/client/conanfile/build.py index 9a69809b644..743be2885e6 100644 --- a/conans/client/conanfile/build.py +++ b/conans/client/conanfile/build.py @@ -1,4 +1,4 @@ -from conans.errors import conanfile_exception_formatter +from conan.internal.errors import conanfile_exception_formatter from conans.util.files import chdir, mkdir diff --git a/conans/client/conanfile/configure.py b/conans/client/conanfile/configure.py index 4b0aa99f1eb..bf99cb0e7f8 100644 --- a/conans/client/conanfile/configure.py +++ b/conans/client/conanfile/configure.py @@ -1,4 +1,4 @@ -from conans.errors import conanfile_exception_formatter +from conan.internal.errors import conanfile_exception_formatter from conans.model.pkg_type import PackageType from conans.model.requires import BuildRequirements, TestRequirements, ToolRequirements from conans.client.conanfile.implementations import auto_shared_fpic_config_options, \ diff --git a/conans/client/conanfile/package.py b/conans/client/conanfile/package.py index 12745e6bd3d..dd90d313879 100644 --- a/conans/client/conanfile/package.py +++ b/conans/client/conanfile/package.py @@ -1,7 +1,8 @@ import os from conan.api.output import ConanOutput -from conans.errors import ConanException, conanfile_exception_formatter, conanfile_remove_attr +from conan.internal.errors import conanfile_remove_attr, conanfile_exception_formatter +from conan.errors import ConanException from conans.model.manifest import FileTreeManifest from conans.model.package_ref import PkgReference from conan.internal.paths import CONANINFO diff --git a/conans/client/downloaders/caching_file_downloader.py b/conans/client/downloaders/caching_file_downloader.py index e6921e15474..dc6f7f039d2 100644 --- a/conans/client/downloaders/caching_file_downloader.py +++ b/conans/client/downloaders/caching_file_downloader.py @@ -8,8 +8,8 @@ from conan.internal.cache.home_paths import HomePaths from conans.client.downloaders.file_downloader import FileDownloader from conans.client.downloaders.download_cache import DownloadCache -from conans.errors import NotFoundException, ConanException, AuthenticationException, \ - ForbiddenException +from conan.internal.errors import AuthenticationException, ForbiddenException, NotFoundException +from conan.errors import ConanException from conans.util.files import mkdir, set_dirty_context_manager, remove_if_dirty, human_size diff --git a/conans/client/downloaders/download_cache.py b/conans/client/downloaders/download_cache.py index fb3e1663146..f38b3274634 100644 --- a/conans/client/downloaders/download_cache.py +++ b/conans/client/downloaders/download_cache.py @@ -4,7 +4,7 @@ from contextlib import contextmanager from threading import Lock -from conans.errors import ConanException +from conan.errors import ConanException from conans.util.dates import timestamp_now from conans.util.files import load, save, remove_if_dirty from conans.util.locks import simple_lock diff --git a/conans/client/downloaders/file_downloader.py b/conans/client/downloaders/file_downloader.py index 196a21005e1..19ac00b400c 100644 --- a/conans/client/downloaders/file_downloader.py +++ b/conans/client/downloaders/file_downloader.py @@ -5,8 +5,9 @@ from conan.api.output import ConanOutput, TimedOutput from conans.client.rest import response_to_str -from conans.errors import ConanException, NotFoundException, AuthenticationException, \ - ForbiddenException, ConanConnectionError, RequestErrorException +from conan.internal.errors import ConanConnectionError, RequestErrorException, AuthenticationException, \ + ForbiddenException, NotFoundException +from conan.errors import ConanException from conans.util.files import human_size, check_with_algorithm_sum diff --git a/conans/client/graph/build_mode.py b/conans/client/graph/build_mode.py index 8efbd99da3b..52d7e37c880 100644 --- a/conans/client/graph/build_mode.py +++ b/conans/client/graph/build_mode.py @@ -1,4 +1,4 @@ -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import ref_matches diff --git a/conans/client/graph/compatibility.py b/conans/client/graph/compatibility.py index 4961c28c0dd..85e61550259 100644 --- a/conans/client/graph/compatibility.py +++ b/conans/client/graph/compatibility.py @@ -4,7 +4,8 @@ from conan.internal.cache.home_paths import HomePaths from conans.client.graph.compute_pid import run_validate_package_id from conans.client.loader import load_python_file -from conans.errors import conanfile_exception_formatter, ConanException, scoped_traceback +from conan.internal.errors import conanfile_exception_formatter, scoped_traceback +from conan.errors import ConanException # TODO: Define other compatibility besides applications _default_compat = """\ diff --git a/conans/client/graph/compute_pid.py b/conans/client/graph/compute_pid.py index 4ba62318550..9aa690bb908 100644 --- a/conans/client/graph/compute_pid.py +++ b/conans/client/graph/compute_pid.py @@ -1,7 +1,7 @@ from collections import OrderedDict -from conans.errors import conanfile_exception_formatter, ConanInvalidConfiguration, \ - conanfile_remove_attr, ConanException +from conan.internal.errors import conanfile_remove_attr, conanfile_exception_formatter +from conan.errors import ConanException, ConanInvalidConfiguration from conans.model.info import ConanInfo, RequirementsInfo, RequirementInfo, PythonRequiresInfo from conans.client.conanfile.implementations import auto_header_only_package_id diff --git a/conans/client/graph/graph_binaries.py b/conans/client/graph/graph_binaries.py index 3fae7fc3ee9..7d1438540de 100644 --- a/conans/client/graph/graph_binaries.py +++ b/conans/client/graph/graph_binaries.py @@ -13,8 +13,9 @@ BINARY_INVALID, BINARY_EDITABLE_BUILD, RECIPE_PLATFORM, BINARY_PLATFORM) from conans.client.graph.proxy import should_update_reference -from conans.errors import NotFoundException, \ - PackageNotFoundException, conanfile_exception_formatter, ConanConnectionError, ConanException +from conan.internal.errors import conanfile_exception_formatter, ConanConnectionError, NotFoundException, \ + PackageNotFoundException +from conan.errors import ConanException from conans.model.info import RequirementInfo, RequirementsInfo from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference diff --git a/conans/client/graph/graph_builder.py b/conans/client/graph/graph_builder.py index a442fa4a135..4a8f8d15da9 100644 --- a/conans/client/graph/graph_builder.py +++ b/conans/client/graph/graph_builder.py @@ -11,7 +11,7 @@ GraphRuntimeError, GraphError from conans.client.graph.profile_node_definer import initialize_conanfile_profile from conans.client.graph.provides import check_graph_provides -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conan_file import ConanFile from conans.model.options import Options, _PackageOptions from conans.model.pkg_type import PackageType diff --git a/conans/client/graph/graph_error.py b/conans/client/graph/graph_error.py index a438b87be41..d04373ae19e 100644 --- a/conans/client/graph/graph_error.py +++ b/conans/client/graph/graph_error.py @@ -1,4 +1,4 @@ -from conans.errors import ConanException +from conan.errors import ConanException class GraphError(ConanException): diff --git a/conans/client/graph/install_graph.py b/conans/client/graph/install_graph.py index 63221cc3238..d51f9082c8f 100644 --- a/conans/client/graph/install_graph.py +++ b/conans/client/graph/install_graph.py @@ -5,7 +5,7 @@ from conan.api.output import ConanOutput from conans.client.graph.graph import RECIPE_CONSUMER, RECIPE_VIRTUAL, BINARY_SKIP, \ BINARY_MISSING, BINARY_INVALID, Overrides, BINARY_BUILD, BINARY_EDITABLE_BUILD, BINARY_PLATFORM -from conans.errors import ConanInvalidConfiguration, ConanException +from conan.errors import ConanException, ConanInvalidConfiguration from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference from conans.util.files import load diff --git a/conans/client/graph/profile_node_definer.py b/conans/client/graph/profile_node_definer.py index 2b905ef0c64..fb4c4a4a4be 100644 --- a/conans/client/graph/profile_node_definer.py +++ b/conans/client/graph/profile_node_definer.py @@ -1,5 +1,5 @@ from conans.client.graph.graph import CONTEXT_BUILD -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import ref_matches diff --git a/conans/client/graph/proxy.py b/conans/client/graph/proxy.py index 1621176b618..d7a364f976d 100644 --- a/conans/client/graph/proxy.py +++ b/conans/client/graph/proxy.py @@ -3,7 +3,8 @@ from conans.client.graph.graph import (RECIPE_DOWNLOADED, RECIPE_INCACHE, RECIPE_NEWER, RECIPE_NOT_IN_REMOTE, RECIPE_UPDATED, RECIPE_EDITABLE, RECIPE_INCACHE_DATE_UPDATED, RECIPE_UPDATEABLE) -from conans.errors import ConanException, NotFoundException +from conan.internal.errors import NotFoundException +from conan.errors import ConanException class ConanProxy: diff --git a/conans/client/graph/python_requires.py b/conans/client/graph/python_requires.py index a861e53df44..b9542ef5f33 100644 --- a/conans/client/graph/python_requires.py +++ b/conans/client/graph/python_requires.py @@ -1,6 +1,6 @@ import os -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference from conans.model.requires import Requirement diff --git a/conans/client/graph/range_resolver.py b/conans/client/graph/range_resolver.py index 31df11c37d7..bd21c44d1c1 100644 --- a/conans/client/graph/range_resolver.py +++ b/conans/client/graph/range_resolver.py @@ -1,5 +1,5 @@ from conans.client.graph.proxy import should_update_reference -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference from conans.model.version_range import VersionRange diff --git a/conans/client/hook_manager.py b/conans/client/hook_manager.py index 2df571f4204..d213b209d95 100644 --- a/conans/client/hook_manager.py +++ b/conans/client/hook_manager.py @@ -1,7 +1,7 @@ import os from conans.client.loader import load_python_file -from conans.errors import ConanException +from conan.errors import ConanException valid_hook_methods = ["pre_export", "post_export", "pre_source", "post_source", diff --git a/conans/client/installer.py b/conans/client/installer.py index b2937dda895..bdeb24efe63 100644 --- a/conans/client/installer.py +++ b/conans/client/installer.py @@ -10,7 +10,8 @@ BINARY_UPDATE, BINARY_EDITABLE_BUILD, BINARY_SKIP from conans.client.graph.install_graph import InstallGraph from conans.client.source import retrieve_exports_sources, config_source -from conans.errors import (ConanException, conanfile_exception_formatter, conanfile_remove_attr) +from conan.internal.errors import conanfile_remove_attr, conanfile_exception_formatter +from conan.errors import ConanException from conans.model.build_info import CppInfo, MockInfoProperty from conans.model.package_ref import PkgReference from conan.internal.paths import CONANINFO diff --git a/conans/client/loader.py b/conans/client/loader.py index c5760f68cf3..ecad2857272 100644 --- a/conans/client/loader.py +++ b/conans/client/loader.py @@ -16,7 +16,8 @@ from conan.tools.google import bazel_layout from conan.tools.microsoft import vs_layout from conans.client.loader_txt import ConanFileTextLoader -from conans.errors import ConanException, NotFoundException, conanfile_exception_formatter +from conan.internal.errors import conanfile_exception_formatter, NotFoundException +from conan.errors import ConanException from conans.model.conan_file import ConanFile from conans.model.options import Options from conans.model.recipe_ref import RecipeReference diff --git a/conans/client/loader_txt.py b/conans/client/loader_txt.py index 3e33e06f9c1..10e70b3eafc 100644 --- a/conans/client/loader_txt.py +++ b/conans/client/loader_txt.py @@ -1,4 +1,4 @@ -from conans.errors import ConanException +from conan.errors import ConanException from conans.util.config_parser import ConfigParser diff --git a/conans/client/remote_manager.py b/conans/client/remote_manager.py index 9aea240a685..e5d2defd752 100644 --- a/conans/client/remote_manager.py +++ b/conans/client/remote_manager.py @@ -10,8 +10,8 @@ from conan.api.output import ConanOutput from conan.internal.cache.conan_reference_layout import METADATA from conans.client.pkg_sign import PkgSignaturesPlugin -from conans.errors import ConanConnectionError, ConanException, NotFoundException, \ - PackageNotFoundException +from conan.internal.errors import ConanConnectionError, NotFoundException, PackageNotFoundException +from conan.errors import ConanException from conans.model.info import load_binary_info from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference diff --git a/conans/client/rest/auth_manager.py b/conans/client/rest/auth_manager.py index e241e9f8b91..e67745ba8e4 100644 --- a/conans/client/rest/auth_manager.py +++ b/conans/client/rest/auth_manager.py @@ -14,7 +14,8 @@ from conan.api.output import ConanOutput from conans.client.rest.remote_credentials import RemoteCredentials from conans.client.rest.rest_client import RestApiClient -from conans.errors import AuthenticationException, ConanException, ForbiddenException +from conan.internal.errors import AuthenticationException, ForbiddenException +from conan.errors import ConanException LOGIN_RETRIES = 3 diff --git a/conans/client/rest/conan_requester.py b/conans/client/rest/conan_requester.py index 73974a79c4e..7b7762c7c9c 100644 --- a/conans/client/rest/conan_requester.py +++ b/conans/client/rest/conan_requester.py @@ -13,7 +13,8 @@ from conans import __version__ as client_version from conans.client.loader import load_python_file -from conans.errors import ConanException, scoped_traceback +from conan.internal.errors import scoped_traceback +from conan.errors import ConanException # Capture SSL warnings as pointed out here: # https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning diff --git a/conans/client/rest/file_uploader.py b/conans/client/rest/file_uploader.py index 1eadc2e6ecc..13dd9255f58 100644 --- a/conans/client/rest/file_uploader.py +++ b/conans/client/rest/file_uploader.py @@ -3,8 +3,9 @@ from conan.api.output import ConanOutput, TimedOutput from conans.client.rest import response_to_str -from conans.errors import AuthenticationException, ConanException, \ - NotFoundException, ForbiddenException, RequestErrorException, InternalErrorException +from conan.internal.errors import InternalErrorException, RequestErrorException, AuthenticationException, \ + ForbiddenException, NotFoundException +from conan.errors import ConanException from conans.util.files import sha1sum diff --git a/conans/client/rest/remote_credentials.py b/conans/client/rest/remote_credentials.py index ad001a5767f..c1107f192b9 100644 --- a/conans/client/rest/remote_credentials.py +++ b/conans/client/rest/remote_credentials.py @@ -9,7 +9,8 @@ from conans.client.loader import load_python_file from conan.api.output import ConanOutput from conans.client.userio import UserInput -from conans.errors import ConanException, scoped_traceback +from conan.internal.errors import scoped_traceback +from conan.errors import ConanException from conans.util.files import load diff --git a/conans/client/rest/rest_client.py b/conans/client/rest/rest_client.py index e2dcf1714ef..27099a3f09e 100644 --- a/conans/client/rest/rest_client.py +++ b/conans/client/rest/rest_client.py @@ -1,6 +1,6 @@ from conans import CHECKSUM_DEPLOY, REVISIONS from conans.client.rest.rest_client_v2 import RestV2Methods -from conans.errors import ConanException +from conan.errors import ConanException class RestApiClient: diff --git a/conans/client/rest/rest_client_v2.py b/conans/client/rest/rest_client_v2.py index b5b74255e68..e4ffe9a8234 100644 --- a/conans/client/rest/rest_client_v2.py +++ b/conans/client/rest/rest_client_v2.py @@ -13,8 +13,9 @@ from conans.client.rest import response_to_str from conans.client.rest.client_routes import ClientV2Router from conans.client.rest.file_uploader import FileUploader -from conans.errors import ConanException, NotFoundException, PackageNotFoundException, \ - RecipeNotFoundException, AuthenticationException, ForbiddenException, EXCEPTION_CODE_MAPPING +from conan.internal.errors import AuthenticationException, ForbiddenException, NotFoundException, \ + RecipeNotFoundException, PackageNotFoundException, EXCEPTION_CODE_MAPPING +from conan.errors import ConanException from conans.model.package_ref import PkgReference from conan.internal.paths import EXPORT_SOURCES_TGZ_NAME from conans.model.recipe_ref import RecipeReference diff --git a/conans/client/rest_client_local_recipe_index.py b/conans/client/rest_client_local_recipe_index.py index 39de3550866..2514b091d54 100644 --- a/conans/client/rest_client_local_recipe_index.py +++ b/conans/client/rest_client_local_recipe_index.py @@ -11,8 +11,9 @@ from conan.internal.cache.home_paths import HomePaths from conan.internal.api.export import cmd_export from conans.client.loader import ConanFileLoader -from conans.errors import ConanException, PackageNotFoundException, RecipeNotFoundException, \ - ConanReferenceDoesNotExistInDB, NotFoundException +from conan.internal.errors import ConanReferenceDoesNotExistInDB, NotFoundException, RecipeNotFoundException, \ + PackageNotFoundException +from conan.errors import ConanException from conans.model.conf import ConfDefinition from conans.model.recipe_ref import RecipeReference from conans.util.files import load, save, rmdir, copytree_compat diff --git a/conans/client/source.py b/conans/client/source.py index 6c761724286..9b0aee5b04e 100644 --- a/conans/client/source.py +++ b/conans/client/source.py @@ -2,8 +2,8 @@ from conan.api.output import ConanOutput from conan.tools.env import VirtualBuildEnv -from conans.errors import ConanException, conanfile_exception_formatter, NotFoundException, \ - conanfile_remove_attr +from conan.internal.errors import conanfile_remove_attr, conanfile_exception_formatter, NotFoundException +from conan.errors import ConanException from conans.util.files import (is_dirty, mkdir, rmdir, set_dirty_context_manager, merge_directories, clean_dirty, chdir) diff --git a/conans/client/subsystems.py b/conans/client/subsystems.py index 39654b14719..e5fe65eaf37 100644 --- a/conans/client/subsystems.py +++ b/conans/client/subsystems.py @@ -24,7 +24,7 @@ import re from conan.tools.build import cmd_args_to_string -from conans.errors import ConanException +from conan.errors import ConanException WINDOWS = "windows" MSYS2 = 'msys2' diff --git a/conans/client/userio.py b/conans/client/userio.py index 33c9628ff49..bb1175e3dd1 100644 --- a/conans/client/userio.py +++ b/conans/client/userio.py @@ -2,7 +2,7 @@ import os import sys -from conans.errors import ConanException +from conan.errors import ConanException def is_terminal(stream): diff --git a/conans/migrations.py b/conans/migrations.py index c455a0bb42b..b47d8a6ef76 100644 --- a/conans/migrations.py +++ b/conans/migrations.py @@ -3,7 +3,7 @@ from conan import conan_version from conan.api.output import ConanOutput from conans.client.loader import load_python_file -from conans.errors import ConanException, ConanMigrationError +from conan.errors import ConanException, ConanMigrationError from conans.model.version import Version from conans.util.files import load, save diff --git a/conans/model/build_info.py b/conans/model/build_info.py index b392c7f5547..938a64d0efc 100644 --- a/conans/model/build_info.py +++ b/conans/model/build_info.py @@ -4,7 +4,7 @@ from collections import OrderedDict, defaultdict from conan.api.output import ConanOutput -from conans.errors import ConanException +from conan.errors import ConanException from conans.util.files import load, save _DIRS_VAR_NAMES = ["_includedirs", "_srcdirs", "_libdirs", "_resdirs", "_bindirs", "_builddirs", diff --git a/conans/model/conan_file.py b/conans/model/conan_file.py index 50cecb9b01e..f61cee57d38 100644 --- a/conans/model/conan_file.py +++ b/conans/model/conan_file.py @@ -3,7 +3,7 @@ from conan.api.output import ConanOutput, Color from conans.client.subsystems import command_env_wrapper -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.build_info import MockInfoProperty from conans.model.conf import Conf from conans.model.dependencies import ConanFileDependencies diff --git a/conans/model/conf.py b/conans/model/conf.py index bd5da94e7dd..15be356a1ec 100644 --- a/conans/model/conf.py +++ b/conans/model/conf.py @@ -6,7 +6,7 @@ from collections import OrderedDict -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import ref_matches BUILT_IN_CONFS = { diff --git a/conans/model/dependencies.py b/conans/model/dependencies.py index a2734b5e874..44a52125b1d 100644 --- a/conans/model/dependencies.py +++ b/conans/model/dependencies.py @@ -1,7 +1,7 @@ from collections import OrderedDict from conans.client.graph.graph import RECIPE_PLATFORM -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference from conans.model.conanfile_interface import ConanFileInterface diff --git a/conans/model/graph_lock.py b/conans/model/graph_lock.py index e3c3fa9dcb8..b6272acc084 100644 --- a/conans/model/graph_lock.py +++ b/conans/model/graph_lock.py @@ -5,7 +5,7 @@ from conan.api.output import ConanOutput from conans.client.graph.graph import RECIPE_VIRTUAL, RECIPE_CONSUMER, CONTEXT_BUILD, Overrides -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference from conans.model.version_range import VersionRange from conans.util.files import load, save diff --git a/conans/model/info.py b/conans/model/info.py index 630f1310427..c22c310139e 100644 --- a/conans/model/info.py +++ b/conans/model/info.py @@ -1,6 +1,6 @@ import hashlib -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.dependencies import UserRequirementsDict from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference, Version diff --git a/conans/model/options.py b/conans/model/options.py index cbf6eaf83da..82ce0ba753b 100644 --- a/conans/model/options.py +++ b/conans/model/options.py @@ -1,4 +1,4 @@ -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import ref_matches _falsey_options = ["false", "none", "0", "off", ""] diff --git a/conans/model/package_ref.py b/conans/model/package_ref.py index da1ea5e0b7e..2980f71a281 100644 --- a/conans/model/package_ref.py +++ b/conans/model/package_ref.py @@ -1,4 +1,4 @@ -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference from conans.util.dates import timestamp_to_str diff --git a/conans/model/pkg_type.py b/conans/model/pkg_type.py index 5d51d0488a3..29c207952c5 100644 --- a/conans/model/pkg_type.py +++ b/conans/model/pkg_type.py @@ -1,6 +1,6 @@ from enum import Enum -from conans.errors import ConanException +from conan.errors import ConanException class PackageType(Enum): diff --git a/conans/model/recipe_ref.py b/conans/model/recipe_ref.py index ca58c598411..6165ec4c9c1 100644 --- a/conans/model/recipe_ref.py +++ b/conans/model/recipe_ref.py @@ -3,7 +3,7 @@ import re from functools import total_ordering -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.version import Version from conans.util.dates import timestamp_to_str @@ -120,7 +120,7 @@ def loads(rref): user = channel = None return RecipeReference(name, version, user, channel, revision, timestamp) except Exception: - from conans.errors import ConanException + from conan.errors import ConanException raise ConanException( f"{rref} is not a valid recipe reference, provide a reference" f" in the form name/version[@user/channel]") diff --git a/conans/model/requires.py b/conans/model/requires.py index 7b312b40ee0..d9a9dbc7646 100644 --- a/conans/model/requires.py +++ b/conans/model/requires.py @@ -1,6 +1,6 @@ from collections import OrderedDict -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.pkg_type import PackageType from conans.model.recipe_ref import RecipeReference from conans.model.version_range import VersionRange diff --git a/conans/model/settings.py b/conans/model/settings.py index 2c56f7a3841..ed1c1ef42c6 100644 --- a/conans/model/settings.py +++ b/conans/model/settings.py @@ -1,7 +1,7 @@ import yaml from conan.internal.internal_tools import is_universal_arch -from conans.errors import ConanException +from conan.errors import ConanException def bad_value_msg(name, value, value_range): diff --git a/conans/model/version.py b/conans/model/version.py index 42d866b4361..dd87b3586c5 100644 --- a/conans/model/version.py +++ b/conans/model/version.py @@ -1,6 +1,6 @@ from functools import total_ordering -from conans.errors import ConanException +from conan.errors import ConanException @total_ordering diff --git a/conans/model/version_range.py b/conans/model/version_range.py index 838d8e5ae6e..ee4e5906ca5 100644 --- a/conans/model/version_range.py +++ b/conans/model/version_range.py @@ -1,7 +1,7 @@ from functools import total_ordering from typing import Optional -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import Version from conans import __version__ as client_version diff --git a/conans/server/conf/__init__.py b/conans/server/conf/__init__.py index 44a4e4029fa..a70911ec8ce 100644 --- a/conans/server/conf/__init__.py +++ b/conans/server/conf/__init__.py @@ -8,7 +8,7 @@ from datetime import timedelta from configparser import ConfigParser, NoSectionError -from conans.errors import ConanException +from conan.errors import ConanException from conans.server.conf.default_server_conf import default_server_conf from conans.server.store.disk_adapter import ServerDiskAdapter from conans.server.store.server_store import ServerStore diff --git a/conans/server/rest/api_v2.py b/conans/server/rest/api_v2.py index 680f20ff42a..f4e5ec86609 100644 --- a/conans/server/rest/api_v2.py +++ b/conans/server/rest/api_v2.py @@ -1,6 +1,6 @@ from bottle import Bottle -from conans.errors import EXCEPTION_CODE_MAPPING +from conan.internal.errors import EXCEPTION_CODE_MAPPING from conans.server.rest.bottle_plugins.http_basic_authentication import HttpBasicAuthentication from conans.server.rest.bottle_plugins.jwt_authentication import JWTAuthentication from conans.server.rest.bottle_plugins.return_handler import ReturnHandlerPlugin diff --git a/conans/server/rest/bottle_plugins/return_handler.py b/conans/server/rest/bottle_plugins/return_handler.py index 5ae25971c64..31d75c814b8 100644 --- a/conans/server/rest/bottle_plugins/return_handler.py +++ b/conans/server/rest/bottle_plugins/return_handler.py @@ -1,6 +1,6 @@ from bottle import HTTPResponse -from conans.errors import ConanException +from conan.errors import ConanException class ReturnHandlerPlugin(object): diff --git a/conans/server/rest/controller/v2/conan.py b/conans/server/rest/controller/v2/conan.py index 4d1594a971b..29c80770ac3 100644 --- a/conans/server/rest/controller/v2/conan.py +++ b/conans/server/rest/controller/v2/conan.py @@ -1,6 +1,6 @@ from bottle import request -from conans.errors import NotFoundException +from conan.internal.errors import NotFoundException from conans.model.recipe_ref import RecipeReference from conans.server.rest.bottle_routes import BottleRoutes from conans.server.rest.controller.v2 import get_package_ref diff --git a/conans/server/rest/controller/v2/users.py b/conans/server/rest/controller/v2/users.py index 30f3624d044..378df02f1d0 100644 --- a/conans/server/rest/controller/v2/users.py +++ b/conans/server/rest/controller/v2/users.py @@ -1,6 +1,6 @@ from bottle import response -from conans.errors import AuthenticationException +from conan.internal.errors import AuthenticationException from conans.server.rest.bottle_routes import BottleRoutes from conans.server.service.user_service import UserService diff --git a/conans/server/service/authorize.py b/conans/server/service/authorize.py index 7a40300b120..a6ce3df90d6 100644 --- a/conans/server/service/authorize.py +++ b/conans/server/service/authorize.py @@ -11,8 +11,7 @@ from abc import ABCMeta, abstractmethod -from conans.errors import AuthenticationException, ForbiddenException, InternalErrorException - +from conan.internal.errors import InternalErrorException, AuthenticationException, ForbiddenException # ############################################ # ############ ABSTRACT CLASSES ############## diff --git a/conans/server/service/user_service.py b/conans/server/service/user_service.py index 623e0c8758c..e4e58fd062e 100644 --- a/conans/server/service/user_service.py +++ b/conans/server/service/user_service.py @@ -1,4 +1,4 @@ -from conans.errors import AuthenticationException +from conan.internal.errors import AuthenticationException class UserService(object): diff --git a/conans/server/service/v2/search.py b/conans/server/service/v2/search.py index d4ce88a32c3..66a69c8e08e 100644 --- a/conans/server/service/v2/search.py +++ b/conans/server/service/v2/search.py @@ -3,7 +3,7 @@ import re from fnmatch import translate -from conans.errors import ForbiddenException, RecipeNotFoundException +from conan.internal.errors import ForbiddenException, RecipeNotFoundException from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference from conan.internal.paths import CONANINFO diff --git a/conans/server/service/v2/service_v2.py b/conans/server/service/v2/service_v2.py index be37b5d68ec..a7c0f158b55 100644 --- a/conans/server/service/v2/service_v2.py +++ b/conans/server/service/v2/service_v2.py @@ -3,7 +3,7 @@ from bottle import FileUpload, static_file -from conans.errors import RecipeNotFoundException, PackageNotFoundException, NotFoundException +from conan.internal.errors import NotFoundException, RecipeNotFoundException, PackageNotFoundException from conan.internal.paths import CONAN_MANIFEST from conans.model.package_ref import PkgReference from conans.server.service.mime import get_mime_type diff --git a/conans/server/store/disk_adapter.py b/conans/server/store/disk_adapter.py index 941d1fe8be2..30b3a308ec9 100644 --- a/conans/server/store/disk_adapter.py +++ b/conans/server/store/disk_adapter.py @@ -3,7 +3,7 @@ import fasteners -from conans.errors import NotFoundException +from conan.internal.errors import NotFoundException from conans.util.files import md5sum, rmdir from conans.server.utils.files import path_exists, relative_dirs diff --git a/conans/server/store/server_store.py b/conans/server/store/server_store.py index e79e956a3ae..8f3fb78432f 100644 --- a/conans/server/store/server_store.py +++ b/conans/server/store/server_store.py @@ -1,7 +1,8 @@ import os from os.path import join, normpath, relpath -from conans.errors import ConanException, PackageNotFoundException, RecipeNotFoundException +from conan.internal.errors import RecipeNotFoundException, PackageNotFoundException +from conan.errors import ConanException from conan.internal.paths import CONAN_MANIFEST from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference diff --git a/conans/util/config_parser.py b/conans/util/config_parser.py index 9c526379d63..3b2b98c1d58 100644 --- a/conans/util/config_parser.py +++ b/conans/util/config_parser.py @@ -1,6 +1,6 @@ import re -from conans.errors import ConanException +from conan.errors import ConanException class ConfigParser(object): diff --git a/conans/util/dates.py b/conans/util/dates.py index 1881326af77..9e01c667bcf 100644 --- a/conans/util/dates.py +++ b/conans/util/dates.py @@ -4,7 +4,7 @@ from dateutil import parser -from conans.errors import ConanException +from conan.errors import ConanException def from_timestamp_to_iso8601(timestamp): diff --git a/conans/util/files.py b/conans/util/files.py index a47d95301fd..fd03715ee08 100644 --- a/conans/util/files.py +++ b/conans/util/files.py @@ -11,8 +11,7 @@ from contextlib import contextmanager - -from conans.errors import ConanException +from conan.errors import ConanException _DIRTY_FOLDER = ".dirty" diff --git a/conans/util/runners.py b/conans/util/runners.py index 434bee38ed5..219d0f9eece 100644 --- a/conans/util/runners.py +++ b/conans/util/runners.py @@ -5,7 +5,7 @@ from contextlib import contextmanager from io import StringIO -from conans.errors import ConanException +from conan.errors import ConanException from conans.util.files import load diff --git a/test/functional/revisions_test.py b/test/functional/revisions_test.py index bf052ca71b7..35387d956eb 100644 --- a/test/functional/revisions_test.py +++ b/test/functional/revisions_test.py @@ -7,7 +7,7 @@ from mock import patch from conan.test.utils.env import environment_update -from conans.errors import RecipeNotFoundException +from conan.internal.errors import RecipeNotFoundException from conans.model.recipe_ref import RecipeReference from conans.server.revision_list import RevisionList from conan.test.utils.tools import TestServer, TurboTestClient, GenConanfile, TestClient diff --git a/test/functional/util/tools_test.py b/test/functional/util/tools_test.py index b89fc1c583c..c73fa55117f 100644 --- a/test/functional/util/tools_test.py +++ b/test/functional/util/tools_test.py @@ -6,7 +6,7 @@ import pytest from conan.internal.api.detect.detect_vs import vswhere -from conans.errors import ConanException +from conan.errors import ConanException from conan.test.utils.env import environment_update diff --git a/test/integration/cache/backup_sources_test.py b/test/integration/cache/backup_sources_test.py index 5c72e660976..63c539acfef 100644 --- a/test/integration/cache/backup_sources_test.py +++ b/test/integration/cache/backup_sources_test.py @@ -6,7 +6,8 @@ import pytest from bottle import static_file, HTTPError, request -from conans.errors import NotFoundException, ConanException +from conan.internal.errors import NotFoundException +from conan.errors import ConanException from conan.test.utils.file_server import TestFileServer from conan.test.utils.test_files import temp_folder from conan.test.utils.tools import TestClient, StoppableThreadBottle diff --git a/test/integration/command/remove_test.py b/test/integration/command/remove_test.py index f227ea509d4..c8b7bfee474 100644 --- a/test/integration/command/remove_test.py +++ b/test/integration/command/remove_test.py @@ -5,7 +5,7 @@ import pytest from conan.api.conan_api import ConanAPI -from conans.errors import NotFoundException +from conan.internal.errors import NotFoundException from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference from conan.test.utils.tools import NO_SETTINGS_PACKAGE_ID, TestClient, TestServer, GenConanfile diff --git a/test/integration/command/upload/upload_test.py b/test/integration/command/upload/upload_test.py index a370084357a..926d0dce71a 100644 --- a/test/integration/command/upload/upload_test.py +++ b/test/integration/command/upload/upload_test.py @@ -10,7 +10,7 @@ from mock import patch from requests import Response -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference from conan.internal.paths import EXPORT_SOURCES_TGZ_NAME, PACKAGE_TGZ_NAME diff --git a/test/integration/command_v2/list_test.py b/test/integration/command_v2/list_test.py index 63b167b9289..54292f69c0f 100644 --- a/test/integration/command_v2/list_test.py +++ b/test/integration/command_v2/list_test.py @@ -8,7 +8,8 @@ import pytest -from conans.errors import ConanException, ConanConnectionError +from conan.internal.errors import ConanConnectionError +from conan.errors import ConanException from conan.test.assets.genconanfile import GenConanfile from conan.test.utils.tools import TestClient, TestServer, NO_SETTINGS_PACKAGE_ID from conan.test.utils.env import environment_update diff --git a/test/integration/command_v2/search_test.py b/test/integration/command_v2/search_test.py index 352c86771bd..6d6ae26b300 100644 --- a/test/integration/command_v2/search_test.py +++ b/test/integration/command_v2/search_test.py @@ -4,7 +4,8 @@ import pytest -from conans.errors import ConanConnectionError, ConanException +from conan.internal.errors import ConanConnectionError +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference from conan.test.assets.genconanfile import GenConanfile from conan.test.utils.tools import TestClient, TestServer diff --git a/test/integration/configuration/required_version_test.py b/test/integration/configuration/required_version_test.py index eb69db7cba1..58714e856e2 100644 --- a/test/integration/configuration/required_version_test.py +++ b/test/integration/configuration/required_version_test.py @@ -3,7 +3,7 @@ import mock from conans import __version__ -from conans.errors import ConanException +from conan.errors import ConanException from conan.test.utils.test_files import temp_folder from conan.test.utils.tools import TestClient from conans.util.files import save diff --git a/test/integration/graph/core/graph_manager_test.py b/test/integration/graph/core/graph_manager_test.py index bf620c4ca12..4c3dda4d405 100644 --- a/test/integration/graph/core/graph_manager_test.py +++ b/test/integration/graph/core/graph_manager_test.py @@ -2,7 +2,7 @@ from parameterized import parameterized from conans.client.graph.graph_error import GraphMissingError, GraphLoopError, GraphConflictError -from conans.errors import ConanException +from conan.errors import ConanException from test.integration.graph.core.graph_manager_base import GraphManagerTest from conan.test.utils.tools import GenConanfile diff --git a/test/integration/graph/test_validate_build.py b/test/integration/graph/test_validate_build.py index c05a68db26b..ff5afb38f73 100644 --- a/test/integration/graph/test_validate_build.py +++ b/test/integration/graph/test_validate_build.py @@ -10,7 +10,7 @@ def test_basic_validate_build_test(): t = TestClient() conanfile = textwrap.dedent(""" from conan import ConanFile - from conans.errors import ConanInvalidConfiguration + from conan.errors import ConanInvalidConfiguration class myConan(ConanFile): name = "foo" @@ -57,7 +57,7 @@ def test_with_options_validate_build_test(): t = TestClient(light=True) conanfile = textwrap.dedent(""" from conan import ConanFile - from conans.errors import ConanInvalidConfiguration + from conan.errors import ConanInvalidConfiguration class myConan(ConanFile): name = "foo" diff --git a/test/integration/remote/auth_test.py b/test/integration/remote/auth_test.py index be9f6d5f87a..80aacdcb8ac 100644 --- a/test/integration/remote/auth_test.py +++ b/test/integration/remote/auth_test.py @@ -6,7 +6,7 @@ from requests.models import Response from conan.internal.api.remotes.localdb import LocalDB -from conans.errors import AuthenticationException +from conan.internal.errors import AuthenticationException from conans.model.recipe_ref import RecipeReference from conan.internal.paths import CONANFILE from conan.test.assets.genconanfile import GenConanfile diff --git a/test/integration/remote/retry_test.py b/test/integration/remote/retry_test.py index e5cba085f25..dd3e859815b 100644 --- a/test/integration/remote/retry_test.py +++ b/test/integration/remote/retry_test.py @@ -5,7 +5,7 @@ from requests.exceptions import HTTPError from conans.client.rest.file_uploader import FileUploader -from conans.errors import AuthenticationException, ForbiddenException +from conan.internal.errors import AuthenticationException, ForbiddenException from conan.test.utils.mocks import RedirectedTestOutput from conan.test.utils.test_files import temp_folder from conan.test.utils.tools import redirect_output diff --git a/test/integration/tools/system/package_manager_test.py b/test/integration/tools/system/package_manager_test.py index b769b4e0bc4..5eb052baca9 100644 --- a/test/integration/tools/system/package_manager_test.py +++ b/test/integration/tools/system/package_manager_test.py @@ -7,7 +7,7 @@ from conan.tools.system.package_manager import Apt, Apk, Dnf, Yum, Brew, Pkg, PkgUtil, Chocolatey, \ Zypper, PacMan, _SystemPackageManagerTool -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.settings import Settings from conan.test.utils.mocks import ConanFileMock, MockSettings diff --git a/test/unittests/cli/common_test.py b/test/unittests/cli/common_test.py index 47c4282521f..b62c6e4838b 100644 --- a/test/unittests/cli/common_test.py +++ b/test/unittests/cli/common_test.py @@ -5,7 +5,7 @@ from conan.api.conan_api import ConanAPI from conan.internal.cache.home_paths import HomePaths -from conans.errors import ConanException +from conan.errors import ConanException from conan.test.utils.test_files import temp_folder from conans.util.files import save diff --git a/test/unittests/client/conanfile_loader_test.py b/test/unittests/client/conanfile_loader_test.py index 69ebb92c1ce..9bfd97d8dc0 100644 --- a/test/unittests/client/conanfile_loader_test.py +++ b/test/unittests/client/conanfile_loader_test.py @@ -7,7 +7,7 @@ from parameterized import parameterized from conans.client.loader import ConanFileLoader, ConanFileTextLoader, load_python_file -from conans.errors import ConanException +from conan.errors import ConanException from conan.test.utils.test_files import temp_folder from conans.util.files import save, chdir diff --git a/test/unittests/client/graph/build_mode_test.py b/test/unittests/client/graph/build_mode_test.py index b760f707802..653dd053a51 100644 --- a/test/unittests/client/graph/build_mode_test.py +++ b/test/unittests/client/graph/build_mode_test.py @@ -1,7 +1,7 @@ import pytest from conans.client.graph.build_mode import BuildMode -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference from conan.test.utils.mocks import ConanFileMock, RedirectedTestOutput from conan.test.utils.tools import redirect_output diff --git a/test/unittests/client/migrations/test_migrator.py b/test/unittests/client/migrations/test_migrator.py index 66a38636efd..f8224cff5a5 100644 --- a/test/unittests/client/migrations/test_migrator.py +++ b/test/unittests/client/migrations/test_migrator.py @@ -3,7 +3,7 @@ import pytest -from conans.errors import ConanMigrationError +from conan.errors import ConanMigrationError from conans.migrations import Migrator from conan.test.utils.test_files import temp_folder diff --git a/test/unittests/client/profile_loader/compiler_cppstd_test.py b/test/unittests/client/profile_loader/compiler_cppstd_test.py index af73239e1f5..f2468f7a054 100644 --- a/test/unittests/client/profile_loader/compiler_cppstd_test.py +++ b/test/unittests/client/profile_loader/compiler_cppstd_test.py @@ -9,7 +9,7 @@ from conan.internal.cache.home_paths import HomePaths from conan.internal.api.profile.profile_loader import ProfileLoader from conan.internal.default_settings import default_settings_yml -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conf import ConfDefinition from conans.model.settings import Settings from conan.test.utils.test_files import temp_folder diff --git a/test/unittests/client/profile_loader/profile_loader_test.py b/test/unittests/client/profile_loader/profile_loader_test.py index b62722b8095..9e20d9c5e9b 100644 --- a/test/unittests/client/profile_loader/profile_loader_test.py +++ b/test/unittests/client/profile_loader/profile_loader_test.py @@ -4,7 +4,7 @@ import pytest from conan.internal.api.profile.profile_loader import _ProfileParser, ProfileLoader -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference from conan.test.utils.mocks import ConanFileMock, MockSettings from conan.test.utils.test_files import temp_folder diff --git a/test/unittests/client/rest/downloader_test.py b/test/unittests/client/rest/downloader_test.py index a5b8464c15a..b6341535812 100644 --- a/test/unittests/client/rest/downloader_test.py +++ b/test/unittests/client/rest/downloader_test.py @@ -6,7 +6,7 @@ import pytest from conans.client.downloaders.file_downloader import FileDownloader -from conans.errors import ConanException +from conan.errors import ConanException class MockResponse(object): diff --git a/test/unittests/client/rest/uploader_test.py b/test/unittests/client/rest/uploader_test.py index 53daf468c5c..4777ccd2121 100644 --- a/test/unittests/client/rest/uploader_test.py +++ b/test/unittests/client/rest/uploader_test.py @@ -3,7 +3,7 @@ from collections import namedtuple from conans.client.rest.file_uploader import FileUploader -from conans.errors import AuthenticationException, ForbiddenException, InternalErrorException +from conan.internal.errors import InternalErrorException, AuthenticationException, ForbiddenException from conans.util.files import save diff --git a/test/unittests/client/toolchain/autotools/autotools_toolchain_test.py b/test/unittests/client/toolchain/autotools/autotools_toolchain_test.py index e5afa10d744..3ad84012039 100644 --- a/test/unittests/client/toolchain/autotools/autotools_toolchain_test.py +++ b/test/unittests/client/toolchain/autotools/autotools_toolchain_test.py @@ -5,7 +5,7 @@ from conan.tools.build import load_toolchain_args from conan.tools.gnu import AutotoolsToolchain -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conf import Conf from conan.test.utils.mocks import ConanFileMock, MockSettings, MockOptions from conan.test.utils.test_files import temp_folder diff --git a/test/unittests/client/tools/cppstd_required_test.py b/test/unittests/client/tools/cppstd_required_test.py index 683fc4bbcba..8da43ebb8ce 100644 --- a/test/unittests/client/tools/cppstd_required_test.py +++ b/test/unittests/client/tools/cppstd_required_test.py @@ -4,7 +4,7 @@ from conan.tools.build import check_max_cppstd, check_min_cppstd, valid_max_cppstd, valid_min_cppstd from conan.test.utils.mocks import MockSettings, ConanFileMock -from conans.errors import ConanInvalidConfiguration, ConanException +from conan.errors import ConanException, ConanInvalidConfiguration def _create_conanfile(compiler, version, os, cppstd, libcxx=None): diff --git a/test/unittests/model/options_test.py b/test/unittests/model/options_test.py index 447e80ca34b..24ddc72dac2 100644 --- a/test/unittests/model/options_test.py +++ b/test/unittests/model/options_test.py @@ -2,7 +2,7 @@ import pytest -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.options import Options from conans.model.recipe_ref import RecipeReference diff --git a/test/unittests/model/settings_test.py b/test/unittests/model/settings_test.py index d03c9cc3cdc..0c63f49f187 100644 --- a/test/unittests/model/settings_test.py +++ b/test/unittests/model/settings_test.py @@ -4,7 +4,7 @@ import pytest from conan.internal.default_settings import default_settings_yml -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.settings import Settings, bad_value_msg, undefined_field diff --git a/test/unittests/model/test_conf.py b/test/unittests/model/test_conf.py index e73870a457a..f0d155a74f9 100644 --- a/test/unittests/model/test_conf.py +++ b/test/unittests/model/test_conf.py @@ -2,7 +2,7 @@ import pytest -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conf import ConfDefinition diff --git a/test/unittests/model/test_recipe_reference.py b/test/unittests/model/test_recipe_reference.py index d0cc0ca4b44..382424c1c35 100644 --- a/test/unittests/model/test_recipe_reference.py +++ b/test/unittests/model/test_recipe_reference.py @@ -1,6 +1,6 @@ import pytest -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.recipe_ref import RecipeReference diff --git a/test/unittests/model/version/test_version_range.py b/test/unittests/model/version/test_version_range.py index 629363160b7..5ac8d0850ba 100644 --- a/test/unittests/model/version/test_version_range.py +++ b/test/unittests/model/version/test_version_range.py @@ -2,7 +2,7 @@ import pytest -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.version import Version from conans.model.version_range import VersionRange from conan.test.utils.tools import TestClient diff --git a/test/unittests/server/conan_server_config_parser_test.py b/test/unittests/server/conan_server_config_parser_test.py index c4197e48e74..15172061064 100644 --- a/test/unittests/server/conan_server_config_parser_test.py +++ b/test/unittests/server/conan_server_config_parser_test.py @@ -2,7 +2,7 @@ import os import unittest -from conans.errors import ConanException +from conan.errors import ConanException from conans.server.conf import ConanServerConfigParser from conan.test.utils.test_files import temp_folder from conans.util.files import mkdir, save diff --git a/test/unittests/server/conf_test.py b/test/unittests/server/conf_test.py index 1020ed7e036..c9528fb641a 100644 --- a/test/unittests/server/conf_test.py +++ b/test/unittests/server/conf_test.py @@ -2,7 +2,7 @@ import unittest from datetime import timedelta -from conans.errors import ConanException +from conan.errors import ConanException from conans.server.conf import ConanServerConfigParser from conan.test.utils.test_files import temp_folder from conans.util.config_parser import ConfigParser diff --git a/test/unittests/server/service/authorizer_test.py b/test/unittests/server/service/authorizer_test.py index 27a8ffdaf36..1c80b8fe7af 100644 --- a/test/unittests/server/service/authorizer_test.py +++ b/test/unittests/server/service/authorizer_test.py @@ -1,6 +1,6 @@ import unittest -from conans.errors import AuthenticationException, ForbiddenException, InternalErrorException +from conan.internal.errors import InternalErrorException, AuthenticationException, ForbiddenException from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference from conans.server.service.authorize import BasicAuthorizer diff --git a/test/unittests/server/service/service_test.py b/test/unittests/server/service/service_test.py index 80c50943f18..97c90f33c94 100644 --- a/test/unittests/server/service/service_test.py +++ b/test/unittests/server/service/service_test.py @@ -2,7 +2,7 @@ import os import unittest -from conans.errors import NotFoundException +from conan.internal.errors import NotFoundException from conans.model.manifest import FileTreeManifest from conans.model.package_ref import PkgReference from conans.model.recipe_ref import RecipeReference diff --git a/test/unittests/source/merge_directories_test.py b/test/unittests/source/merge_directories_test.py index f840906d870..6edff92909c 100644 --- a/test/unittests/source/merge_directories_test.py +++ b/test/unittests/source/merge_directories_test.py @@ -5,7 +5,7 @@ import pytest -from conans.errors import ConanException +from conan.errors import ConanException from conan.test.utils.test_files import temp_folder from conans.util.files import mkdir, save, merge_directories, load diff --git a/test/unittests/tools/android/test_android_tools.py b/test/unittests/tools/android/test_android_tools.py index 508cdd52dd5..b0acc977d5f 100644 --- a/test/unittests/tools/android/test_android_tools.py +++ b/test/unittests/tools/android/test_android_tools.py @@ -1,5 +1,5 @@ from conan.test.utils.mocks import ConanFileMock, MockSettings -from conans.errors import ConanException +from conan.errors import ConanException from conan.tools.android import android_abi from pytest import raises diff --git a/test/unittests/tools/apple/test_apple_tools.py b/test/unittests/tools/apple/test_apple_tools.py index dddaa6ccb61..a54350f8a23 100644 --- a/test/unittests/tools/apple/test_apple_tools.py +++ b/test/unittests/tools/apple/test_apple_tools.py @@ -3,7 +3,7 @@ import textwrap from conan.internal.internal_tools import is_universal_arch -from conans.errors import ConanException +from conan.errors import ConanException from conan.test.utils.mocks import ConanFileMock, MockSettings, MockOptions from conan.test.utils.test_files import temp_folder from conan.tools.apple import is_apple_os, to_apple_arch, fix_apple_shared_install_name, XCRun diff --git a/test/unittests/tools/build/test_cppstd.py b/test/unittests/tools/build/test_cppstd.py index 943a64288c1..1a4f6f80dbb 100644 --- a/test/unittests/tools/build/test_cppstd.py +++ b/test/unittests/tools/build/test_cppstd.py @@ -2,7 +2,7 @@ from conan.internal.api.detect.detect_api import detect_cppstd from conan.tools.build import supported_cppstd, check_min_cppstd, valid_min_cppstd -from conans.errors import ConanException, ConanInvalidConfiguration +from conan.errors import ConanException, ConanInvalidConfiguration from conans.model.version import Version from conan.test.utils.mocks import MockSettings, ConanFileMock diff --git a/test/unittests/tools/cmake/test_cmaketoolchain.py b/test/unittests/tools/cmake/test_cmaketoolchain.py index 09ba6d0fd36..5eb8d43bea7 100644 --- a/test/unittests/tools/cmake/test_cmaketoolchain.py +++ b/test/unittests/tools/cmake/test_cmaketoolchain.py @@ -7,7 +7,7 @@ from conan.internal.default_settings import default_settings_yml from conan.tools.cmake import CMakeToolchain from conan.tools.cmake.toolchain.blocks import Block -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conf import Conf from conans.model.options import Options from conans.model.settings import Settings diff --git a/test/unittests/tools/files/test_downloads.py b/test/unittests/tools/files/test_downloads.py index f589900270d..165001b46d2 100644 --- a/test/unittests/tools/files/test_downloads.py +++ b/test/unittests/tools/files/test_downloads.py @@ -4,7 +4,8 @@ import pytest from conan.tools.files import ftp_download, download, get -from conans.errors import ConanException, AuthenticationException +from conan.internal.errors import AuthenticationException +from conan.errors import ConanException from conan.test.utils.file_server import TestFileServer from conan.test.utils.mocks import ConanFileMock, RedirectedTestOutput from conan.test.utils.test_files import temp_folder diff --git a/test/unittests/tools/files/test_patches.py b/test/unittests/tools/files/test_patches.py index 4327f55a757..34708b39da4 100644 --- a/test/unittests/tools/files/test_patches.py +++ b/test/unittests/tools/files/test_patches.py @@ -4,7 +4,7 @@ import pytest from conan.tools.files import patch, apply_conandata_patches -from conans.errors import ConanException +from conan.errors import ConanException from conan.test.utils.mocks import ConanFileMock, RedirectedTestOutput from conan.test.utils.tools import redirect_output diff --git a/test/unittests/tools/files/test_toolchain.py b/test/unittests/tools/files/test_toolchain.py index 5e2abf6c860..8fcc06c5d51 100644 --- a/test/unittests/tools/files/test_toolchain.py +++ b/test/unittests/tools/files/test_toolchain.py @@ -5,7 +5,7 @@ from conan.tools.build import load_toolchain_args, save_toolchain_args, CONAN_TOOLCHAIN_ARGS_FILE, \ CONAN_TOOLCHAIN_ARGS_SECTION -from conans.errors import ConanException +from conan.errors import ConanException from conan.test.utils.test_files import temp_folder from conans.util.files import save, load diff --git a/test/unittests/tools/gnu/autotoolschain_test.py b/test/unittests/tools/gnu/autotoolschain_test.py index 8c56c2d73b3..37096e97030 100644 --- a/test/unittests/tools/gnu/autotoolschain_test.py +++ b/test/unittests/tools/gnu/autotoolschain_test.py @@ -4,7 +4,7 @@ from conan.tools.build import cmd_args_to_string from conan.tools.gnu import AutotoolsToolchain -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conf import Conf from conan.test.utils.mocks import ConanFileMock, MockSettings diff --git a/test/unittests/tools/gnu/test_gnutoolchain.py b/test/unittests/tools/gnu/test_gnutoolchain.py index 99668506cc0..cf053530e1f 100644 --- a/test/unittests/tools/gnu/test_gnutoolchain.py +++ b/test/unittests/tools/gnu/test_gnutoolchain.py @@ -4,7 +4,7 @@ from conan.tools.build import cmd_args_to_string from conan.tools.gnu import GnuToolchain -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conf import Conf from conan.test.utils.mocks import ConanFileMock, MockSettings diff --git a/test/unittests/tools/gnu/test_triplets.py b/test/unittests/tools/gnu/test_triplets.py index be07191404e..62647957661 100644 --- a/test/unittests/tools/gnu/test_triplets.py +++ b/test/unittests/tools/gnu/test_triplets.py @@ -1,7 +1,7 @@ import pytest from conan.tools.gnu.get_gnu_triplet import _get_gnu_triplet, _get_gnu_os, _get_gnu_arch -from conans.errors import ConanException +from conan.errors import ConanException @pytest.mark.parametrize("os_, arch, compiler, expected", [ diff --git a/test/unittests/tools/intel/test_intel_cc.py b/test/unittests/tools/intel/test_intel_cc.py index 8b9a6d4b361..788ff41075d 100644 --- a/test/unittests/tools/intel/test_intel_cc.py +++ b/test/unittests/tools/intel/test_intel_cc.py @@ -6,7 +6,7 @@ from conan.tools.build.flags import architecture_flag, cppstd_flag from conan.tools.intel import IntelCC -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.conf import ConfDefinition from conan.test.utils.mocks import ConanFileMock, MockSettings diff --git a/test/unittests/tools/microsoft/test_check_min_vs.py b/test/unittests/tools/microsoft/test_check_min_vs.py index a480e163df3..3afa2eb7524 100644 --- a/test/unittests/tools/microsoft/test_check_min_vs.py +++ b/test/unittests/tools/microsoft/test_check_min_vs.py @@ -1,7 +1,7 @@ import pytest from conan.tools.microsoft import check_min_vs -from conans.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration from conan.test.utils.mocks import ConanFileMock, MockSettings diff --git a/test/unittests/util/file_hashes_test.py b/test/unittests/util/file_hashes_test.py index b7ae5f0388a..7115e8e1f0f 100644 --- a/test/unittests/util/file_hashes_test.py +++ b/test/unittests/util/file_hashes_test.py @@ -2,7 +2,7 @@ import unittest from conan.tools.files import check_md5, check_sha1, check_sha256 -from conans.errors import ConanException +from conan.errors import ConanException from conan.test.utils.mocks import ConanFileMock from conan.test.utils.test_files import temp_folder from conans.util.files import save diff --git a/test/unittests/util/files/strip_root_extract_test.py b/test/unittests/util/files/strip_root_extract_test.py index 1b8f8e5acc0..cdbdb7b4ac4 100644 --- a/test/unittests/util/files/strip_root_extract_test.py +++ b/test/unittests/util/files/strip_root_extract_test.py @@ -4,7 +4,7 @@ import zipfile from conan.tools.files.files import untargz, unzip -from conans.errors import ConanException +from conan.errors import ConanException from conans.model.manifest import gather_files from conan.test.utils.mocks import ConanFileMock from conan.test.utils.mocks import RedirectedTestOutput