Repository: conan-io/conan
Pull request #18198 (2025-04-29 22:43:53)

Refactor/rest
Changelog: Omit
Docs: Omit

Pure refactor, moving conans->conan


Patch:
diff --git a/conan/api/conan_api.py b/conan/api/conan_api.py
index de48082e5..c62ca5a50 100644
--- a/conan/api/conan_api.py
+++ b/conan/api/conan_api.py
@@ -22,7 +22,7 @@ from conan.api.subapi.search import SearchAPI
 from conan.api.subapi.upload import UploadAPI
 from conan.errors import ConanException
 from conan.internal.paths import get_conan_user_home
-from conans.client.migrations import ClientMigrator
+from conan.internal.api.migrations import ClientMigrator
 from conan.internal.model.version_range import validate_conan_version
 
 
diff --git a/conan/api/model/list.py b/conan/api/model/list.py
index 835165497..47b0e17a0 100644
--- a/conan/api/model/list.py
+++ b/conan/api/model/list.py
@@ -4,11 +4,10 @@ import os
 from json import JSONDecodeError
 
 from conan.api.model import RecipeReference, PkgReference
-from conan.cli import make_abs_path
 from conan.errors import ConanException
 from conan.internal.errors import NotFoundException
 from conan.internal.model.version_range import VersionRange
-from conans.client.graph.graph import RECIPE_EDITABLE, RECIPE_CONSUMER, RECIPE_PLATFORM, \
+from conan.internal.graph.graph import RECIPE_EDITABLE, RECIPE_CONSUMER, RECIPE_PLATFORM, \
     RECIPE_VIRTUAL, BINARY_SKIP, BINARY_MISSING, BINARY_INVALID
 from conans.util.files import load
 
diff --git a/conan/api/subapi/cache.py b/conan/api/subapi/cache.py
index c188f5fad..1ffbc228a 100644
--- a/conan/api/subapi/cache.py
+++ b/conan/api/subapi/cache.py
@@ -9,7 +9,7 @@ from conan.api.output import ConanOutput
 from conan.internal.cache.cache import PkgCache
 from conan.internal.cache.home_paths import HomePaths
 from conan.internal.cache.integrity_check import IntegrityChecker
-from conans.client.downloaders.download_cache import DownloadCache
+from conan.internal.rest.download_cache import DownloadCache
 from conan.errors import ConanException
 from conan.api.model import PkgReference
 from conan.api.model import RecipeReference
diff --git a/conan/api/subapi/config.py b/conan/api/subapi/config.py
index f3645013d..031b7084e 100644
--- a/conan/api/subapi/config.py
+++ b/conan/api/subapi/config.py
@@ -12,15 +12,15 @@ from conan.internal.api.detect import detect_api
 from conan.internal.cache.home_paths import HomePaths
 from conan.internal.conan_app import ConanApp
 from conan.internal.default_settings import default_settings_yml
-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 conan.internal.graph.graph import CONTEXT_HOST, RECIPE_VIRTUAL, Node
+from conan.internal.graph.graph_builder import DepsGraphBuilder
+from conan.internal.graph.profile_node_definer import consumer_definer
 from conan.errors import ConanException
 from conan.internal.model.conf import ConfDefinition, BUILT_IN_CONFS, CORE_CONF_PATTERN
 from conan.internal.model.pkg_type import PackageType
 from conan.api.model import RecipeReference
 from conan.internal.model.settings import Settings
-from conans.client.hook_manager import HookManager
+from conan.internal.hook_manager import HookManager
 from conans.util.files import load, save, rmdir, remove
 
 
diff --git a/conan/api/subapi/export.py b/conan/api/subapi/export.py
index ce08a8b0f..421e3722a 100644
--- a/conan/api/subapi/export.py
+++ b/conan/api/subapi/export.py
@@ -3,7 +3,7 @@ from conan.internal.cache.cache import PkgCache
 from conan.internal.conan_app import ConanApp
 from conan.internal.api.export import cmd_export
 from conan.internal.methods import run_package_method
-from conans.client.graph.graph import BINARY_BUILD, RECIPE_INCACHE
+from conan.internal.graph.graph import BINARY_BUILD, RECIPE_INCACHE
 from conan.api.model import PkgReference
 from conans.util.files import mkdir
 
diff --git a/conan/api/subapi/graph.py b/conan/api/subapi/graph.py
index 007bae969..b5f7d4da6 100644
--- a/conan/api/subapi/graph.py
+++ b/conan/api/subapi/graph.py
@@ -1,12 +1,12 @@
 from conan.api.output import ConanOutput
 from conan.internal.conan_app import ConanApp, ConanBasicApp
 from conan.internal.model.recipe_ref import ref_matches
-from conans.client.graph.graph import Node, RECIPE_CONSUMER, CONTEXT_HOST, RECIPE_VIRTUAL, \
+from conan.internal.graph.graph import Node, RECIPE_CONSUMER, CONTEXT_HOST, RECIPE_VIRTUAL, \
     CONTEXT_BUILD, BINARY_MISSING
-from conans.client.graph.graph_binaries import GraphBinariesAnalyzer
-from conans.client.graph.graph_builder import DepsGraphBuilder
-from conans.client.graph.install_graph import InstallGraph, ProfileArgs
-from conans.client.graph.profile_node_definer import initialize_conanfile_profile, consumer_definer
+from conan.internal.graph.graph_binaries import GraphBinariesAnalyzer
+from conan.internal.graph.graph_builder import DepsGraphBuilder
+from conan.internal.graph.install_graph import InstallGraph, ProfileArgs
+from conan.internal.graph.profile_node_definer import initialize_conanfile_profile, consumer_definer
 from conan.errors import ConanException
 from conan.api.model import RecipeReference
 
diff --git a/conan/api/subapi/install.py b/conan/api/subapi/install.py
index 873a9db17..9f35bf0bc 100644
--- a/conan/api/subapi/install.py
+++ b/conan/api/subapi/install.py
@@ -4,8 +4,8 @@ from conan.internal.api.install.generators import write_generators
 from conan.internal.conan_app import ConanBasicApp
 from conan.internal.deploy import do_deploys
 
-from conans.client.graph.install_graph import InstallGraph
-from conans.client.installer import BinaryInstaller
+from conan.internal.graph.install_graph import InstallGraph
+from conan.internal.graph.installer import BinaryInstaller
 from conan.errors import ConanInvalidConfiguration
 
 
diff --git a/conan/api/subapi/local.py b/conan/api/subapi/local.py
index ea839fdbd..fb5b47e1f 100644
--- a/conan/api/subapi/local.py
+++ b/conan/api/subapi/local.py
@@ -4,8 +4,8 @@ from conan.cli import make_abs_path
 from conan.internal.conan_app import ConanApp
 from conan.internal.api.local.editable import EditablePackages
 from conan.internal.methods import run_build_method, run_source_method
-from conans.client.graph.graph import CONTEXT_HOST
-from conans.client.graph.profile_node_definer import initialize_conanfile_profile
+from conan.internal.graph.graph import CONTEXT_HOST
+from conan.internal.graph.profile_node_definer import initialize_conanfile_profile
 from conan.internal.errors import conanfile_exception_formatter
 from conan.errors import ConanException
 from conan.api.model import RecipeReference
diff --git a/conan/api/subapi/lockfile.py b/conan/api/subapi/lockfile.py
index c18cc58c0..be77e6743 100644
--- a/conan/api/subapi/lockfile.py
+++ b/conan/api/subapi/lockfile.py
@@ -2,7 +2,7 @@ import os
 
 from conan.api.output import ConanOutput
 from conan.cli import make_abs_path
-from conans.client.graph.graph import Overrides
+from conan.internal.graph.graph import Overrides
 from conan.errors import ConanException
 from conan.internal.model.lockfile import Lockfile, LOCKFILE
 
diff --git a/conan/api/subapi/profiles.py b/conan/api/subapi/profiles.py
index d83e88cbe..0d40d4bf5 100644
--- a/conan/api/subapi/profiles.py
+++ b/conan/api/subapi/profiles.py
@@ -3,7 +3,7 @@ import os
 from conan.api.output import ConanOutput
 from conan.internal.cache.home_paths import HomePaths
 
-from conans.client.loader import load_python_file
+from conan.internal.loader import load_python_file
 from conan.internal.api.profile.profile_loader import ProfileLoader
 from conan.internal.errors import scoped_traceback
 from conan.errors import ConanException
diff --git a/conan/api/subapi/remotes.py b/conan/api/subapi/remotes.py
index 65409cc63..3afaa0c3b 100644
--- a/conan/api/subapi/remotes.py
+++ b/conan/api/subapi/remotes.py
@@ -8,9 +8,9 @@ from conan.api.model import Remote, LOCAL_RECIPES_INDEX
 from conan.api.output import ConanOutput
 from conan.internal.cache.home_paths import HomePaths
 from conan.internal.conan_app import ConanBasicApp
-from conans.client.rest.conan_requester import ConanRequester
-from conans.client.rest.remote_credentials import RemoteCredentials
-from conans.client.rest_client_local_recipe_index import add_local_recipes_index_remote, \
+from conan.internal.rest.conan_requester import ConanRequester
+from conan.internal.rest.remote_credentials import RemoteCredentials
+from conan.internal.rest.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 conan.errors import ConanException
diff --git a/conan/api/subapi/upload.py b/conan/api/subapi/upload.py
index 4f038cc9f..f336d89ee 100644
--- a/conan/api/subapi/upload.py
+++ b/conan/api/subapi/upload.py
@@ -6,8 +6,8 @@ from conan.api.output import ConanOutput
 from conan.internal.conan_app import ConanApp
 from conan.internal.api.uploader import PackagePreparator, UploadExecutor, UploadUpstreamChecker, \
     gather_metadata
-from conans.client.pkg_sign import PkgSignaturesPlugin
-from conans.client.rest.file_uploader import FileUploader
+from conan.internal.rest.pkg_sign import PkgSignaturesPlugin
+from conan.internal.rest.file_uploader import FileUploader
 from conan.internal.errors import AuthenticationException, ForbiddenException
 from conan.errors import ConanException
 
