Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions conan/api/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,17 @@ def set_output_level(cls, level):
@classmethod
def valid_log_levels(cls):
return {"quiet": LEVEL_QUIET, # -vquiet 80
"error": LEVEL_ERROR, # -verror 70
"warning": LEVEL_WARNING, # -vwaring 60
"notice": LEVEL_NOTICE, # -vnotice 50
"status": LEVEL_STATUS, # -vstatus 40
None: LEVEL_VERBOSE, # -v 30
"verbose": LEVEL_VERBOSE, # -vverbose 30
"debug": LEVEL_DEBUG, # -vdebug 20
"v": LEVEL_DEBUG, # -vv 20
"trace": LEVEL_TRACE, # -vtrace 10
"vv": LEVEL_TRACE # -vvv 10
}
"error": LEVEL_ERROR, # -verror 70
"warning": LEVEL_WARNING, # -vwaring 60
"notice": LEVEL_NOTICE, # -vnotice 50
"status": LEVEL_STATUS, # -vstatus 40
None: LEVEL_VERBOSE, # -v 30
"verbose": LEVEL_VERBOSE, # -vverbose 30
"debug": LEVEL_DEBUG, # -vdebug 20
"v": LEVEL_DEBUG, # -vv 20
"trace": LEVEL_TRACE, # -vtrace 10
"vv": LEVEL_TRACE # -vvv 10
}

@classmethod
def define_log_level(cls, v):
Expand Down
2 changes: 1 addition & 1 deletion conan/cli/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def common_graph_args(subparser):
subparser.add_argument("--requires", action="append",
help='Directly provide requires instead of a conanfile')
subparser.add_argument("--tool-requires", action='append',
help='Directly provide tool-requires instead of a conanfile')
help='Directly provide tool-requires instead of a conanfile')
add_reference_args(subparser)
add_lockfile_args(subparser)

Expand Down
3 changes: 2 additions & 1 deletion conan/cli/commands/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from conan.api.conan_api import ConanAPI
from conan.api.model import ListPattern, MultiPackagesList
from conan.api.output import cli_out_write, ConanOutput
from conan.api.output import cli_out_write
from conan.cli import make_abs_path
from conan.cli.command import conan_command, conan_subcommand, OnceArgument
from conan.cli.commands.list import print_list_text, print_list_json
Expand Down Expand Up @@ -125,6 +125,7 @@ def print_list_check_integrity_json(data):
myjson = json.dumps(results, indent=4)
cli_out_write(myjson)


@conan_subcommand(formatters={"text": lambda _: (),
"json": print_list_check_integrity_json})
def cache_check_integrity(conan_api: ConanAPI, parser, subparser, *args):
Expand Down
2 changes: 1 addition & 1 deletion conan/cli/commands/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def confirmation(message):
result.add_ref(ref)
result.recipe_dict(ref).update(ref_dict) # it doesn't contain "packages"
else:
if not packages: # weird, there is inner package-ids but without prevs
if not packages: # weird, there is inner package-ids but without prevs
ConanOutput().info(f"No binaries to remove for '{ref.repr_notime()}'")
continue
for pref, pkg_id_info in packages.items():
Expand Down
3 changes: 1 addition & 2 deletions conan/cli/commands/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from conan.cli.command import conan_command, conan_subcommand



