Skip to content

Commit 865882e

Browse files
authored
Disable Conan CMakePreset Generation (#120)
1 parent c9a47a3 commit 865882e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1585
-1464
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"source.organizeImports": "explicit"
1515
},
1616
"editor.defaultFormatter": "charliermarsh.ruff"
17-
}
17+
},
18+
"cmake.ignoreCMakeListsMissing": true
1819
}

cppython/builder.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
"""Defines the data and routines for building a CPPython project type"""
22

33
import logging
4+
import os
45
from importlib.metadata import entry_points
56
from inspect import getmodule
67
from logging import Logger
8+
from pprint import pformat
79
from typing import Any, cast
810

11+
from rich.console import Console
12+
from rich.logging import RichHandler
13+
914
from cppython.core.plugin_schema.generator import Generator
1015
from cppython.core.plugin_schema.provider import Provider
1116
from cppython.core.plugin_schema.scm import SCM, SupportedSCMFeatures
@@ -471,8 +476,28 @@ def __init__(self, project_configuration: ProjectConfiguration, logger: Logger)
471476
self._project_configuration = project_configuration
472477
self._logger = logger
473478

474-
# Add default output stream
475-
self._logger.addHandler(logging.StreamHandler())
479+
# Informal standard to check for color
480+
force_color = os.getenv('FORCE_COLOR', '1') != '0'
481+
482+
console = Console(
483+
force_terminal=force_color,
484+
color_system='auto',
485+
width=120,
486+
legacy_windows=False,
487+
no_color=False,
488+
)
489+
490+
rich_handler = RichHandler(
491+
console=console,
492+
rich_tracebacks=True,
493+
show_time=False,
494+
show_path=False,
495+
markup=True,
496+
show_level=False,
497+
enable_link_path=False,
498+
)
499+
500+
self._logger.addHandler(rich_handler)
476501
self._logger.setLevel(Builder.levels[project_configuration.verbosity])
477502

478503
self._logger.info('Logging setup complete')
@@ -532,4 +557,6 @@ def build(
532557

533558
plugins = Plugins(generator=generator, provider=provider, scm=scm)
534559

560+
self._logger.debug('Project data:\n%s', pformat(dict(core_data)))
561+
535562
return Data(core_data, plugins, self._logger)

cppython/core/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ProjectConfiguration(CPPythonModel, extra='forbid'):
4444
bool, Field(description='Debug mode. Additional processing will happen to expose more debug information')
4545
] = False
4646

47-
@field_validator('verbosity') # type: ignore
47+
@field_validator('verbosity')
4848
@classmethod
4949
def min_max(cls, value: int) -> int:
5050
"""Validator that clamps the input value
@@ -121,7 +121,7 @@ class CPPythonData(CPPythonModel, extra='forbid'):
121121
provider_data: Annotated[dict[str, Any], Field(description='Resolved provider configuration data')]
122122
generator_data: Annotated[dict[str, Any], Field(description='Resolved generator configuration data')]
123123

124-
@field_validator('configuration_path', 'install_path', 'tool_path', 'build_path') # type: ignore
124+
@field_validator('configuration_path', 'install_path', 'tool_path', 'build_path')
125125
@classmethod
126126
def validate_absolute_path(cls, value: Path) -> Path:
127127
"""Enforce the input is an absolute path

0 commit comments

Comments
 (0)