diff --git a/conan/api/subapi/workspace.py b/conan/api/subapi/workspace.py
index 09dd7cbe2..1490efa2c 100644
--- a/conan/api/subapi/workspace.py
+++ b/conan/api/subapi/workspace.py
@@ -11,12 +11,12 @@ from conan.errors import ConanException
 from conan.internal.conan_app import ConanApp
 from conan.internal.model.workspace import Workspace
 from conan.tools.scm import Git
-from conans.client.graph.graph import RECIPE_EDITABLE, DepsGraph, CONTEXT_HOST, RECIPE_VIRTUAL, Node, \
+from conan.internal.graph.graph import RECIPE_EDITABLE, DepsGraph, CONTEXT_HOST, RECIPE_VIRTUAL, Node, \
     RECIPE_CONSUMER
-from conans.client.graph.graph import TransitiveRequirement
-from conans.client.graph.profile_node_definer import consumer_definer
-from conans.client.loader import load_python_file
-from conans.client.source import retrieve_exports_sources
+from conan.internal.graph.graph import TransitiveRequirement
+from conan.internal.graph.profile_node_definer import consumer_definer
+from conan.internal.loader import load_python_file
+from conan.internal.source import retrieve_exports_sources
 from conans.util.files import merge_directories
 
 
diff --git a/conan/internal/api/config/config_installer.py b/conan/internal/api/config/config_installer.py
index e97426b29..1407e2511 100644
--- a/conan/internal/api/config/config_installer.py
+++ b/conan/internal/api/config/config_installer.py
@@ -6,7 +6,7 @@ from urllib.parse import urlparse, urlsplit
 from contextlib import contextmanager
 
 from conan.api.output import ConanOutput
-from conans.client.downloaders.file_downloader import FileDownloader
+from conan.internal.rest.file_downloader import FileDownloader
 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/install/generators.py b/conan/internal/api/install/generators.py
index 946133a7d..098ab9598 100644
--- a/conan/internal/api/install/generators.py
+++ b/conan/internal/api/install/generators.py
@@ -4,7 +4,7 @@ import traceback
 import importlib
 
 from conan.internal.cache.home_paths import HomePaths
-from conans.client.subsystems import deduce_subsystem, subsystem_path
+from conan.internal.subsystems import deduce_subsystem, subsystem_path
 from conan.internal.errors import conanfile_exception_formatter
 from conan.errors import ConanException
 from conans.util.files import save, mkdir, chdir
@@ -58,7 +58,7 @@ def _get_generator_class(generator_name):
 
 
 def load_cache_generators(path):
-    from conans.client.loader import load_python_file
+    from conan.internal.loader import load_python_file
     result = {}  # Name of the generator: Class
     if not os.path.isdir(path):
         return result
diff --git a/conans/client/migrations.py b/conan/internal/api/migrations.py
similarity index 98%
rename from conans/client/migrations.py
rename to conan/internal/api/migrations.py
index 026ef8b81..f33688fae 100644
--- a/conans/client/migrations.py
+++ b/conan/internal/api/migrations.py
@@ -46,7 +46,7 @@ class ClientMigrator(Migrator):
         # Update settings.yml
         migrate_settings_file(self.cache_folder)
         # Update compatibility.py, app_compat.py, and cppstd_compat.py.
-        from conans.client.graph.compatibility import migrate_compatibility_files
+        from conan.internal.graph.compatibility import migrate_compatibility_files
         migrate_compatibility_files(self.cache_folder)
         # Update profile plugin
         from conan.internal.api.profile.profile_loader import migrate_profile_plugin
diff --git a/conan/internal/api/profile/profile_loader.py b/conan/internal/api/profile/profile_loader.py
index ddc19bb64..1229cf21b 100644
--- a/conan/internal/api/profile/profile_loader.py
+++ b/conan/internal/api/profile/profile_loader.py
@@ -410,7 +410,7 @@ def _profile_parse_args(settings, options, conf):
 
 
 def migrate_profile_plugin(cache_folder):
-    from conans.client.migrations import update_file
+    from conan.internal.api.migrations import update_file
 
     profile_plugin_file = HomePaths(cache_folder).profile_plugin_path
     update_file(profile_plugin_file, _default_profile_plugin)
diff --git a/conan/internal/api/uploader.py b/conan/internal/api/uploader.py
index 8a014732e..0cf00cf2c 100644
--- a/conan/internal/api/uploader.py
+++ b/conan/internal/api/uploader.py
@@ -5,7 +5,7 @@ import time
 
 from conan.internal.conan_app import ConanApp
 from conan.api.output import ConanOutput