@conan_command(group="Security")
def report(conan_api: ConanAPI, parser, *args):
"""
Expand Down Expand Up @@ -40,7 +39,7 @@ def report_diff(conan_api, parser, subparser, *args):
subparser.add_argument("-nr", "--new-reference", help=ref_help.format(type="New"), required=True)

subparser.add_argument("-r", "--remote", action="append", default=None,
help='Look in the specified remote or remotes server')
help='Look in the specified remote or remotes server')

args = parser.parse_args(*args)

Expand Down
2 changes: 1 addition & 1 deletion conan/cli/commands/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def _install_build(conan_api: ConanAPI, parser, subparser, build, *args):
ws_pkg = all_editables.get(ref)
is_editable = package["binary"] in ("Editable", "EditableBuild")
if ws_pkg is None:
if is_editable or package["binary"] == "Build": # Build external to Workspace
if is_editable or package["binary"] == "Build": # Build extern to Workspace
cmd = f'install {package["build_args"]} {profile_args}'
ConanOutput().box(f"Workspace building external {ref}")
ConanOutput().info(f"Command: {cmd}\n")
Expand Down
5 changes: 3 additions & 2 deletions conan/cli/formatters/audit/vulnerabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def wrap_and_indent(txt, limit=80, indent=2):
"through patches applied in the recipe.\nTo verify if a patch has been applied, check the recipe in Conan Center.\n",
fg=Color.BRIGHT_YELLOW)

if total_vulns > 0 or not "error" in result:
if total_vulns > 0 or "error" not in result:
cli_out_write("\nVulnerability information provided by JFrog Catalog. Check "
"https://audit.conan.io/jfrogcuration for more information.\n",
fg=Color.BRIGHT_GREEN)
Expand Down Expand Up @@ -326,7 +326,8 @@ def html_vuln_formatter(result):
for ref, pkg_info in result["data"].items():
edges = pkg_info.get("vulnerabilities", {}).get("edges", [])
if not edges:
description = "No vulnerabilities found." if not "error" in pkg_info else pkg_info["error"].get("details", "")
description = "No vulnerabilities found." if "error" not in pkg_info \
else pkg_info["error"].get("details", "")
vulns.append({
"package": ref,
"vuln_id": "-",
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/api/config/config_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _process_download(config, cache_folder, requester):
raise ConanException("Error while installing config from %s\n%s" % (config.uri, str(e)))


class _ConfigOrigin(object):
class _ConfigOrigin:
def __init__(self, uri, config_type, verify_ssl, args, source_folder, target_folder):
if config_type:
self.type = config_type
Expand Down
5 changes: 3 additions & 2 deletions conan/internal/api/detect/detect_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ def _cc_compiler(compiler_exe="cc"):
compiler = "clang" if "clang" in out else "gcc"
# clang and gcc have version after a space, first try to find that to skip extra numbers
# that might appear in the first line of the output before the version
# There might also be a leading parenthesis that contains build information, so we try to skip it
# There might also be a leading parenthesis that contains build information,
# so we try to skip it
installed_version = re.search(r"(?:\(.*\))? ([0-9]+(\.[0-9]+)*)", out)
# Fallback to the first number we find optionally followed by other version fields
installed_version = installed_version or re.search(r"([0-9]+(\.[0-9]+)*)", out)
Expand Down Expand Up @@ -532,7 +533,7 @@ def detect_intel_compiler(compiler_exe="icx"):
try:
ret, out = detect_runner(f'"{compiler_exe}" --version')
if ret != 0:
return None, None
return None, None, None
compiler = "intel-cc"
installed_version = re.search(r"(202[0-9]+(\.[0-9])?)", out).group()
if installed_version:
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/api/profile/profile_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def __init__(self, text):
raise ConanException("Error while parsing line %i: '%s'" % (counter, line))


class _ProfileValueParser(object):
class _ProfileValueParser:
""" parses a "pure" or "effective" profile, with no includes, no variables,
as the one in the lockfiles, or once these things have been processed by ProfileParser
"""
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def propagate_downstream(self, require, node, visibility_conflicts, src_node=Non
# Take into account that while propagating we can find RUNTIME shared conflicts we
# didn't find at check_downstream_exist, because we didn't know the shared/static
existing = self.transitive_deps.get(require)
ill_formed = False

if existing is not None and existing.require is not require:
if existing.node is not None and existing.node.ref != node.ref:
# print(" +++++Runtime conflict!", require, "with", node.ref)
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/graph/python_requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def add_pyrequire(self, py_require):
self._pyrequires[name] = transitive_py_require


class PyRequireLoader(object):
class PyRequireLoader:
def __init__(self, conan_app, global_conf):
self._proxy = conan_app.proxy
self._range_resolver = conan_app.range_resolver
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/hook_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def execute(self, method_name, conanfile):
conanfile.display_name = "%s: [HOOK - %s] %s()" % (conanfile.display_name, name,
method_name)
method(conanfile)
except ConanInvalidConfiguration as e:
except ConanInvalidConfiguration:
raise
except Exception as e:
raise ConanException("[HOOK - %s] %s(): %s" % (name, method_name, str(e)))
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/model/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from conan.internal.model.conanfile_interface import ConanFileInterface


class UserRequirementsDict(object):
class UserRequirementsDict:
""" user facing dict to allow access of dependencies by name
"""
def __init__(self, data, require_filter=None):
Expand Down
6 changes: 3 additions & 3 deletions conan/internal/model/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
from conan.internal.model.conf import Conf


class Infos(object):
class Infos:

def __init__(self):
self.source = CppInfo()
self.build = CppInfo()
self.package = CppInfo(set_defaults=True)


class PartialLayout(object):
class PartialLayout:
def __init__(self):
from conan.tools.env import Environment
self.buildenv_info = Environment()
Expand All @@ -25,7 +25,7 @@ def set_relative_base_folder(self, folder):
self.conf_info.set_relative_base_folder(folder)


class Layouts(object):
class Layouts:
def __init__(self):
self.source = PartialLayout()
self.build = PartialLayout()
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/model/lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def merge(self, other):
self.sort()


class Lockfile(object):
class Lockfile:

def __init__(self, deps_graph=None, lock_packages=False):
self._requires = _LockRequires()
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/model/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from conan.internal.util.files import load, md5, md5sum, save, gather_files


class FileTreeManifest(object):
class FileTreeManifest:

def __init__(self, the_time, file_sums):
"""file_sums is a dict with filepaths and md5's: {filepath/to/file.txt: md5}"""
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/rest/file_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from conan.internal.util.files import sha1sum


