Skip to content

Commit

Permalink
refactor moving model conans->conan (#17572)
Browse files Browse the repository at this point in the history
* refactor moving model conans->conan

* fix tests
  • Loading branch information
memsharded authored Jan 14, 2025
1 parent 8ea8174 commit 13d4c3d
Show file tree
Hide file tree
Showing 213 changed files with 321 additions and 328 deletions.
6 changes: 3 additions & 3 deletions conan/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conans.model.conan_file import ConanFile
from conan.tools.scm import Version as _Version
from conan.internal.model.conan_file import ConanFile
from conan.internal.model.version import Version

__version__ = '2.12.0-dev'
conan_version = _Version(__version__)
conan_version = Version(__version__)
2 changes: 1 addition & 1 deletion conan/api/conan_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from conans.client.migrations import ClientMigrator
from conan.errors import ConanException
from conan.internal.paths import get_conan_user_home
from conans.model.version_range import validate_conan_version
from conan.internal.model.version_range import validate_conan_version


class ConanAPI:
Expand Down
6 changes: 3 additions & 3 deletions conan/api/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
RECIPE_VIRTUAL, BINARY_SKIP, BINARY_MISSING, BINARY_INVALID
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 conan.internal.model.package_ref import PkgReference
from conan.internal.model.recipe_ref import RecipeReference
from conans.util.files import load
from conans.model.version_range import VersionRange
from conan.internal.model.version_range import VersionRange

LOCAL_RECIPES_INDEX = "local-recipes-index"

Expand Down
4 changes: 2 additions & 2 deletions conan/api/subapi/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from conan.internal.cache.integrity_check import IntegrityChecker
from conans.client.downloaders.download_cache import DownloadCache
from conan.errors import ConanException
from conans.model.package_ref import PkgReference
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.package_ref import PkgReference
from conan.internal.model.recipe_ref import RecipeReference
from conans.util.dates import revision_timestamp_now
from conans.util.files import rmdir, gzopen_without_timestamps, mkdir, remove

Expand Down
8 changes: 4 additions & 4 deletions conan/api/subapi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
from conans.client.graph.graph_builder import DepsGraphBuilder
from conans.client.graph.profile_node_definer import consumer_definer
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
from conans.model.settings import Settings
from conan.internal.model.conf import ConfDefinition, BUILT_IN_CONFS
from conan.internal.model.pkg_type import PackageType
from conan.internal.model.recipe_ref import RecipeReference
from conan.internal.model.settings import Settings
from conans.util.files import load, save


Expand Down
4 changes: 2 additions & 2 deletions conan/api/subapi/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from conan.api.output import ConanOutput
from conan.internal.conan_app import ConanBasicApp
from conan.errors import ConanException
from conans.model.package_ref import PkgReference
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.package_ref import PkgReference
from conan.internal.model.recipe_ref import RecipeReference


class DownloadAPI:
Expand Down
2 changes: 1 addition & 1 deletion conan/api/subapi/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from conan.internal.methods import run_package_method
from conans.client.graph.graph import BINARY_BUILD, RECIPE_INCACHE
from conans.client.hook_manager import HookManager
from conans.model.package_ref import PkgReference
from conan.internal.model.package_ref import PkgReference
from conans.util.files import mkdir


Expand Down
2 changes: 1 addition & 1 deletion conan/api/subapi/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from conans.client.graph.graph_builder import DepsGraphBuilder
from conans.client.graph.profile_node_definer import initialize_conanfile_profile, consumer_definer
from conan.errors import ConanException
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.recipe_ref import RecipeReference


class GraphAPI:
Expand Down
6 changes: 3 additions & 3 deletions conan/api/subapi/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from conan.internal.paths import CONANINFO
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
from conan.internal.model.info import load_binary_info
from conan.internal.model.package_ref import PkgReference
from conan.internal.model.recipe_ref import RecipeReference, ref_matches
from conans.util.dates import timelimit
from conans.util.files import load

Expand Down
2 changes: 1 addition & 1 deletion conan/api/subapi/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from conan.internal.errors import conanfile_exception_formatter
from conan.errors import ConanException
from conans.client.hook_manager import HookManager
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.recipe_ref import RecipeReference
from conans.util.files import chdir


Expand Down
2 changes: 1 addition & 1 deletion conan/api/subapi/lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from conan.cli import make_abs_path
from conans.client.graph.graph import Overrides
from conan.errors import ConanException
from conans.model.graph_lock import Lockfile, LOCKFILE
from conan.internal.model.lockfile import Lockfile, LOCKFILE


class LockfileAPI:
Expand Down
2 changes: 1 addition & 1 deletion conan/api/subapi/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from conan.internal.api.profile.profile_loader import ProfileLoader
from conan.internal.errors import scoped_traceback
from conan.errors import ConanException
from conans.model.profile import Profile
from conan.internal.model.profile import Profile

DEFAULT_PROFILE_NAME = "default"

Expand Down
4 changes: 2 additions & 2 deletions conan/api/subapi/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from conan.api.model import Remote
from conan.internal.conan_app import ConanBasicApp
from conans.model.package_ref import PkgReference
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.package_ref import PkgReference
from conan.internal.model.recipe_ref import RecipeReference


class RemoveAPI:
Expand Down
2 changes: 1 addition & 1 deletion conan/api/subapi/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from conan.errors import ConanException
from conans.client.graph.graph import RECIPE_EDITABLE
from conans.client.source import retrieve_exports_sources
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.recipe_ref import RecipeReference
from conans.util.files import merge_directories


Expand Down
4 changes: 2 additions & 2 deletions conan/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from conan.api.output import ConanOutput
from conan.errors import ConanException
from conans.model.conf import CORE_CONF_PATTERN
from conan.internal.model.conf import CORE_CONF_PATTERN


class OnceArgument(argparse.Action):
Expand Down Expand Up @@ -126,7 +126,7 @@ def parse_args(self, args=None, namespace=None):
ConanOutput().error("The --lockfile-packages arg is private and shouldn't be used")
global_conf = self._conan_api.config.global_conf
if args.core_conf:
from conans.model.conf import ConfDefinition
from conan.internal.model.conf import ConfDefinition
confs = ConfDefinition()
for c in args.core_conf:
if not CORE_CONF_PATTERN.match(c):
Expand Down
4 changes: 2 additions & 2 deletions conan/cli/commands/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from conan.cli.command import conan_command, conan_subcommand, OnceArgument
from conan.cli.commands.list import print_list_text, print_list_json
from conan.errors import ConanException
from conans.model.package_ref import PkgReference
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.package_ref import PkgReference
from conan.internal.model.recipe_ref import RecipeReference


def json_export(data):
Expand Down
2 changes: 1 addition & 1 deletion conan/cli/commands/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from conans.client.graph.graph import BINARY_MISSING
from conans.client.graph.install_graph import InstallGraph, ProfileArgs
from conan.internal.errors import NotFoundException
from conans.model.recipe_ref import ref_matches, RecipeReference
from conan.internal.model.recipe_ref import ref_matches, RecipeReference


def explain_formatter_text(data):
Expand Down
4 changes: 2 additions & 2 deletions conan/cli/commands/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from conan.cli import make_abs_path
from conan.cli.args import common_graph_args, validate_common_graph_args
from conan.cli.printers.graph import print_graph_packages, print_graph_basic
from conans.model.graph_lock import Lockfile, LOCKFILE
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.lockfile import Lockfile, LOCKFILE
from conan.internal.model.recipe_ref import RecipeReference


@conan_command(group="Consumer")
Expand Down
2 changes: 1 addition & 1 deletion conan/cli/commands/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from conan.cli.formatters.graph import format_graph_json
from conan.cli.printers import print_profiles
from conan.cli.printers.graph import print_graph_basic, print_graph_packages
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.recipe_ref import RecipeReference


@conan_command(group="Creator", formatters={"json": format_graph_json})
Expand Down
2 changes: 1 addition & 1 deletion conan/cli/formatters/list/binary_html_table.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections import OrderedDict, defaultdict

from conans.model.package_ref import PkgReference
from conan.internal.model.package_ref import PkgReference


class RowResult(object):
Expand Down
2 changes: 1 addition & 1 deletion conan/cps/cps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from enum import Enum

from conans.model.build_info import CppInfo
from conan.internal.model.cpp_info import CppInfo
from conans.util.files import save, load


Expand Down
2 changes: 1 addition & 1 deletion conan/internal/api/detect/detect_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from conan.api.output import ConanOutput
from conan.errors import ConanException
from conans.model.version import Version
from conan.internal.model.version import Version
from conans.util.files import load, save
from conans.util.runners import check_output_runner, detect_runner

Expand Down
4 changes: 2 additions & 2 deletions conan/internal/api/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from conan.tools.scm import Git
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.model.manifest import FileTreeManifest
from conan.internal.model.recipe_ref import RecipeReference
from conan.internal.paths import DATA_YML
from conans.util.files import is_dirty, rmdir, set_dirty, mkdir, clean_dirty, chdir

Expand Down
2 changes: 1 addition & 1 deletion conan/internal/api/local/editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
from os.path import join, normpath

from conans.model.recipe_ref import RecipeReference
from conan.internal.model.recipe_ref import RecipeReference
from conans.util.files import load, save


Expand Down
8 changes: 4 additions & 4 deletions conan/internal/api/profile/profile_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from conan.internal.cache.home_paths import HomePaths
from conan.tools.env.environment import ProfileEnvironment
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
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.conf import ConfDefinition, CORE_CONF_PATTERN
from conan.internal.model.options import Options
from conan.internal.model.profile import Profile
from conan.internal.model.recipe_ref import RecipeReference
from conans.util.config_parser import ConfigParser
from conans.util.files import mkdir, load_user_encoded

Expand Down
4 changes: 2 additions & 2 deletions conan/internal/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from conan.internal.cache.db.cache_database import CacheDatabase
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 conan.internal.model.package_ref import PkgReference
from conan.internal.model.recipe_ref import RecipeReference
from conans.util.dates import revision_timestamp_now
from conans.util.files import rmdir, renamedir, mkdir

Expand Down
2 changes: 1 addition & 1 deletion conan/internal/cache/conan_reference_layout.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from contextlib import contextmanager

from conans.model.manifest import FileTreeManifest
from conan.internal.model.manifest import FileTreeManifest
from conan.internal.paths import CONANFILE, DATA_YML
from conans.util.files import set_dirty, clean_dirty, is_dirty, rmdir

Expand Down
6 changes: 3 additions & 3 deletions conan/internal/cache/db/cache_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from conan.api.output import ConanOutput
from conan.internal.cache.db.packages_table import PackagesDBTable
from conan.internal.cache.db.recipes_table import RecipesDBTable
from conans.model.package_ref import PkgReference
from conans.model.recipe_ref import RecipeReference
from conans.model.version import Version
from conan.internal.model.package_ref import PkgReference
from conan.internal.model.recipe_ref import RecipeReference
from conan.internal.model.version import Version


class CacheDatabase:
Expand Down
4 changes: 2 additions & 2 deletions conan/internal/cache/db/packages_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from conan.internal.cache.db.table import BaseDbTable
from conan.internal.errors import ConanReferenceDoesNotExistInDB, ConanReferenceAlreadyExistsInDB
from conans.model.package_ref import PkgReference
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.package_ref import PkgReference
from conan.internal.model.recipe_ref import RecipeReference
from conans.util.dates import timestamp_now


Expand Down
2 changes: 1 addition & 1 deletion conan/internal/cache/db/recipes_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from conan.internal.cache.db.table import BaseDbTable
from conan.internal.errors import ConanReferenceDoesNotExistInDB, ConanReferenceAlreadyExistsInDB
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.recipe_ref import RecipeReference
from conans.util.dates import timestamp_now


Expand Down
4 changes: 2 additions & 2 deletions conan/internal/cache/integrity_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from conan.api.output import ConanOutput
from conan.errors import ConanException
from conans.model.package_ref import PkgReference
from conans.model.recipe_ref import RecipeReference
from conan.internal.model.package_ref import PkgReference
from conan.internal.model.recipe_ref import RecipeReference


class IntegrityChecker:
Expand Down
8 changes: 4 additions & 4 deletions conan/internal/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from conan.errors import ConanException
from conan.internal.errors import conanfile_exception_formatter, conanfile_remove_attr
from conan.internal.paths import CONANINFO
from conans.model.manifest import FileTreeManifest
from conans.model.package_ref import PkgReference
from conans.model.pkg_type import PackageType
from conans.model.requires import BuildRequirements, TestRequirements, ToolRequirements
from conan.internal.model.manifest import FileTreeManifest
from conan.internal.model.package_ref import PkgReference
from conan.internal.model.pkg_type import PackageType
from conan.internal.model.requires import BuildRequirements, TestRequirements, ToolRequirements
from conans.util.files import mkdir, chdir, save


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from conan.api.output import ConanOutput, Color
from conans.client.subsystems import command_env_wrapper
from conan.errors import ConanException
from conans.model.build_info import MockInfoProperty
from conans.model.conf import Conf
from conans.model.dependencies import ConanFileDependencies
from conans.model.layout import Folders, Infos, Layouts
from conans.model.options import Options
from conans.model.requires import Requirements
from conans.model.settings import Settings
from conan.internal.model.cpp_info import MockInfoProperty
from conan.internal.model.conf import Conf
from conan.internal.model.dependencies import ConanFileDependencies
from conan.internal.model.layout import Folders, Infos, Layouts
from conan.internal.model.options import Options
from conan.internal.model.requires import Requirements
from conan.internal.model.settings import Settings


class ConanFile:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion conans/model/conf.py → conan/internal/model/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from collections import OrderedDict

from conan.errors import ConanException
from conans.model.recipe_ref import ref_matches
from conan.internal.model.recipe_ref import ref_matches

BUILT_IN_CONFS = {
"core:required_conan_version": "Raise if current version does not match the defined range.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from conan.api.output import ConanOutput
from conan.errors import ConanException
from conans.model.pkg_type import PackageType
from conan.internal.model.pkg_type import PackageType
from conans.util.files import load, save

_DIRS_VAR_NAMES = ["_includedirs", "_srcdirs", "_libdirs", "_resdirs", "_bindirs", "_builddirs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from conans.client.graph.graph import RECIPE_PLATFORM
from conan.errors import ConanException
from conans.model.recipe_ref import RecipeReference
from conans.model.conanfile_interface import ConanFileInterface
from conan.internal.model.recipe_ref import RecipeReference
from conan.internal.model.conanfile_interface import ConanFileInterface


class UserRequirementsDict(object):
Expand Down
Loading

0 comments on commit 13d4c3d

Please sign in to comment.