-from conans.client.source import retrieve_exports_sources
+from conan.internal.source import retrieve_exports_sources
 from conan.internal.errors import NotFoundException
 from conan.errors import ConanException
 from conan.internal.paths import (CONAN_MANIFEST, CONANFILE, EXPORT_SOURCES_TGZ_NAME,
diff --git a/conan/internal/conan_app.py b/conan/internal/conan_app.py
index dc329fc81..0ca4df974 100644
--- a/conan/internal/conan_app.py
+++ b/conan/internal/conan_app.py
@@ -4,12 +4,12 @@ from conan.internal.api.local.editable import EditablePackages
 from conan.internal.cache.cache import PkgCache
 from conan.internal.cache.home_paths import HomePaths
 from conan.internal.model.conf import ConfDefinition
-from conans.client.graph.proxy import ConanProxy
-from conans.client.graph.python_requires import PyRequireLoader
-from conans.client.graph.range_resolver import RangeResolver
-from conans.client.loader import ConanFileLoader, load_python_file
-from conans.client.remote_manager import RemoteManager
-from conans.client.rest.auth_manager import ConanApiAuthManager
+from conan.internal.rest.auth_manager import ConanApiAuthManager
+from conan.internal.graph.proxy import ConanProxy
+from conan.internal.graph.python_requires import PyRequireLoader
+from conan.internal.graph.range_resolver import RangeResolver
+from conan.internal.loader import ConanFileLoader, load_python_file
+from conan.internal.rest.remote_manager import RemoteManager
 from conan.internal.api.remotes.localdb import LocalDB
 
 
diff --git a/conan/internal/default_settings.py b/conan/internal/default_settings.py
index e755dab6c..ec5f99596 100644
--- a/conan/internal/default_settings.py
+++ b/conan/internal/default_settings.py
@@ -169,7 +169,7 @@ build_type: [null, Debug, Release, RelWithDebInfo, MinSizeRel]
 
 
 def migrate_settings_file(cache_folder):
-    from conans.client.migrations import update_file
+    from conan.internal.api.migrations import update_file
 
     settings_path = os.path.join(cache_folder, "settings.yml")
     update_file(settings_path, default_settings_yml)
diff --git a/conan/internal/deploy.py b/conan/internal/deploy.py
index 1c2889546..f44745615 100644
--- a/conan/internal/deploy.py
+++ b/conan/internal/deploy.py
@@ -5,7 +5,7 @@ import fnmatch
 
 from conan.internal.cache.home_paths import HomePaths
 from conan.api.output import ConanOutput
-from conans.client.loader import load_python_file
+from conan.internal.loader import load_python_file
 from conan.internal.errors import conanfile_exception_formatter
 from conan.errors import ConanException
 from conans.util.files import rmdir, mkdir
diff --git a/conans/client/__init__.py b/conan/internal/graph/__init__.py
similarity index 100%
rename from conans/client/__init__.py
rename to conan/internal/graph/__init__.py
diff --git a/conans/client/graph/build_mode.py b/conan/internal/graph/build_mode.py
similarity index 100%
rename from conans/client/graph/build_mode.py
rename to conan/internal/graph/build_mode.py
diff --git a/conans/client/graph/compatibility.py b/conan/internal/graph/compatibility.py
similarity index 97%
rename from conans/client/graph/compatibility.py
rename to conan/internal/graph/compatibility.py
index a16166aaf..3eac3279e 100644
--- a/conans/client/graph/compatibility.py
+++ b/conan/internal/graph/compatibility.py
@@ -3,11 +3,11 @@ from collections import OrderedDict
 
 from conan.api.output import ConanOutput
 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 conan.internal.graph.compute_pid import run_validate_package_id
+from conan.internal.loader import load_python_file
 from conan.internal.errors import conanfile_exception_formatter, scoped_traceback
 from conan.errors import ConanException
-from conans.client.migrations import CONAN_GENERATED_COMMENT
+from conan.internal.api.migrations import CONAN_GENERATED_COMMENT
 
 # TODO: Define other compatibility besides applications
 from conans.util.files import load, save
diff --git a/conans/client/graph/compute_pid.py b/conan/internal/graph/compute_pid.py
similarity index 100%
rename from conans/client/graph/compute_pid.py
rename to conan/internal/graph/compute_pid.py
diff --git a/conans/client/graph/graph.py b/conan/internal/graph/graph.py
similarity index 99%
rename from conans/client/graph/graph.py
rename to conan/internal/graph/graph.py
index 72220965e..8348af88d 100644
--- a/conans/client/graph/graph.py
+++ b/conan/internal/graph/graph.py
@@ -1,6 +1,6 @@
 from collections import OrderedDict
 
-from conans.client.graph.graph_error import GraphError
+from conan.internal.graph.graph_error import GraphError
 from conan.api.model import PkgReference
 from conan.api.model import RecipeReference
 
@@ -258,7 +258,7 @@ class Node:
         result["prev_timestamp"] = self.pref_timestamp
         result["remote"] = self.remote.name if self.remote else None
         result["binary_remote"] = self.binary_remote.name if self.binary_remote else None
-        from conans.client.installer import build_id
+        from conan.internal.graph.installer import build_id
         result["build_id"] = build_id(self.conanfile)
         result["binary"] = self.binary
         # TODO: This doesn't match the model, check it
diff --git a/conans/client/graph/graph_binaries.py b/conan/internal/graph/graph_binaries.py
similarity index 97%
rename from conans/client/graph/graph_binaries.py
rename to conan/internal/graph/graph_binaries.py
index 1d05c96df..4a49acaa5 100644
--- a/conans/client/graph/graph_binaries.py
+++ b/conan/internal/graph/graph_binaries.py
@@ -4,15 +4,15 @@ from collections import OrderedDict
 
 from conan.api.output import ConanOutput
 from conan.internal.cache.home_paths import HomePaths
-from conans.client.graph.build_mode import BuildMode
-from conans.client.graph.compatibility import BinaryCompatibility
-from conans.client.graph.compute_pid import compute_package_id
-from conans.client.graph.graph import (BINARY_BUILD, BINARY_CACHE, BINARY_DOWNLOAD, BINARY_MISSING,
-                                       BINARY_UPDATE, RECIPE_EDITABLE, BINARY_EDITABLE,
-                                       RECIPE_CONSUMER, RECIPE_VIRTUAL, BINARY_SKIP,
-                                       BINARY_INVALID, BINARY_EDITABLE_BUILD, RECIPE_PLATFORM,
-                                       BINARY_PLATFORM)
-from conans.client.graph.proxy import should_update_reference
+from conan.internal.graph.build_mode import BuildMode
+from conan.internal.graph.compatibility import BinaryCompatibility
+from conan.internal.graph.compute_pid import compute_package_id
+from conan.internal.graph.graph import (BINARY_BUILD, BINARY_CACHE, BINARY_DOWNLOAD, BINARY_MISSING,
+                                        BINARY_UPDATE, RECIPE_EDITABLE, BINARY_EDITABLE,
+                                        RECIPE_CONSUMER, RECIPE_VIRTUAL, BINARY_SKIP,
+                                        BINARY_INVALID, BINARY_EDITABLE_BUILD, RECIPE_PLATFORM,
+                                        BINARY_PLATFORM)
+from conan.internal.graph.proxy import should_update_reference
 from conan.internal.errors import conanfile_exception_formatter, ConanConnectionError, NotFoundException, \
     PackageNotFoundException
 from conan.errors import ConanException
diff --git a/conans/client/graph/graph_builder.py b/conan/internal/graph/graph_builder.py
similarity index 98%
rename from conans/client/graph/graph_builder.py
rename to conan/internal/graph/graph_builder.py
index b4c6ed365..b3c99d48e 100644
--- a/conans/client/graph/graph_builder.py
+++ b/conan/internal/graph/graph_builder.py
@@ -5,13 +5,13 @@ from collections import deque
 from conan.internal.cache.conan_reference_layout import BasicLayout
 from conan.internal.methods import run_configure_method
 from conan.internal.model.recipe_ref import ref_matches
-from conans.client.graph.graph import DepsGraph, Node, CONTEXT_HOST, \
+from conan.internal.graph.graph import DepsGraph, Node, CONTEXT_HOST, \
     CONTEXT_BUILD, TransitiveRequirement, RECIPE_VIRTUAL, RECIPE_EDITABLE
-from conans.client.graph.graph import RECIPE_PLATFORM
-from conans.client.graph.graph_error import GraphLoopError, GraphConflictError, GraphMissingError, \
+from conan.internal.graph.graph import RECIPE_PLATFORM
+from conan.internal.graph.graph_error import GraphLoopError, GraphConflictError, GraphMissingError, \
     GraphRuntimeError, GraphError
-from conans.client.graph.profile_node_definer import initialize_conanfile_profile
-from conans.client.graph.provides import check_graph_provides
+from conan.internal.graph.profile_node_definer import initialize_conanfile_profile
+from conan.internal.graph.provides import check_graph_provides
 from conan.errors import ConanException
 from conan.internal.model.conan_file import ConanFile
 from conan.internal.model.options import Options, _PackageOptions
diff --git a/conans/client/graph/graph_error.py b/conan/internal/graph/graph_error.py
similarity index 100%
rename from conans/client/graph/graph_error.py
rename to conan/internal/graph/graph_error.py
diff --git a/conans/client/graph/install_graph.py b/conan/internal/graph/install_graph.py
similarity index 99%
rename from conans/client/graph/install_graph.py
rename to conan/internal/graph/install_graph.py
index b68dec9f2..4762c47ca 100644
--- a/conans/client/graph/install_graph.py
+++ b/conan/internal/graph/install_graph.py
@@ -3,7 +3,7 @@ import os
 import textwrap
 
 from conan.api.output import ConanOutput
-from conans.client.graph.graph import RECIPE_CONSUMER, RECIPE_VIRTUAL, BINARY_SKIP, \
+from conan.internal.graph.graph import RECIPE_CONSUMER, RECIPE_VIRTUAL, BINARY_SKIP, \
     BINARY_MISSING, BINARY_INVALID, Overrides, BINARY_BUILD, BINARY_EDITABLE_BUILD, BINARY_PLATFORM
 from conan.errors import ConanException, ConanInvalidConfiguration
 from conan.api.model import PkgReference
diff --git a/conans/client/installer.py b/conan/internal/graph/installer.py
similarity index 98%
rename from conans/client/installer.py
rename to conan/internal/graph/installer.py
index 51197962e..85b636300 100644
--- a/conans/client/installer.py
+++ b/conan/internal/graph/installer.py
@@ -5,10 +5,10 @@ from multiprocessing.pool import ThreadPool
 from conan.api.output import ConanOutput, Color
 from conan.internal.methods import run_build_method, run_package_method
 from conan.internal.api.install.generators import write_generators
-from conans.client.graph.graph import BINARY_BUILD, BINARY_CACHE, BINARY_DOWNLOAD, BINARY_EDITABLE, \
+from conan.internal.graph.graph import BINARY_BUILD, BINARY_CACHE, BINARY_DOWNLOAD, BINARY_EDITABLE, \
     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 conan.internal.graph.install_graph import InstallGraph
+from conan.internal.source import retrieve_exports_sources, config_source
 from conan.internal.errors import conanfile_remove_attr, conanfile_exception_formatter
 from conan.errors import ConanException
 from conan.internal.model.cpp_info import CppInfo, MockInfoProperty
diff --git a/conans/client/graph/profile_node_definer.py b/conan/internal/graph/profile_node_definer.py
similarity index 99%
rename from conans/client/graph/profile_node_definer.py
rename to conan/internal/graph/profile_node_definer.py
index 63bbed9a0..b84cdd231 100644
--- a/conans/client/graph/profile_node_definer.py
+++ b/conan/internal/graph/profile_node_definer.py
@@ -1,4 +1,4 @@
-from conans.client.graph.graph import CONTEXT_BUILD
+from conan.internal.graph.graph import CONTEXT_BUILD
 from conan.errors import ConanException
 from conan.internal.model.recipe_ref import ref_matches
 
diff --git a/conans/client/graph/provides.py b/conan/internal/graph/provides.py
similarity index 96%
rename from conans/client/graph/provides.py
rename to conan/internal/graph/provides.py
index e08d4ae1d..51beebb24 100644
--- a/conans/client/graph/provides.py
+++ b/conan/internal/graph/provides.py
@@ -1,4 +1,4 @@
-from conans.client.graph.graph_error import GraphProvidesError
+from conan.internal.graph.graph_error import GraphProvidesError
 from conan.api.model import RecipeReference
 
 
diff --git a/conans/client/graph/proxy.py b/conan/internal/graph/proxy.py
similarity index 96%
rename from conans/client/graph/proxy.py
rename to conan/internal/graph/proxy.py
index c2d416437..c2578d071 100644
--- a/conans/client/graph/proxy.py
+++ b/conan/internal/graph/proxy.py
@@ -1,8 +1,8 @@
 from conan.api.output import ConanOutput
 from conan.internal.cache.conan_reference_layout import BasicLayout
-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 conan.internal.graph.graph import (RECIPE_DOWNLOADED, RECIPE_INCACHE, RECIPE_NEWER,
+                                        RECIPE_NOT_IN_REMOTE, RECIPE_UPDATED, RECIPE_EDITABLE,
+                                        RECIPE_INCACHE_DATE_UPDATED, RECIPE_UPDATEABLE)
 from conan.internal.errors import NotFoundException
 from conan.errors import ConanException
 
diff --git a/conans/client/graph/python_requires.py b/conan/internal/graph/python_requires.py
similarity index 100%
rename from conans/client/graph/python_requires.py
rename to conan/internal/graph/python_requires.py
diff --git a/conans/client/graph/range_resolver.py b/conan/internal/graph/range_resolver.py
similarity index 98%
rename from conans/client/graph/range_resolver.py
rename to conan/internal/graph/range_resolver.py
index 83e0cfab1..21fc6698c 100644
--- a/conans/client/graph/range_resolver.py
+++ b/conan/internal/graph/range_resolver.py
@@ -1,4 +1,4 @@
-from conans.client.graph.proxy import should_update_reference
+from conan.internal.graph.proxy import should_update_reference
 from conan.errors import ConanException
 from conan.api.model import RecipeReference
 from conan.internal.model.version_range import VersionRange
diff --git a/conans/client/hook_manager.py b/conan/internal/hook_manager.py
similarity index 98%
rename from conans/client/hook_manager.py
rename to conan/internal/hook_manager.py
index d47002a8f..19ad62ffd 100644
--- a/conans/client/hook_manager.py
+++ b/conan/internal/hook_manager.py
@@ -1,6 +1,6 @@
 import os
 
-from conans.client.loader import load_python_file
+from conan.internal.loader import load_python_file
 from conan.errors import ConanException
 
 valid_hook_methods = ["pre_export", "post_export",
diff --git a/conans/client/loader.py b/conan/internal/loader.py
similarity index 90%
rename from conans/client/loader.py
rename to conan/internal/loader.py
index 957696474..05351e4d9 100644
--- a/conans/client/loader.py
+++ b/conan/internal/loader.py
@@ -15,7 +15,6 @@ from pathlib import Path
 from conan.tools.cmake import cmake_layout
 from conan.tools.google import bazel_layout
 from conan.tools.microsoft import vs_layout
-from conans.client.loader_txt import ConanFileTextLoader
 from conan.internal.errors import conanfile_exception_formatter, NotFoundException
 from conan.errors import ConanException
 from conan.internal.model.conan_file import ConanFile
@@ -23,6 +22,7 @@ from conan.internal.model.options import Options
 from conan.api.model import RecipeReference
 from conan.internal.paths import DATA_YML
 from conan.internal.model.version_range import validate_conan_version
+from conans.util.config_parser import ConfigParser
 from conans.util.files import load, chdir, load_user_encoded
 
 
@@ -397,3 +397,54 @@ def _get_required_conan_version_without_loading(conan_file_path):
         pass
 
     return txt_version
+
+
+class ConanFileTextLoader:
+    """Parse a conanfile.txt file"""
+
+    def __init__(self, input_text):
+        # Prefer composition over inheritance, the __getattr__ was breaking things
+        self._config_parser = ConfigParser(input_text,  ["requires", "generators", "options",
+                                                         "imports", "tool_requires", "test_requires",
+                                                         "layout"],
+                                           strip_comments=True)
+
+    @property
+    def layout(self):
+        """returns the declared layout"""
+        tmp = [r.strip() for r in self._config_parser.layout.splitlines()]
+        if len(tmp) > 1:
+            raise ConanException("Only one layout can be declared in the [layout] section of "
+                                 "the conanfile.txt")
+        return tmp[0] if tmp else None
+
+    @property
+    def requirements(self):
+        """returns a list of requires
+        EX:  "OpenCV/2.4.10@phil/stable"
+        """
+        return [r.strip() for r in self._config_parser.requires.splitlines()]
+
+    @property
+    def tool_requirements(self):
+        """returns a list of tool_requires
+        EX:  "OpenCV/2.4.10@phil/stable"
+        """
+
+        return [r.strip() for r in self._config_parser.tool_requires.splitlines()]
+
+    @property
+    def test_requirements(self):
+        """returns a list of test_requires
+        EX:  "gtest/2.4.10@phil/stable"
+        """
+
+        return [r.strip() for r in self._config_parser.test_requires.splitlines()]
+
+    @property
+    def options(self):
+        return self._config_parser.options
+
+    @property
+    def generators(self):
+        return self._config_parser.generators.splitlines()
diff --git a/conan/internal/model/conan_file.py b/conan/internal/model/conan_file.py
index 34ef337cc..b24c52d64 100644
--- a/conan/internal/model/conan_file.py
+++ b/conan/internal/model/conan_file.py
@@ -2,7 +2,7 @@ import os
 from pathlib import Path
 
 from conan.api.output import ConanOutput, Color
-from conans.client.subsystems import command_env_wrapper
+from conan.internal.subsystems import command_env_wrapper
 from conan.errors import ConanException
 from conan.internal.model.cpp_info import MockInfoProperty
 from conan.internal.model.conf import Conf
diff --git a/conan/internal/model/conanfile_interface.py b/conan/internal/model/conanfile_interface.py
index 8a8c85627..76aed619e 100644
--- a/conan/internal/model/conanfile_interface.py
+++ b/conan/internal/model/conanfile_interface.py
@@ -1,5 +1,5 @@
 from pathlib import Path
-from conans.client.graph.graph import CONTEXT_BUILD
+from conan.internal.graph.graph import CONTEXT_BUILD
 
 
 class ConanFileInterface:
diff --git a/conan/internal/model/dependencies.py b/conan/internal/model/dependencies.py
index 22353419e..b830e04a0 100644
--- a/conan/internal/model/dependencies.py
+++ b/conan/internal/model/dependencies.py
@@ -1,6 +1,6 @@
 from collections import OrderedDict
 
-from conans.client.graph.graph import RECIPE_PLATFORM
+from conan.internal.graph.graph import RECIPE_PLATFORM
 from conan.errors import ConanException
 from conan.api.model import RecipeReference
 from conan.internal.model.conanfile_interface import ConanFileInterface
diff --git a/conan/internal/model/lockfile.py b/conan/internal/model/lockfile.py
index cdae26f59..20ef33830 100644
--- a/conan/internal/model/lockfile.py
+++ b/conan/internal/model/lockfile.py
@@ -4,7 +4,7 @@ import os
 from collections import OrderedDict
 
 from conan.api.output import ConanOutput
-from conans.client.graph.graph import RECIPE_VIRTUAL, RECIPE_CONSUMER, CONTEXT_BUILD, Overrides
+from conan.internal.graph.graph import RECIPE_VIRTUAL, RECIPE_CONSUMER, CONTEXT_BUILD, Overrides
 from conan.errors import ConanException
 from conan.api.model import RecipeReference
 from conan.internal.model.version_range import VersionRange
diff --git a/conan/internal/model/workspace.py b/conan/internal/model/workspace.py
index 01079f35b..6cd297962 100644
--- a/conan/internal/model/workspace.py
+++ b/conan/internal/model/workspace.py
@@ -79,7 +79,7 @@ class Workspace:
 
     def load_conanfile(self, conanfile_path):
         conanfile_path = os.path.join(self.folder, conanfile_path, "conanfile.py")
-        from conans.client.loader import ConanFileLoader
+        from conan.internal.loader import ConanFileLoader
         from conan.internal.cache.home_paths import HomePaths
         from conan.internal.conan_app import ConanFileHelpers, CmdWrapper
         cmd_wrap = CmdWrapper(HomePaths(self._conan_api.home_folder).wrapper_path)
diff --git a/conans/client/rest/__init__.py b/conan/internal/rest/__init__.py
similarity index 100%
rename from conans/client/rest/__init__.py
rename to conan/internal/rest/__init__.py
diff --git a/conans/client/rest/auth_manager.py b/conan/internal/rest/auth_manager.py
similarity index 97%
rename from conans/client/rest/auth_manager.py
rename to conan/internal/rest/auth_manager.py
index bb1b4cf1f..299274bb9 100644
--- a/conans/client/rest/auth_manager.py
+++ b/conan/internal/rest/auth_manager.py
@@ -11,8 +11,8 @@ Flow:
 """
 
 from conan.api.output import ConanOutput
-from conans.client.rest.remote_credentials import RemoteCredentials
-from conans.client.rest.rest_client import RestApiClient
+from conan.internal.rest.remote_credentials import RemoteCredentials
+from conan.internal.rest.rest_client import RestApiClient
 from conan.internal.errors import AuthenticationException, ForbiddenException
 from conan.errors import ConanException
 
diff --git a/conans/client/downloaders/caching_file_downloader.py b/conan/internal/rest/caching_file_downloader.py
similarity index 98%
rename from conans/client/downloaders/caching_file_downloader.py
rename to conan/internal/rest/caching_file_downloader.py
index dc6f7f039..3144e60e5 100644
--- a/conans/client/downloaders/caching_file_downloader.py
+++ b/conan/internal/rest/caching_file_downloader.py
@@ -6,8 +6,8 @@ from urllib.request import url2pathname
 
 from conan.api.output import ConanOutput
 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 conan.internal.rest.file_downloader import FileDownloader
+from conan.internal.rest.download_cache import DownloadCache
 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/rest/client_routes.py b/conan/internal/rest/client_routes.py
similarity index 99%
rename from conans/client/rest/client_routes.py
rename to conan/internal/rest/client_routes.py
index 8f085c030..e7de1ba8c 100644
--- a/conans/client/rest/client_routes.py
+++ b/conan/internal/rest/client_routes.py
@@ -1,7 +1,7 @@
 from urllib.parse import urlencode
 
 from conan.api.model import RecipeReference
-from conans.client.rest.rest_routes import RestRoutes
+from conan.internal.rest.rest_routes import RestRoutes
 
 
 def _format_ref(url, ref):
diff --git a/conans/client/rest/conan_requester.py b/conan/internal/rest/conan_requester.py
similarity index 99%
rename from conans/client/rest/conan_requester.py
rename to conan/internal/rest/conan_requester.py
index ffc0fab7c..66a0304be 100644
--- a/conans/client/rest/conan_requester.py
+++ b/conan/internal/rest/conan_requester.py
@@ -13,7 +13,7 @@ from conan.api.output import ConanOutput
 from conan.internal.cache.home_paths import HomePaths
 
 from conan import __version__
-from conans.client.loader import load_python_file
+from conan.internal.loader import load_python_file
 from conan.internal.errors import scoped_traceback
 from conan.errors import ConanException
 
diff --git a/conans/client/downloaders/download_cache.py b/conan/internal/rest/download_cache.py
similarity index 100%
rename from conans/client/downloaders/download_cache.py
rename to conan/internal/rest/download_cache.py
diff --git a/conans/client/downloaders/file_downloader.py b/conan/internal/rest/file_downloader.py
similarity index 99%
rename from conans/client/downloaders/file_downloader.py
rename to conan/internal/rest/file_downloader.py
index c71f14553..27d3eed9e 100644
--- a/conans/client/downloaders/file_downloader.py
+++ b/conan/internal/rest/file_downloader.py
@@ -4,7 +4,7 @@ import time
 
 
 from conan.api.output import ConanOutput, TimedOutput
-from conans.client.rest import response_to_str
+from conan.internal.rest import response_to_str
 from conan.internal.errors import ConanConnectionError, RequestErrorException, AuthenticationException, \
     ForbiddenException, NotFoundException
 from conan.errors import ConanException
diff --git a/conans/client/rest/file_uploader.py b/conan/internal/rest/file_uploader.py
similarity index 99%
rename from conans/client/rest/file_uploader.py
rename to conan/internal/rest/file_uploader.py
index 5005a5c14..1268e4646 100644
--- a/conans/client/rest/file_uploader.py
+++ b/conan/internal/rest/file_uploader.py
@@ -3,7 +3,7 @@ import os
 import time
 
 from conan.api.output import ConanOutput, TimedOutput
-from conans.client.rest import response_to_str
+from conan.internal.rest import response_to_str
 from conan.internal.errors import InternalErrorException, RequestErrorException, AuthenticationException, \
     ForbiddenException, NotFoundException
 from conan.errors import ConanException
diff --git a/conans/client/pkg_sign.py b/conan/internal/rest/pkg_sign.py
similarity index 97%
rename from conans/client/pkg_sign.py
rename to conan/internal/rest/pkg_sign.py
index 40207d362..4f09a205d 100644
--- a/conans/client/pkg_sign.py
+++ b/conan/internal/rest/pkg_sign.py
@@ -2,7 +2,7 @@ import os
 
 from conan.internal.cache.conan_reference_layout import METADATA
 from conan.internal.cache.home_paths import HomePaths
-from conans.client.loader import load_python_file
+from conan.internal.loader import load_python_file
 from conans.util.files import mkdir
 
 
diff --git a/conans/client/rest/remote_credentials.py b/conan/internal/rest/remote_credentials.py
similarity index 98%
rename from conans/client/rest/remote_credentials.py
rename to conan/internal/rest/remote_credentials.py
index a49142c28..2290050ee 100644
--- a/conans/client/rest/remote_credentials.py
+++ b/conan/internal/rest/remote_credentials.py
@@ -7,7 +7,7 @@ from jinja2 import Template
 from conan.api.input import UserInput
 from conan.internal.cache.home_paths import HomePaths
 
-from conans.client.loader import load_python_file
+from conan.internal.loader import load_python_file
 from conan.api.output import ConanOutput
 from conan.internal.errors import scoped_traceback
 from conan.errors import ConanException
diff --git a/conans/client/remote_manager.py b/conan/internal/rest/remote_manager.py
similarity index 98%
rename from conans/client/remote_manager.py
rename to conan/internal/rest/remote_manager.py
index 4f5fff28e..a651c23f3 100644
--- a/conans/client/remote_manager.py
+++ b/conan/internal/rest/remote_manager.py
@@ -5,11 +5,11 @@ from typing import List
 from requests.exceptions import ConnectionError
 
 from conan.api.model import LOCAL_RECIPES_INDEX
-from conans.client.rest_client_local_recipe_index import RestApiClientLocalRecipesIndex
+from conan.internal.rest.rest_client_local_recipe_index import RestApiClientLocalRecipesIndex
 from conan.api.model import Remote
 from conan.api.output import ConanOutput
 from conan.internal.cache.conan_reference_layout import METADATA
-from conans.client.pkg_sign import PkgSignaturesPlugin
+from conan.internal.rest.pkg_sign import PkgSignaturesPlugin
 from conan.internal.errors import ConanConnectionError, NotFoundException, PackageNotFoundException
 from conan.errors import ConanException
 from conan.internal.model.info import load_binary_info
diff --git a/conans/client/rest/rest_client.py b/conan/internal/rest/rest_client.py
similarity index 98%
rename from conans/client/rest/rest_client.py
rename to conan/internal/rest/rest_client.py
index 9bfb86814..678190cfc 100644
--- a/conans/client/rest/rest_client.py
+++ b/conan/internal/rest/rest_client.py
@@ -1,5 +1,5 @@
 from conan.internal import REVISIONS
-from conans.client.rest.rest_client_v2 import RestV2Methods
+from conan.internal.rest.rest_client_v2 import RestV2Methods
 from conan.errors import ConanException
 
 CHECKSUM_DEPLOY = "checksum_deploy"  # capability
diff --git a/conans/client/rest_client_local_recipe_index.py b/conan/internal/rest/rest_client_local_recipe_index.py
similarity index 99%
rename from conans/client/rest_client_local_recipe_index.py
rename to conan/internal/rest/rest_client_local_recipe_index.py
index a5f896def..b824c7b44 100644
--- a/conans/client/rest_client_local_recipe_index.py
+++ b/conan/internal/rest/rest_client_local_recipe_index.py
@@ -10,8 +10,8 @@ from conan.api.model import LOCAL_RECIPES_INDEX
 from conan.api.output import ConanOutput
 from conan.internal.cache.home_paths import HomePaths
 from conan.internal.api.export import cmd_export
-from conans.client.hook_manager import HookManager
-from conans.client.loader import ConanFileLoader
+from conan.internal.hook_manager import HookManager
+from conan.internal.loader import ConanFileLoader
 from conan.internal.errors import ConanReferenceDoesNotExistInDB, NotFoundException, RecipeNotFoundException, \
     PackageNotFoundException
 from conan.errors import ConanException
diff --git a/conans/client/rest/rest_client_v2.py b/conan/internal/rest/rest_client_v2.py
similarity index 98%
rename from conans/client/rest/rest_client_v2.py
rename to conan/internal/rest/rest_client_v2.py
index 45ca3f192..497087dd3 100644
--- a/conans/client/rest/rest_client_v2.py
+++ b/conan/internal/rest/rest_client_v2.py
@@ -9,10 +9,10 @@ from uuid import getnode as get_mac
 
 from conan.api.output import ConanOutput
 
-from conans.client.downloaders.caching_file_downloader import ConanInternalCacheDownloader
-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 conan.internal.rest.caching_file_downloader import ConanInternalCacheDownloader
+from conan.internal.rest import response_to_str
+from conan.internal.rest.client_routes import ClientV2Router
+from conan.internal.rest.file_uploader import FileUploader
 from conan.internal.errors import AuthenticationException, ForbiddenException, NotFoundException, \
     RecipeNotFoundException, PackageNotFoundException, EXCEPTION_CODE_MAPPING
 from conan.errors import ConanException
diff --git a/conans/client/rest/rest_routes.py b/conan/internal/rest/rest_routes.py
similarity index 100%
rename from conans/client/rest/rest_routes.py
rename to conan/internal/rest/rest_routes.py
diff --git a/conan/internal/runner/wsl.py b/conan/internal/runner/wsl.py
index 4d42f97e5..19860447d 100644
--- a/conan/internal/runner/wsl.py
+++ b/conan/internal/runner/wsl.py
@@ -1,8 +1,7 @@
 from pathlib import PurePosixPath, PureWindowsPath, Path
 from conan.api.output import Color, ConanOutput
-from conan.errors import ConanException
 from conans.util.runners import conan_run
-from conans.client.subsystems import subsystem_path
+from conan.internal.subsystems import subsystem_path
 from conan.tools.files import save
 from io import StringIO
 import tempfile
diff --git a/conan/tools/cmake/cmakedeps2/target_configuration.py b/conan/tools/cmake/cmakedeps2/target_configuration.py
index c72a13653..6eead0d31 100644
--- a/conan/tools/cmake/cmakedeps2/target_configuration.py
+++ b/conan/tools/cmake/cmakedeps2/target_configuration.py
@@ -6,7 +6,7 @@ from jinja2 import Template
 
 from conan.errors import ConanException
 from conan.internal.model.pkg_type import PackageType
-from conans.client.graph.graph import CONTEXT_BUILD, CONTEXT_HOST
+from conan.internal.graph.graph import CONTEXT_BUILD, CONTEXT_HOST
 
 
 class TargetConfigurationTemplate2:
diff --git a/conan/tools/cmake/layout.py b/conan/tools/cmake/layout.py
index fbff89c20..9cf75c98a 100644
--- a/conan/tools/cmake/layout.py
+++ b/conan/tools/cmake/layout.py
@@ -1,7 +1,7 @@
 import os
 import tempfile
 
-from conans.client.graph.graph import RECIPE_CONSUMER, RECIPE_EDITABLE
+from conan.internal.graph.graph import RECIPE_CONSUMER, RECIPE_EDITABLE
 from conan.errors import ConanException
 
 
diff --git a/conan/tools/cmake/presets.py b/conan/tools/cmake/presets.py
index cd7e3db27..a45dd8903 100644
--- a/conan/tools/cmake/presets.py
+++ b/conan/tools/cmake/presets.py
@@ -9,7 +9,7 @@ from conan.tools.cmake.toolchain.blocks import GenericSystemBlock
 from conan.tools.cmake.utils import is_multi_configuration
 from conan.tools.build import build_jobs
 from conan.tools.microsoft import is_msvc
-from conans.client.graph.graph import RECIPE_CONSUMER
+from conan.internal.graph.graph import RECIPE_CONSUMER
 from conan.errors import ConanException
 from conans.util.files import save, load
 
diff --git a/conan/tools/cmake/toolchain/blocks.py b/conan/tools/cmake/toolchain/blocks.py
index 694f3a364..01d01fa43 100644
--- a/conan/tools/cmake/toolchain/blocks.py
+++ b/conan/tools/cmake/toolchain/blocks.py
@@ -17,7 +17,7 @@ from conan.tools.cmake.utils import is_multi_configuration
 from conan.tools.intel import IntelCC
 from conan.tools.microsoft.visual import msvc_version_to_toolset_version, msvc_platform_from_arch
 from conan.internal.api.install.generators import relativize_path
-from conans.client.subsystems import deduce_subsystem, WINDOWS
+from conan.internal.subsystems import deduce_subsystem, WINDOWS
 from conan.errors import ConanException
 from conan.internal.model.version import Version
 from conans.util.files import load
diff --git a/conan/tools/cmake/toolchain/toolchain.py b/conan/tools/cmake/toolchain/toolchain.py
index 6abeb5609..8025d96b3 100644
--- a/conan/tools/cmake/toolchain/toolchain.py
+++ b/conan/tools/cmake/toolchain/toolchain.py
@@ -22,7 +22,7 @@ from conan.tools.microsoft import VCVars
 from conan.tools.microsoft.visual import vs_ide_version
 from conan.errors import ConanException
 from conan.internal.model.options import _PackageOption
-from conans.client.graph.graph import RECIPE_CONSUMER, RECIPE_EDITABLE
+from conan.internal.graph.graph import RECIPE_CONSUMER, RECIPE_EDITABLE
 from conans.util.files import save
 
 
diff --git a/conan/tools/env/environment.py b/conan/tools/env/environment.py
index 8659141c5..695edfe6e 100644
--- a/conan/tools/env/environment.py
+++ b/conan/tools/env/environment.py
@@ -5,7 +5,7 @@ from contextlib import contextmanager
 
 from conan.api.output import ConanOutput
 from conan.internal.api.install.generators import relativize_paths
-from conans.client.subsystems import deduce_subsystem, WINDOWS, subsystem_path
+from conan.internal.subsystems import deduce_subsystem, WINDOWS, subsystem_path
 from conan.errors import ConanException
 from conan.internal.model.recipe_ref import ref_matches
 from conans.util.files import save
diff --git a/conan/tools/files/files.py b/conan/tools/files/files.py
index 2a05d0af5..87148a3c6 100644
--- a/conan/tools/files/files.py
+++ b/conan/tools/files/files.py
@@ -10,9 +10,9 @@ from fnmatch import fnmatch
 from shutil import which
 
 
-from conans.client.downloaders.caching_file_downloader import SourcesCachingDownloader
+from conan.internal.rest.caching_file_downloader import SourcesCachingDownloader
 from conan.errors import ConanException
-from conans.client.rest.file_uploader import FileProgress
+from conan.internal.rest.file_uploader import FileProgress
 from conans.util.files import rmdir as _internal_rmdir, human_size, check_with_algorithm_sum
 
 
diff --git a/conan/tools/gnu/autotools.py b/conan/tools/gnu/autotools.py
index d058c8a47..d25dfb905 100644
--- a/conan/tools/gnu/autotools.py
+++ b/conan/tools/gnu/autotools.py
@@ -2,7 +2,7 @@ import os
 import re
 
 from conan.tools.build import build_jobs, cmd_args_to_string, load_toolchain_args
-from conans.client.subsystems import subsystem_path, deduce_subsystem
+from conan.internal.subsystems import subsystem_path, deduce_subsystem
 from conan.tools.files import chdir
 from conan.tools.microsoft import unix_path
 
diff --git a/conan/tools/gnu/gnudeps_flags.py b/conan/tools/gnu/gnudeps_flags.py
index ba9d399f4..ed3a00198 100644
--- a/conan/tools/gnu/gnudeps_flags.py
+++ b/conan/tools/gnu/gnudeps_flags.py
@@ -5,7 +5,7 @@
 
 from conan.tools.apple.apple import is_apple_os
 from conan.tools.microsoft import is_msvc
-from conans.client.subsystems import subsystem_path, deduce_subsystem
+from conan.internal.subsystems import subsystem_path, deduce_subsystem
 
 
 class GnuDepsFlags(object):
diff --git a/conan/tools/microsoft/subsystems.py b/conan/tools/microsoft/subsystems.py
index 5d6a73b7e..b8a57a714 100644
--- a/conan/tools/microsoft/subsystems.py
+++ b/conan/tools/microsoft/subsystems.py
@@ -1,4 +1,4 @@
-from conans.client.subsystems import deduce_subsystem, subsystem_path
+from conan.internal.subsystems import deduce_subsystem, subsystem_path
 
 
 def unix_path(conanfile, path, scope="build"):
diff --git a/conan/tools/system/package_manager.py b/conan/tools/system/package_manager.py
index aebd9f855..570744d5e 100644
--- a/conan/tools/system/package_manager.py
+++ b/conan/tools/system/package_manager.py
@@ -1,7 +1,7 @@
 import platform
 
 from conan.tools.build import cross_building
-from conans.client.graph.graph import CONTEXT_BUILD
+from conan.internal.graph.graph import CONTEXT_BUILD
 from conan.errors import ConanException
 
 
diff --git a/conans/client/downloaders/__init__.py b/conans/client/downloaders/__init__.py
deleted file mode 100644
index e69de29bb..000000000
diff --git a/conans/client/graph/__init__.py b/conans/client/graph/__init__.py
deleted file mode 100644
index e69de29bb..000000000
diff --git a/conans/client/loader_txt.py b/conans/client/loader_txt.py
deleted file mode 100644
index 10e70b3ea..000000000
--- a/conans/client/loader_txt.py
+++ /dev/null
@@ -1,53 +0,0 @@
-from conan.errors import ConanException
-from conans.util.config_parser import ConfigParser
-
-
-class ConanFileTextLoader(object):
-    """Parse a conanfile.txt file"""
-
-    def __init__(self, input_text):
-        # Prefer composition over inheritance, the __getattr__ was breaking things
-        self._config_parser = ConfigParser(input_text,  ["requires", "generators", "options",
-                                                         "imports", "tool_requires", "test_requires",
-                                                         "layout"],
-                                           strip_comments=True)
-
-    @property
-    def layout(self):
-        """returns the declared layout"""
-        tmp = [r.strip() for r in self._config_parser.layout.splitlines()]
-        if len(tmp) > 1:
-            raise ConanException("Only one layout can be declared in the [layout] section of "
-                                 "the conanfile.txt")
-        return tmp[0] if tmp else None
-
-    @property
-    def requirements(self):
-        """returns a list of requires
-        EX:  "OpenCV/2.4.10@phil/stable"
-        """
-        return [r.strip() for r in self._config_parser.requires.splitlines()]
-
-    @property
-    def tool_requirements(self):
-        """returns a list of tool_requires
-        EX:  "OpenCV/2.4.10@phil/stable"
-        """
-
-        return [r.strip() for r in self._config_parser.tool_requires.splitlines()]
-
-    @property
-    def test_requirements(self):
-        """returns a list of test_requires
-        EX:  "gtest/2.4.10@phil/stable"
-        """
-
-        return [r.strip() for r in self._config_parser.test_requires.splitlines()]
-
-    @property
-    def options(self):
-        return self._config_parser.options
-
-    @property
-    def generators(self):
-        return self._config_parser.generators.splitlines()
diff --git a/conans/migrations.py b/conans/migrations.py
index 96056c9e1..809e4b4a3 100644
--- a/conans/migrations.py
+++ b/conans/migrations.py
@@ -2,7 +2,7 @@ import os
 
 from conan import conan_version
 from conan.api.output import ConanOutput
-from conans.client.loader import load_python_file
+from conan.internal.loader import load_python_file
 from conan.errors import ConanException, ConanMigrationError
 from conan.internal.model.version import Version
 from conans.util.files import load, save
diff --git a/conans/server/rest/bottle_routes.py b/conans/server/rest/bottle_routes.py
index 6252b835a..c267ee14e 100644
--- a/conans/server/rest/bottle_routes.py
+++ b/conans/server/rest/bottle_routes.py
@@ -1,4 +1,4 @@
-from conans.client.rest.rest_routes import RestRoutes
+from conan.internal.rest.rest_routes import RestRoutes
 
 
 class BottleRoutes(RestRoutes):


Test patch:
diff --git a/conans/client/source.py b/conan/internal/source.py
similarity index 100%
rename from conans/client/source.py
rename to conan/internal/source.py
diff --git a/conans/client/subsystems.py b/conan/internal/subsystems.py
similarity index 100%
rename from conans/client/subsystems.py
rename to conan/internal/subsystems.py
diff --git a/conan/test/utils/test_files.py b/conan/test/utils/test_files.py
index d45701752..7a77387ae 100644
--- a/conan/test/utils/test_files.py
+++ b/conan/test/utils/test_files.py
@@ -9,7 +9,7 @@ import time
 from io import BytesIO
 
 from conan.tools.files.files import untargz
-from conans.client.subsystems import get_cased_path
+from conan.internal.subsystems import get_cased_path
 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 ac819dcf5..5aa567e09 100644
--- a/conan/test/utils/tools.py
+++ b/conan/test/utils/tools.py
@@ -505,7 +505,7 @@ class TestClient:
     @contextmanager
     def mocked_servers(self, requester=None):
         _req = requester or TestRequester(self.servers)
-        with mock.patch("conans.client.rest.conan_requester.requests", _req):
+        with mock.patch("conan.internal.rest.conan_requester.requests", _req):
             yield
 
     @contextmanager
diff --git a/test/functional/command/config_install_test.py b/test/functional/command/config_install_test.py
index 0b18240f4..89f831e92 100644
--- a/test/functional/command/config_install_test.py
+++ b/test/functional/command/config_install_test.py
@@ -10,7 +10,7 @@ from mock import patch
 
 from conan.api.model import Remote
 from conan.internal.api.config.config_installer import _hide_password
-from conans.client.downloaders.file_downloader import FileDownloader
+from conan.internal.rest.file_downloader import FileDownloader
 from conan.internal.paths import DEFAULT_CONAN_HOME
 from conan.test.assets.genconanfile import GenConanfile
 from conan.test.utils.file_server import TestFileServer
diff --git a/test/integration/cache/backup_sources_test.py b/test/integration/cache/backup_sources_test.py
index 4bff228e9..a7dd401b0 100644
--- a/test/integration/cache/backup_sources_test.py
+++ b/test/integration/cache/backup_sources_test.py
@@ -23,7 +23,7 @@ class TestDownloadCacheBackupSources:
             assert not url.startswith("http://myback")
             save(filepath, f"Hello, world!")
 
-        with mock.patch("conans.client.downloaders.file_downloader.FileDownloader.download",
+        with mock.patch("conan.internal.rest.file_downloader.FileDownloader.download",
                         custom_download):
             client = TestClient(default_server_user=True, light=True)
             tmp_folder = temp_folder()
@@ -514,7 +514,7 @@ class TestDownloadCacheBackupSources:
         def custom_download(this, url, *args, **kwargs):
             raise NotFoundException()
 
-        with mock.patch("conans.client.downloaders.file_downloader.FileDownloader.download",
+        with mock.patch("conan.internal.rest.file_downloader.FileDownloader.download",
                         custom_download):
             client = TestClient(default_server_user=True, light=True)
             download_cache_folder = temp_folder()
@@ -829,7 +829,7 @@ class TestDownloadCacheBackupSources:
 
         self.client.save({"conanfile.py": conanfile})
 
-        with mock.patch("conans.client.downloaders.file_downloader.FileDownloader._download_file",
+        with mock.patch("conan.internal.rest.file_downloader.FileDownloader._download_file",
                         custom_download):
             self.client.run("source .", assert_error=True)
             # The mock does not actually download a file, let's add it for the test
@@ -871,7 +871,7 @@ class TestDownloadCacheBackupSources:
                             f"core.sources:upload_url={self.file_server.fake_url}/backup/"})
 
         self.client.save({"conanfile.py": conanfile})
-        with mock.patch("conans.client.downloaders.file_downloader.FileDownloader._download_file",
+        with mock.patch("conan.internal.rest.file_downloader.FileDownloader._download_file",
                         custom_download):
             self.client.run("source .", assert_error=True)
 
diff --git a/test/integration/command/download/download_test.py b/test/integration/command/download/download_test.py
index fa54af2f4..f33714def 100644
--- a/test/integration/command/download/download_test.py
+++ b/test/integration/command/download/download_test.py
@@ -93,7 +93,7 @@ def test_download_verify_ssl_conf():
     def custom_download(this, url, filepath, *args, **kwargs):
         did_verify[url] = args[2]
 
-    with mock.patch("conans.client.downloaders.file_downloader.FileDownloader.download",
+    with mock.patch("conan.internal.rest.file_downloader.FileDownloader.download",
                     custom_download):
         client.run("create . -c tools.files.download:verify=True")
         assert did_verify["http://verify.true"]
diff --git a/test/integration/command/test_remote_users.py b/test/integration/command/test_remote_users.py
index a1f4106a1..9e2ad9bd7 100644
--- a/test/integration/command/test_remote_users.py
+++ b/test/integration/command/test_remote_users.py
@@ -364,7 +364,7 @@ class TestRemoteAuth:
         c = TestClient(servers=servers, inputs=["lasote", "mypass", "danimtb", "passpass",
                                                 "lasote", "mypass"])
 
-        with patch("conans.client.rest.rest_client_v2.RestV2Methods.check_credentials") as check_credentials_mock:
+        with patch("conan.internal.rest.rest_client_v2.RestV2Methods.check_credentials") as check_credentials_mock:
             c.run("remote auth --force *")
             check_credentials_mock.assert_called_with(True)
 
@@ -375,7 +375,7 @@ class TestRemoteAuth:
         c = TestClient(servers=servers, inputs=["lasote", "mypass", "danimtb", "passpass",
                                                 "lasote", "mypass"])
 
-        with patch("conans.client.rest.rest_client_v2.RestV2Methods.check_credentials") as check_credentials_mock:
+        with patch("conan.internal.rest.rest_client_v2.RestV2Methods.check_credentials") as check_credentials_mock:
             c.run("remote auth *")
             check_credentials_mock.assert_called_with(False)
 
diff --git a/test/integration/configuration/requester_test.py b/test/integration/configuration/requester_test.py
index ee0e9ba65..a1a822a83 100644
--- a/test/integration/configuration/requester_test.py
+++ b/test/integration/configuration/requester_test.py
@@ -5,7 +5,7 @@ import mock
 from mock import Mock, MagicMock
 
 from conan import __version__
-from conans.client.rest.conan_requester import ConanRequester
+from conan.internal.rest.conan_requester import ConanRequester
 from conan.internal.model.conf import ConfDefinition
 from conan.test.utils.tools import temp_folder
 from conans.util.files import save
@@ -21,14 +21,14 @@ class MockRequesterGet(Mock):
 class ConanRequesterCacertPathTests(unittest.TestCase):
     def test_default_no_verify(self):
         mocked_requester = MockRequesterGet()
-        with mock.patch("conans.client.rest.conan_requester.requests", mocked_requester):
+        with mock.patch("conan.internal.rest.conan_requester.requests", mocked_requester):
             requester = ConanRequester(ConfDefinition())
             requester.get(url="aaa", verify=False)
             self.assertEqual(requester._http_requester.verify, False)
 
     def test_default_verify(self):
         mocked_requester = MockRequesterGet()
-        with mock.patch("conans.client.rest.conan_requester.requests", mocked_requester):
+        with mock.patch("conan.internal.rest.conan_requester.requests", mocked_requester):
             requester = ConanRequester(ConfDefinition())
             requester.get(url="aaa", verify=True)
             self.assertEqual(requester._http_requester.verify, True)
@@ -39,7 +39,7 @@ class ConanRequesterCacertPathTests(unittest.TestCase):
         config = ConfDefinition()
         config.update("core.net.http:cacert_path", file_path)
         mocked_requester = MockRequesterGet()
-        with mock.patch("conans.client.rest.conan_requester.requests", mocked_requester):
+        with mock.patch("conan.internal.rest.conan_requester.requests", mocked_requester):
             requester = ConanRequester(config)
             requester.get(url="bbbb", verify=True)
         self.assertEqual(requester._http_requester.verify, file_path)
@@ -48,7 +48,7 @@ class ConanRequesterCacertPathTests(unittest.TestCase):
 class ConanRequesterHeadersTests(unittest.TestCase):
     def test_user_agent(self):
         mock_http_requester = MagicMock()
-        with mock.patch("conans.client.rest.conan_requester.requests", mock_http_requester):
+        with mock.patch("conan.internal.rest.conan_requester.requests", mock_http_requester):
             requester = ConanRequester(ConfDefinition())
             requester.get(url="aaa")
             headers = requester._http_requester.get.call_args[1]["headers"]
diff --git a/test/integration/graph/core/graph_manager_test.py b/test/integration/graph/core/graph_manager_test.py
index 4e226b7bb..4b351bc07 100644
--- a/test/integration/graph/core/graph_manager_test.py
+++ b/test/integration/graph/core/graph_manager_test.py
@@ -1,7 +1,7 @@
 import pytest
 from parameterized import parameterized
 
-from conans.client.graph.graph_error import GraphMissingError, GraphLoopError, GraphConflictError
+from conan.internal.graph.graph_error import GraphMissingError, GraphLoopError, GraphConflictError
 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/core/test_build_requires.py b/test/integration/graph/core/test_build_requires.py
index f0db19fff..b806d09c9 100644
--- a/test/integration/graph/core/test_build_requires.py
+++ b/test/integration/graph/core/test_build_requires.py
@@ -4,7 +4,7 @@ import pytest
 
 from parameterized import parameterized
 
-from conans.client.graph.graph_error import GraphConflictError, GraphLoopError, GraphRuntimeError
+from conan.internal.graph.graph_error import GraphConflictError, GraphLoopError, GraphRuntimeError
 from conan.api.model import RecipeReference
 from test.integration.graph.core.graph_manager_base import GraphManagerTest
 from conan.test.utils.tools import GenConanfile, NO_SETTINGS_PACKAGE_ID, TestClient
diff --git a/test/integration/graph/core/test_provides.py b/test/integration/graph/core/test_provides.py
index da20d4f4a..adf2b9bb8 100644
--- a/test/integration/graph/core/test_provides.py
+++ b/test/integration/graph/core/test_provides.py
@@ -2,7 +2,7 @@ import textwrap
 
 from parameterized import parameterized
 
-from conans.client.graph.graph_error import GraphProvidesError
+from conan.internal.graph.graph_error import GraphProvidesError
 from test.integration.graph.core.graph_manager_base import GraphManagerTest
 from test.integration.graph.core.graph_manager_test import _check_transitive
 from conan.test.utils.tools import GenConanfile, TestClient
diff --git a/test/integration/graph/core/test_version_ranges.py b/test/integration/graph/core/test_version_ranges.py
index 98a10595c..7e4a9ec04 100644
--- a/test/integration/graph/core/test_version_ranges.py
+++ b/test/integration/graph/core/test_version_ranges.py
@@ -2,7 +2,7 @@ from collections import OrderedDict
 import pytest
 
 from conan.api.model import Remote
-from conans.client.graph.graph_error import GraphConflictError, GraphMissingError
+from conan.internal.graph.graph_error import GraphConflictError, GraphMissingError
 from conan.test.assets.genconanfile import GenConanfile
 from test.integration.graph.core.graph_manager_base import GraphManagerTest
 from conan.test.utils.tools import TestClient, TestServer, NO_SETTINGS_PACKAGE_ID
diff --git a/test/integration/graph/version_ranges/version_ranges_cached_test.py b/test/integration/graph/version_ranges/version_ranges_cached_test.py
index 8000b4a05..c7e9357b4 100644
--- a/test/integration/graph/version_ranges/version_ranges_cached_test.py
+++ b/test/integration/graph/version_ranges/version_ranges_cached_test.py
@@ -3,7 +3,7 @@ from collections import OrderedDict
 import pytest
 from mock import patch
 
-from conans.client.remote_manager import RemoteManager
+from conan.internal.rest.remote_manager import RemoteManager
 from conan.api.model import RecipeReference
 from conan.test.assets.genconanfile import GenConanfile
 from conan.test.utils.tools import TestClient, TestServer
diff --git a/test/integration/metadata/test_metadata_collect.py b/test/integration/metadata/test_metadata_collect.py
index f46744511..2c140069d 100644
--- a/test/integration/metadata/test_metadata_collect.py
+++ b/test/integration/metadata/test_metadata_collect.py
@@ -17,7 +17,7 @@ from conan.cli.args import common_graph_args, validate_common_graph_args
 from conan.cli.printers import print_profiles
 from conan.cli.printers.graph import print_graph_packages, print_graph_basic
 # TODO, fix private API
-from conans.client.graph.install_graph import InstallGraph
+from conan.internal.graph.install_graph import InstallGraph
 
 
 @conan_command(group="Metadata")
diff --git a/test/integration/package_id/test_validate.py b/test/integration/package_id/test_validate.py
index 71e778fb1..5db5b7532 100644
--- a/test/integration/package_id/test_validate.py
+++ b/test/integration/package_id/test_validate.py
@@ -8,7 +8,7 @@ import unittest
 import pytest
 
 from conan.cli.exit_codes import ERROR_INVALID_CONFIGURATION, ERROR_GENERAL
-from conans.client.graph.graph import BINARY_INVALID
+from conan.internal.graph.graph import BINARY_INVALID
 from conan.test.assets.genconanfile import GenConanfile
 from conans.util.files import save, load
 from conan.test.utils.tools import TestClient, NO_SETTINGS_PACKAGE_ID
diff --git a/test/integration/remote/rest_api_test.py b/test/integration/remote/rest_api_test.py
index 9c5d704c7..fd44c0f41 100644
--- a/test/integration/remote/rest_api_test.py
+++ b/test/integration/remote/rest_api_test.py
@@ -12,8 +12,8 @@ from conan.test.utils.env import environment_update
 from conan.test.utils.server_launcher import TestServerLauncher
 from conan.test.utils.test_files import temp_folder
 from conan.test.utils.tools import get_free_port
-from conans.client.rest.conan_requester import ConanRequester
-from conans.client.rest.rest_client import RestApiClient
+from conan.internal.rest.conan_requester import ConanRequester
+from conan.internal.rest.rest_client import RestApiClient
 from conans.util.files import md5, save
 
 
diff --git a/test/integration/remote/retry_test.py b/test/integration/remote/retry_test.py
index 4652aa0bd..fe2387123 100644
--- a/test/integration/remote/retry_test.py
+++ b/test/integration/remote/retry_test.py
@@ -4,7 +4,7 @@ from collections import namedtuple, Counter
 
 from requests.exceptions import HTTPError
 
-from conans.client.rest.file_uploader import FileUploader
+from conan.internal.rest.file_uploader import FileUploader
 from conan.internal.errors import AuthenticationException, ForbiddenException
 from conan.test.utils.mocks import RedirectedTestOutput
 from conan.test.utils.test_files import temp_folder
diff --git a/test/integration/test_migrations.py b/test/integration/test_migrations.py
index 7e9441b4b..59b82744c 100644
--- a/test/integration/test_migrations.py
+++ b/test/integration/test_migrations.py
@@ -9,7 +9,7 @@ from conan import conan_version
 from conan.test.assets.genconanfile import GenConanfile
 from conan.test.utils.test_files import temp_folder
 from conan.test.utils.tools import TestClient
-from conans.client.migrations import ClientMigrator
+from conan.internal.api.migrations import ClientMigrator
 from conan.internal.model.version import Version
 from conans.util.files import save, load
 
diff --git a/test/integration/test_source_download_password.py b/test/integration/test_source_download_password.py
index 3a116e826..6bca7c56c 100644
--- a/test/integration/test_source_download_password.py
+++ b/test/integration/test_source_download_password.py
@@ -80,7 +80,7 @@ def test_source_credentials_only_download():
     c.save({"conanfile.py": GenConanfile("pkg", "0.1")})
     c.run("create .")
     # add_auth should never be called for regular upload/download
-    with mock.patch("conans.client.rest.conan_requester._SourceURLCredentials.add_auth", None):
+    with mock.patch("conan.internal.rest.conan_requester._SourceURLCredentials.add_auth", None):
         c.run("upload * -c -r=default")
         c.run("remove * -c")
         c.run("download pkg/0.1 -r=default")
diff --git a/test/integration/tgz_macos_dot_files_test.py b/test/integration/tgz_macos_dot_files_test.py
index ebf62b59f..b8eee0ac8 100644
--- a/test/integration/tgz_macos_dot_files_test.py
+++ b/test/integration/tgz_macos_dot_files_test.py
@@ -8,7 +8,7 @@ import unittest
 
 import pytest
 
-from conans.client.remote_manager import uncompress_file
+from conan.internal.rest.remote_manager import uncompress_file
 from conan.api.model import RecipeReference
 from conan.internal.paths import EXPORT_SOURCES_TGZ_NAME
 from conan.test.utils.tools import TestClient, NO_SETTINGS_PACKAGE_ID
diff --git a/test/unittests/client/conanfile_loader_test.py b/test/unittests/client/conanfile_loader_test.py
index c27fc2655..7b766b1c1 100644
--- a/test/unittests/client/conanfile_loader_test.py
+++ b/test/unittests/client/conanfile_loader_test.py
@@ -6,7 +6,7 @@ import unittest
 import pytest
 from parameterized import parameterized
 
-from conans.client.loader import ConanFileLoader, ConanFileTextLoader, load_python_file
+from conan.internal.loader import ConanFileLoader, ConanFileTextLoader, load_python_file
 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 65418d984..7ecf1e471 100644
--- a/test/unittests/client/graph/build_mode_test.py
+++ b/test/unittests/client/graph/build_mode_test.py
@@ -1,6 +1,6 @@
 import pytest
 
-from conans.client.graph.build_mode import BuildMode
+from conan.internal.graph.build_mode import BuildMode
 from conan.errors import ConanException
 from conan.api.model import RecipeReference
 from conan.test.utils.mocks import ConanFileMock, RedirectedTestOutput
diff --git a/test/unittests/client/graph/deps_graph_test.py b/test/unittests/client/graph/deps_graph_test.py
index 384bcf898..781ad2311 100644
--- a/test/unittests/client/graph/deps_graph_test.py
+++ b/test/unittests/client/graph/deps_graph_test.py
@@ -2,8 +2,8 @@ import unittest
 
 from mock import Mock
 
-from conans.client.graph.graph import CONTEXT_HOST
-from conans.client.graph.graph_builder import DepsGraph, Node
+from conan.internal.graph.graph import CONTEXT_HOST
+from conan.internal.graph.graph_builder import DepsGraph, Node
 from conan.internal.model.conan_file import ConanFile
 from conan.api.model import RecipeReference
 
diff --git a/test/unittests/client/rest/downloader_test.py b/test/unittests/client/rest/downloader_test.py
index efdf530ac..c584c4395 100644
--- a/test/unittests/client/rest/downloader_test.py
+++ b/test/unittests/client/rest/downloader_test.py
@@ -5,7 +5,7 @@ import unittest
 
 import pytest
 
-from conans.client.downloaders.file_downloader import FileDownloader
+from conan.internal.rest.file_downloader import FileDownloader
 from conan.errors import ConanException
 
 
diff --git a/test/unittests/client/rest/response_test.py b/test/unittests/client/rest/response_test.py
index 332818c87..8a1d85b4f 100644
--- a/test/unittests/client/rest/response_test.py
+++ b/test/unittests/client/rest/response_test.py
@@ -2,7 +2,7 @@
 
 import unittest
 from collections import namedtuple
-from conans.client import rest
+from conan.internal import rest
 
 
 class RestStringTest(unittest.TestCase):
diff --git a/test/unittests/client/rest/rest_client_v2/rest_client_v2_test.py b/test/unittests/client/rest/rest_client_v2/rest_client_v2_test.py
index bfd7e6401..96f009d74 100644
--- a/test/unittests/client/rest/rest_client_v2/rest_client_v2_test.py
+++ b/test/unittests/client/rest/rest_client_v2/rest_client_v2_test.py
@@ -1,8 +1,8 @@
-from conans.client.rest.rest_client_v2 import RestV2Methods
-from mock import ANY, MagicMock, patch
+from conan.internal.rest.rest_client_v2 import RestV2Methods
+from mock import MagicMock, patch
 
 
-@patch("conans.client.rest.conan_requester.ConanRequester")
+@patch("conan.internal.rest.conan_requester.ConanRequester")
 def test_check_credentials_set_token_to_unset_with_force_auth_true_and_token_none(
     conanRequesterMock,
 ):
@@ -16,7 +16,7 @@ def test_check_credentials_set_token_to_unset_with_force_auth_true_and_token_non
     assert conanRequesterMock.get.call_args[1]["auth"].bearer == "Bearer unset"
 
 
-@patch("conans.client.rest.conan_requester.ConanRequester")
+@patch("conan.internal.rest.conan_requester.ConanRequester")
 def test_check_credentials_keep_token_none_with_force_auth_false_and_token_none(
     conanRequesterMock,
 ):
diff --git a/test/unittests/client/rest/uploader_test.py b/test/unittests/client/rest/uploader_test.py
index 5889cbf4f..6d3816292 100644
--- a/test/unittests/client/rest/uploader_test.py
+++ b/test/unittests/client/rest/uploader_test.py
@@ -2,7 +2,7 @@ import tempfile
 import unittest
 from collections import namedtuple
 
-from conans.client.rest.file_uploader import FileUploader
+from conan.internal.rest.file_uploader import FileUploader
 from conan.internal.errors import InternalErrorException, AuthenticationException, ForbiddenException
 from conans.util.files import save
 
diff --git a/test/unittests/tools/env/test_env.py b/test/unittests/tools/env/test_env.py
index eb916ae94..1b76e01a1 100644
--- a/test/unittests/tools/env/test_env.py
+++ b/test/unittests/tools/env/test_env.py
@@ -8,7 +8,7 @@ import pytest
 from conan.errors import ConanException
 from conan.tools.env import Environment
 from conan.tools.env.environment import ProfileEnvironment
-from conans.client.subsystems import WINDOWS
+from conan.internal.subsystems import WINDOWS
 from conan.api.model import RecipeReference
 from conan.test.utils.mocks import ConanFileMock, MockSettings
 from conan.test.utils.test_files import temp_folder
diff --git a/test/unittests/tools/env/test_env_files.py b/test/unittests/tools/env/test_env_files.py
index 9feb80cd8..6fbd137ff 100644
--- a/test/unittests/tools/env/test_env_files.py
+++ b/test/unittests/tools/env/test_env_files.py
@@ -7,7 +7,7 @@ import textwrap
 import pytest
 
 from conan.tools.env import Environment
-from conans.client.subsystems import WINDOWS
+from conan.internal.subsystems import WINDOWS
 from conan.test.utils.mocks import ConanFileMock
 from conan.test.utils.test_files import temp_folder
 from conans.util.files import save, chdir, load
diff --git a/test/unittests/tools/files_patch_test.py b/test/unittests/tools/files_patch_test.py
index 6d7c95e56..a636ab5b7 100644
--- a/test/unittests/tools/files_patch_test.py
+++ b/test/unittests/tools/files_patch_test.py
@@ -4,7 +4,7 @@ from textwrap import dedent
 
 from parameterized.parameterized import parameterized
 
-from conans.client.loader import ConanFileLoader
+from conan.internal.loader import ConanFileLoader
 from conan.test.utils.test_files import temp_folder
 from conan.test.utils.tools import TestClient
 from conans.util.files import save, load
diff --git a/test/unittests/util/unix_path_test.py b/test/unittests/util/unix_path_test.py
index cd22fdfa6..d5e8e9ae2 100644
--- a/test/unittests/util/unix_path_test.py
+++ b/test/unittests/util/unix_path_test.py
@@ -5,7 +5,7 @@ import unittest
 import pytest
 
 from conan.tools.microsoft.subsystems import subsystem_path
-from conans.client.subsystems import get_cased_path
+from conan.internal.subsystems import get_cased_path
 from conan.test.utils.test_files import temp_folder
 from conans.util.files import mkdir