class FileUploader(object):
class FileUploader:

def __init__(self, requester, verify, config, source_credentials=None):
self._requester = requester
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/rest/rest_client_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def remove_all_packages(self, ref):
package_search_url = self.router.search_packages(ref, list_only=True)
if not self._get_json(package_search_url):
return
except Exception as e:
except Exception:
pass
if response.status_code != 200: # Error message is text
# To be able to access ret.text (ret.content are bytes)
Expand Down
2 changes: 1 addition & 1 deletion conan/internal/rest/rest_routes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class RestRoutes(object):
class RestRoutes:
ping = "ping"
common_search = "conans/search"
common_authenticate = "users/authenticate"
Expand Down
2 changes: 1 addition & 1 deletion conan/test/assets/genconanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from conan.api.model import RecipeReference


class GenConanfile(object):
class GenConanfile:
"""
USAGE:
Expand Down
4 changes: 2 additions & 2 deletions conan/test/utils/artifactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ARTIFACTORY_DEFAULT_URL = os.getenv("ARTIFACTORY_DEFAULT_URL", "http://localhost:8090/artifactory")


class _ArtifactoryServerStore(object):
class _ArtifactoryServerStore:

def __init__(self, repo_url, user, password):
self._user = user or ARTIFACTORY_DEFAULT_USER
Expand Down Expand Up @@ -67,7 +67,7 @@ def get_last_package_revision(self, ref):
return revisions[0]


class ArtifactoryServer(object):
class ArtifactoryServer:

def __init__(self, *args, **kwargs):
self._user = ARTIFACTORY_DEFAULT_USER
Expand Down
2 changes: 1 addition & 1 deletion conan/test/utils/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def readline(self):
return ret


class MockSettings(object):
class MockSettings:

def __init__(self, values):
self.values = values
Expand Down
3 changes: 1 addition & 2 deletions conan/test/utils/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ def temp_folder(path_with_spaces=True, create_dir=True):


def uncompress_packaged_files(paths, pref):
rev = paths.get_last_revision(pref.ref).revision
_tmp = copy.copy(pref)
_tmp.revision = None
prev = paths.get_last_package_revision(_tmp).revision
pref.revision = prev

package_path = paths.package(pref)
if not(os.path.exists(os.path.join(package_path, PACKAGE_TGZ_NAME))):
if not (os.path.exists(os.path.join(package_path, PACKAGE_TGZ_NAME))):
raise ConanException("%s not found in %s" % (PACKAGE_TGZ_NAME, package_path))
tmp = temp_folder()
untargz(os.path.join(package_path, PACKAGE_TGZ_NAME), tmp)
Expand Down
2 changes: 1 addition & 1 deletion conan/test/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
}


class TestingResponse(object):
class TestingResponse:
"""Wraps a response from TestApp external tool
to guarantee the presence of response.ok, response.content
and response.status_code, as it was a requests library object.
Expand Down
2 changes: 1 addition & 1 deletion conan/tools/apple/xcodebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from conan.tools.build import cmd_args_to_string


class XcodeBuild(object):
class XcodeBuild:
def __init__(self, conanfile):
self._conanfile = conanfile
self._build_type = conanfile.settings.get_safe("build_type")
Expand Down
2 changes: 1 addition & 1 deletion conan/tools/apple/xcodedeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _add_includes_to_file_or_create(filename, template, files_to_include):
return content


class XcodeDeps(object):
class XcodeDeps:
general_name = "conandeps.xcconfig"

_conf_xconfig = textwrap.dedent("""\
Expand Down
2 changes: 1 addition & 1 deletion conan/tools/apple/xcodetoolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from conan.internal.util.files import save


class XcodeToolchain(object):
class XcodeToolchain:
filename = "conantoolchain"
extension = ".xcconfig"

Expand Down
1 change: 1 addition & 0 deletions conan/tools/build/cstd.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def _clang_supported_cstd(version):
return ["99", "gnu99", "11", "gnu11", "17", "gnu17"]
return ["99", "gnu99", "11", "gnu11", "17", "gnu17", "23", "gnu23"]


def _emcc_supported_cstd(version):
"""
emcc is based on clang but follow different versioning scheme.
Expand Down
2 changes: 1 addition & 1 deletion conan/tools/cmake/cmakedeps/cmakedeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from conan.internal.model.dependencies import get_transitive_requires


class CMakeDeps(object):
class CMakeDeps:

def __init__(self, conanfile):
self._conanfile = conanfile
Expand Down
2 changes: 1 addition & 1 deletion conan/tools/cmake/cmakedeps/templates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from conan.errors import ConanException


class CMakeDepsFileTemplate(object):
class CMakeDepsFileTemplate:

def __init__(self, cmakedeps, require, conanfile, generating_module=False):
self.cmakedeps = cmakedeps
Expand Down
1 change: 0 additions & 1 deletion conan/tools/cmake/cmakedeps/templates/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def parsed_extra_variables(self):
key, value)
return parsed_extra_variables


@property
def context(self):
targets_include = "" if not self.generating_module else "module-"
Expand Down
2 changes: 1 addition & 1 deletion conan/tools/cmake/cmakedeps/templates/target_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def _get_dependencies_find_modes(self):
return ret


class _TargetDataContext(object):
class _TargetDataContext:

def __init__(self, cpp_info, pfolder_var_name, package_folder, require, library_type,
is_host_windows, conanfile, cmakedeps, comp_name=None):
Expand Down
2 changes: 1 addition & 1 deletion conan/tools/cmake/cmakedeps2/config_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def content(self):
@property
def filename(self):
f = self._cmakedeps.get_cmake_filename(self._conanfile)
return f"{f}-config-version.cmake" if f == f.lower() else f"{f}ConfigVersion.cmake"
return f"{f}-config-version.cmake" if f == f.lower() else f"{f}ConfigVersion.cmake"

@property
def _context(self):
Expand Down
2 changes: 1 addition & 1 deletion conan/tools/cmake/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _configure_preset(conanfile, generator, cache_variables, toolchain_file, mul
ret["binaryDir"] = conanfile.build_folder

def _format_val(val):
return f'"{val}"' if type(val) == str and " " in val else f"{val}"
return f'"{val}"' if type(val) is str and " " in val else f"{val}"

# https://github.com/conan-io/conan/pull/12034#issuecomment-1253776285
cache_variables_info = " ".join(
Expand Down
Loading
Loading