From 92105e9f808051b8de501a68773ee490a93b02b3 Mon Sep 17 00:00:00 2001 From: Asher Norland Date: Tue, 10 May 2022 06:52:55 -0400 Subject: [PATCH 1/4] Normalize the Generator Output --- cppython/project.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cppython/project.py b/cppython/project.py index 9b956eb..4be4494 100644 --- a/cppython/project.py +++ b/cppython/project.py @@ -209,7 +209,7 @@ def install(self) -> None: cppython_logger.info(f"Installing {generator.name()} generator") try: - toolchain_path = generator.install() + toolchain_path = generator.install().absolute() generator_output.append((generator.name(), toolchain_path)) except Exception as exception: cppython_logger.error(f"Generator {generator.name()} failed to install") @@ -237,7 +237,7 @@ def update(self) -> None: cppython_logger.info(f"Updating {generator.name()} generator") try: - toolchain_path = generator.update() + toolchain_path = generator.update().absolute() generator_output.append((generator.name(), toolchain_path)) except Exception as exception: cppython_logger.error(f"Generator {generator.name()} failed to update") From 3b23a452952899fef1451b95e2f13aca6debe790 Mon Sep 17 00:00:00 2001 From: Asher Norland Date: Tue, 10 May 2022 07:59:13 -0400 Subject: [PATCH 2/4] Add Root Path Config --- cppython/console.py | 18 +++++++++++++++--- cppython/project.py | 2 +- cppython/schema.py | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/cppython/console.py b/cppython/console.py index 3944255..8c9d6cb 100644 --- a/cppython/console.py +++ b/cppython/console.py @@ -12,7 +12,10 @@ from cppython.project import Project, ProjectConfiguration -def _create_pyproject() -> dict[str, Any]: +def _find_pyproject_file() -> Path: + """ + TODO + """ # Search for a path upward path = Path.cwd() @@ -25,6 +28,14 @@ def _create_pyproject() -> dict[str, Any]: path = Path(path / "pyproject.toml") + return path + + +def _create_pyproject(path: Path) -> dict[str, Any]: + """ + TODO + """ + # Load file data = tomlkit.loads(path.read_text(encoding="utf-8")) @@ -38,11 +49,12 @@ class Config: """ def __init__(self): - self.pyproject_data = _create_pyproject() + path = _find_pyproject_file() + self.pyproject_data = _create_pyproject(path) configuration = InterfaceConfiguration() self.interface = ConsoleInterface(configuration) - self.configuration = ProjectConfiguration() + self.configuration = ProjectConfiguration(root_path=path) def create_project(self) -> Project: """ diff --git a/cppython/project.py b/cppython/project.py index 4be4494..325392e 100644 --- a/cppython/project.py +++ b/cppython/project.py @@ -19,7 +19,7 @@ from pydantic import create_model from cppython.schema import API, ProjectConfiguration -from cppython.utility import write_preset, write_presets +from cppython.utility import write_presets class ProjectBuilder: diff --git a/cppython/schema.py b/cppython/schema.py index d121b93..af52f60 100644 --- a/cppython/schema.py +++ b/cppython/schema.py @@ -91,6 +91,7 @@ class ProjectConfiguration: TODO """ + root_path: Path # The path where the pyproject.toml lives _verbosity: int = 0 @property From 81baff29eacbb8df6bc06e8f7f04509215b1f481 Mon Sep 17 00:00:00 2001 From: Asher Norland Date: Tue, 10 May 2022 08:06:58 -0400 Subject: [PATCH 3/4] Fix Tests --- cppython/schema.py | 6 ++++++ tests/unit/test_project.py | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cppython/schema.py b/cppython/schema.py index af52f60..af23ef9 100644 --- a/cppython/schema.py +++ b/cppython/schema.py @@ -33,6 +33,9 @@ class ConfigurePreset(Preset): @validator("toolchainFile") def validate_path(cls, v): + """ + TODO + """ return Path(v).as_posix() @@ -79,6 +82,9 @@ class CMakePresets(BaseModel, extra=Extra.forbid): @validator("include") def validate_path(cls, v): + """ + TODO + """ output = [] for value in v: output.append(Path(value).as_posix()) diff --git a/tests/unit/test_project.py b/tests/unit/test_project.py index 933e8b7..892d95b 100644 --- a/tests/unit/test_project.py +++ b/tests/unit/test_project.py @@ -2,6 +2,8 @@ Test the functions related to the internal interface implementation and the 'Interface' interface itself """ +from pathlib import Path + from cppython_core.schema import ( PEP621, CPPythonData, @@ -41,7 +43,7 @@ def test_construction(self, mocker: MockerFixture): """ interface_mock = mocker.MagicMock() - configuration = ProjectConfiguration() + configuration = ProjectConfiguration(root_path=Path()) Project(configuration, interface_mock, default_pyproject.dict(by_alias=True)) @@ -55,7 +57,7 @@ def test_plugin_gather(self): TODO """ - configuration = ProjectConfiguration() + configuration = ProjectConfiguration(root_path=Path()) builder = ProjectBuilder(configuration) plugins = builder.gather_plugins(Generator) @@ -66,7 +68,7 @@ def test_generator_data_construction(self, mocker: MockerFixture): TODO """ - configuration = ProjectConfiguration() + configuration = ProjectConfiguration(root_path=Path()) builder = ProjectBuilder(configuration) model_type = builder.generate_model([]) @@ -94,7 +96,7 @@ def test_generator_creation(self, mocker: MockerFixture): TODO """ - configuration = ProjectConfiguration() + configuration = ProjectConfiguration(root_path=Path()) builder = ProjectBuilder(configuration) generator_configuration = GeneratorConfiguration() From b5b07588f381fd4c06794d0825c3151b86ad68c7 Mon Sep 17 00:00:00 2001 From: Asher Norland Date: Fri, 13 May 2022 06:11:44 -0400 Subject: [PATCH 4/4] Split Generator Args --- cppython/project.py | 64 +++++++++++++++----- cppython/schema.py | 4 +- pdm.lock | 120 ++++++++++++++++++------------------- tests/unit/test_project.py | 6 +- 4 files changed, 115 insertions(+), 79 deletions(-) diff --git a/cppython/project.py b/cppython/project.py index 325392e..6289d86 100644 --- a/cppython/project.py +++ b/cppython/project.py @@ -8,7 +8,9 @@ from cppython_core.core import cppython_logger from cppython_core.schema import ( + PEP621, CPPythonData, + CPPythonDataT, Generator, GeneratorConfiguration, Interface, @@ -73,17 +75,41 @@ def generate_model(self, plugins: list[Type[Generator]]) -> Type[PyProject]: ) def create_generators( - self, plugins: list[Type[Generator]], configuration: GeneratorConfiguration, pyproject: PyProject + self, + plugins: list[Type[Generator]], + configuration: GeneratorConfiguration, + project: PEP621, + cppython: CPPythonData, ) -> list[Generator]: """ TODO """ _generators = [] for plugin_type in plugins: - _generators.append(plugin_type(configuration, pyproject)) + _generators.append(plugin_type(configuration, project, cppython)) return _generators + def generate_modified(self, original: CPPythonDataT) -> CPPythonDataT: + """ + Applies dynamic behaviors of the settings to itself + Returns a copy of the original with dynamic modifications + """ + modified = original.copy(deep=True) + + # Add the pyproject.toml location to all relative paths + + if not modified.install_path.is_absolute(): + modified.install_path = self.configuration.root_path.absolute() / modified.install_path + + if not modified.tool_path.is_absolute(): + modified.tool_path = self.configuration.root_path.absolute() / modified.tool_path + + if not modified.build_path.is_absolute(): + modified.build_path = self.configuration.root_path.absolute() / modified.build_path + + return modified + class Project(API): """ @@ -96,7 +122,6 @@ def __init__( self._enabled = False self._configuration = configuration - self._pyproject = None levels = [logging.WARNING, logging.INFO, logging.DEBUG] @@ -118,26 +143,30 @@ def __init__( cppython_logger.warning(f"Generator plugin found: {plugin.name()}") extended_pyproject_type = builder.generate_model(plugins) - self._pyproject = extended_pyproject_type(**pyproject_data) + pyproject = extended_pyproject_type(**pyproject_data) - if self.pyproject is None: + if pyproject is None: cppython_logger.error("Data is not defined") return - if self.pyproject.tool is None: + if pyproject.tool is None: cppython_logger.error("Table [tool] is not defined") return - if self.pyproject.tool.cppython is None: + if pyproject.tool.cppython is None: cppython_logger.error("Table [tool.cppython] is not defined") return self._enabled = True + self._project = pyproject.project + + self._modified_cppython_data = builder.generate_modified(pyproject.tool.cppython) + self._interface = interface generator_configuration = GeneratorConfiguration() - self._generators = builder.create_generators(plugins, generator_configuration, self.pyproject) + self._generators = builder.create_generators(plugins, generator_configuration, self.project, self.cppython) cppython_logger.info("Initialized project successfully") @@ -156,11 +185,18 @@ def configuration(self) -> ProjectConfiguration: return self._configuration @property - def pyproject(self) -> PyProject | None: + def project(self): """ - TODO + The pyproject project table + """ + return self._project + + @property + def cppython(self): + """ + The resolved CPPython data """ - return self._pyproject + return self._modified_cppython_data def download(self): """ @@ -170,7 +206,7 @@ def download(self): cppython_logger.info("Skipping download because the project is not enabled") return - base_path = self.pyproject.tool.cppython.install_path + base_path = self.cppython.install_path for generator in self._generators: @@ -199,7 +235,7 @@ def install(self) -> None: cppython_logger.info("Installing project") self.download() - tool_path = self.pyproject.tool.cppython.tool_path + tool_path = self.cppython.tool_path tool_path.mkdir(parents=True, exist_ok=True) generator_output = [] @@ -227,7 +263,7 @@ def update(self) -> None: cppython_logger.info("Updating project") - tool_path = self.pyproject.tool.cppython.tool_path + tool_path = self.cppython.tool_path tool_path.mkdir(parents=True, exist_ok=True) generator_output = [] diff --git a/cppython/schema.py b/cppython/schema.py index af23ef9..db2e53d 100644 --- a/cppython/schema.py +++ b/cppython/schema.py @@ -32,11 +32,11 @@ class ConfigurePreset(Preset): toolchainFile: Optional[str] @validator("toolchainFile") - def validate_path(cls, v): + def validate_path(cls, value): # pylint: disable=E0213 """ TODO """ - return Path(v).as_posix() + return Path(value).as_posix() class BuildPreset(Preset): diff --git a/pdm.lock b/pdm.lock index 25d6f22..4653dc3 100644 --- a/pdm.lock +++ b/pdm.lock @@ -1,6 +1,6 @@ [[package]] name = "astroid" -version = "2.11.4" +version = "2.11.5" requires_python = ">=3.6.2" summary = "An abstract syntax tree for Python with inference support." dependencies = [ @@ -51,13 +51,13 @@ summary = "Cross-platform colored terminal text." [[package]] name = "coverage" -version = "6.3.2" +version = "6.3.3" requires_python = ">=3.7" summary = "Code coverage measurement for Python" [[package]] name = "coverage" -version = "6.3.2" +version = "6.3.3" extras = ["toml"] requires_python = ">=3.7" summary = "Code coverage measurement for Python" @@ -68,7 +68,7 @@ dependencies = [ [[package]] name = "cppython-core" -version = "0.3.3.dev14" +version = "0.3.3.dev19" requires_python = ">=3.10" summary = "Data definitions for CPPython" dependencies = [ @@ -168,7 +168,7 @@ dependencies = [ [[package]] name = "pyparsing" -version = "3.0.8" +version = "3.0.9" requires_python = ">=3.6.8" summary = "pyparsing module - Classes and methods to define and execute parsing grammars" @@ -219,7 +219,7 @@ dependencies = [ [[package]] name = "setuptools" -version = "62.1.0" +version = "62.2.0" requires_python = ">=3.7" summary = "Easily download, build, install, upgrade, and uninstall Python packages" @@ -252,9 +252,9 @@ lock_version = "3.1" content_hash = "sha256:9842348d0ddc71440b500499ed71e9b60aea9edcf388f5d8ef170c125c802e99" [metadata.files] -"astroid 2.11.4" = [ - {file = "astroid-2.11.4-py3-none-any.whl", hash = "sha256:da0632b7c046d8361dfe1b1abb2e085a38624961fabe2997565a9c06c1be9d9a"}, - {file = "astroid-2.11.4.tar.gz", hash = "sha256:561dc6015eecce7e696ff7e3b40434bc56831afeff783f0ea853e19c4f635c06"}, +"astroid 2.11.5" = [ + {file = "astroid-2.11.5-py3-none-any.whl", hash = "sha256:14ffbb4f6aa2cf474a0834014005487f7ecd8924996083ab411e7fa0b508ce0b"}, + {file = "astroid-2.11.5.tar.gz", hash = "sha256:f4e4ec5294c4b07ac38bab9ca5ddd3914d4bf46f9006eb5c0ae755755061044e"}, ] "atomicwrites 1.4.0" = [ {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, @@ -297,52 +297,50 @@ content_hash = "sha256:9842348d0ddc71440b500499ed71e9b60aea9edcf388f5d8ef170c125 {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, ] -"coverage 6.3.2" = [ - {file = "coverage-6.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9b27d894748475fa858f9597c0ee1d4829f44683f3813633aaf94b19cb5453cf"}, - {file = "coverage-6.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:37d1141ad6b2466a7b53a22e08fe76994c2d35a5b6b469590424a9953155afac"}, - {file = "coverage-6.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9987b0354b06d4df0f4d3e0ec1ae76d7ce7cbca9a2f98c25041eb79eec766f1"}, - {file = "coverage-6.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:26e2deacd414fc2f97dd9f7676ee3eaecd299ca751412d89f40bc01557a6b1b4"}, - {file = "coverage-6.3.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4dd8bafa458b5c7d061540f1ee9f18025a68e2d8471b3e858a9dad47c8d41903"}, - {file = "coverage-6.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:46191097ebc381fbf89bdce207a6c107ac4ec0890d8d20f3360345ff5976155c"}, - {file = "coverage-6.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6f89d05e028d274ce4fa1a86887b071ae1755082ef94a6740238cd7a8178804f"}, - {file = "coverage-6.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:58303469e9a272b4abdb9e302a780072c0633cdcc0165db7eec0f9e32f901e05"}, - {file = "coverage-6.3.2-cp310-cp310-win32.whl", hash = "sha256:2fea046bfb455510e05be95e879f0e768d45c10c11509e20e06d8fcaa31d9e39"}, - {file = "coverage-6.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:a2a8b8bcc399edb4347a5ca8b9b87e7524c0967b335fbb08a83c8421489ddee1"}, - {file = "coverage-6.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:f1555ea6d6da108e1999b2463ea1003fe03f29213e459145e70edbaf3e004aaa"}, - {file = "coverage-6.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5f4e1edcf57ce94e5475fe09e5afa3e3145081318e5fd1a43a6b4539a97e518"}, - {file = "coverage-6.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7a15dc0a14008f1da3d1ebd44bdda3e357dbabdf5a0b5034d38fcde0b5c234b7"}, - {file = "coverage-6.3.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21b7745788866028adeb1e0eca3bf1101109e2dc58456cb49d2d9b99a8c516e6"}, - {file = "coverage-6.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:8ce257cac556cb03be4a248d92ed36904a59a4a5ff55a994e92214cde15c5bad"}, - {file = "coverage-6.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b0be84e5a6209858a1d3e8d1806c46214e867ce1b0fd32e4ea03f4bd8b2e3359"}, - {file = "coverage-6.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:acf53bc2cf7282ab9b8ba346746afe703474004d9e566ad164c91a7a59f188a4"}, - {file = "coverage-6.3.2-cp37-cp37m-win32.whl", hash = "sha256:8bdde1177f2311ee552f47ae6e5aa7750c0e3291ca6b75f71f7ffe1f1dab3dca"}, - {file = "coverage-6.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b31651d018b23ec463e95cf10070d0b2c548aa950a03d0b559eaa11c7e5a6fa3"}, - {file = "coverage-6.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:07e6db90cd9686c767dcc593dff16c8c09f9814f5e9c51034066cad3373b914d"}, - {file = "coverage-6.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2c6dbb42f3ad25760010c45191e9757e7dce981cbfb90e42feef301d71540059"}, - {file = "coverage-6.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c76aeef1b95aff3905fb2ae2d96e319caca5b76fa41d3470b19d4e4a3a313512"}, - {file = "coverage-6.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8cf5cfcb1521dc3255d845d9dca3ff204b3229401994ef8d1984b32746bb45ca"}, - {file = "coverage-6.3.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8fbbdc8d55990eac1b0919ca69eb5a988a802b854488c34b8f37f3e2025fa90d"}, - {file = "coverage-6.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ec6bc7fe73a938933d4178c9b23c4e0568e43e220aef9472c4f6044bfc6dd0f0"}, - {file = "coverage-6.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:9baff2a45ae1f17c8078452e9e5962e518eab705e50a0aa8083733ea7d45f3a6"}, - {file = "coverage-6.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fd9e830e9d8d89b20ab1e5af09b32d33e1a08ef4c4e14411e559556fd788e6b2"}, - {file = "coverage-6.3.2-cp38-cp38-win32.whl", hash = "sha256:f7331dbf301b7289013175087636bbaf5b2405e57259dd2c42fdcc9fcc47325e"}, - {file = "coverage-6.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:68353fe7cdf91f109fc7d474461b46e7f1f14e533e911a2a2cbb8b0fc8613cf1"}, - {file = "coverage-6.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b78e5afb39941572209f71866aa0b206c12f0109835aa0d601e41552f9b3e620"}, - {file = "coverage-6.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4e21876082ed887baed0146fe222f861b5815455ada3b33b890f4105d806128d"}, - {file = "coverage-6.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34626a7eee2a3da12af0507780bb51eb52dca0e1751fd1471d0810539cefb536"}, - {file = "coverage-6.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1ebf730d2381158ecf3dfd4453fbca0613e16eaa547b4170e2450c9707665ce7"}, - {file = "coverage-6.3.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd6fe30bd519694b356cbfcaca9bd5c1737cddd20778c6a581ae20dc8c04def2"}, - {file = "coverage-6.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:96f8a1cb43ca1422f36492bebe63312d396491a9165ed3b9231e778d43a7fca4"}, - {file = "coverage-6.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:dd035edafefee4d573140a76fdc785dc38829fe5a455c4bb12bac8c20cfc3d69"}, - {file = "coverage-6.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5ca5aeb4344b30d0bec47481536b8ba1181d50dbe783b0e4ad03c95dc1296684"}, - {file = "coverage-6.3.2-cp39-cp39-win32.whl", hash = "sha256:f5fa5803f47e095d7ad8443d28b01d48c0359484fec1b9d8606d0e3282084bc4"}, - {file = "coverage-6.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:9548f10d8be799551eb3a9c74bbf2b4934ddb330e08a73320123c07f95cc2d92"}, - {file = "coverage-6.3.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:18d520c6860515a771708937d2f78f63cc47ab3b80cb78e86573b0a760161faf"}, - {file = "coverage-6.3.2.tar.gz", hash = "sha256:03e2a7826086b91ef345ff18742ee9fc47a6839ccd517061ef8fa1976e652ce9"}, -] -"cppython-core 0.3.3.dev14" = [ - {file = "cppython_core-0.3.3.dev14-py3-none-any.whl", hash = "sha256:e9735b3029c97b2a3d9ae92c587a734c90ff655ebbfb39d44164c728a499be09"}, - {file = "cppython-core-0.3.3.dev14.tar.gz", hash = "sha256:000e71af5cab85906781b3b32fd7a8d8c3179a8ee6a137a45ac9c3d219186cd8"}, +"coverage 6.3.3" = [ + {file = "coverage-6.3.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df32ee0f4935a101e4b9a5f07b617d884a531ed5666671ff6ac66d2e8e8246d8"}, + {file = "coverage-6.3.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:75b5dbffc334e0beb4f6c503fb95e6d422770fd2d1b40a64898ea26d6c02742d"}, + {file = "coverage-6.3.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:114944e6061b68a801c5da5427b9173a0dd9d32cd5fcc18a13de90352843737d"}, + {file = "coverage-6.3.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2ab88a01cd180b5640ccc9c47232e31924d5f9967ab7edd7e5c91c68eee47a69"}, + {file = "coverage-6.3.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad8f9068f5972a46d50fe5f32c09d6ee11da69c560fcb1b4c3baea246ca4109b"}, + {file = "coverage-6.3.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4cd696aa712e6cd16898d63cf66139dc70d998f8121ab558f0e1936396dbc579"}, + {file = "coverage-6.3.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:c1a9942e282cc9d3ed522cd3e3cab081149b27ea3bda72d6f61f84eaf88c1a63"}, + {file = "coverage-6.3.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c06455121a089252b5943ea682187a4e0a5cf0a3fb980eb8e7ce394b144430a9"}, + {file = "coverage-6.3.3-cp310-cp310-win32.whl", hash = "sha256:cb5311d6ccbd22578c80028c5e292a7ab9adb91bd62c1982087fad75abe2e63d"}, + {file = "coverage-6.3.3-cp310-cp310-win_amd64.whl", hash = "sha256:6d4a6f30f611e657495cc81a07ff7aa8cd949144e7667c5d3e680d73ba7a70e4"}, + {file = "coverage-6.3.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:79bf405432428e989cad7b8bc60581963238f7645ae8a404f5dce90236cc0293"}, + {file = "coverage-6.3.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:338c417613f15596af9eb7a39353b60abec9d8ce1080aedba5ecee6a5d85f8d3"}, + {file = "coverage-6.3.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:db094a6a4ae6329ed322a8973f83630b12715654c197dd392410400a5bfa1a73"}, + {file = "coverage-6.3.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1414e8b124611bf4df8d77215bd32cba6e3425da8ce9c1f1046149615e3a9a31"}, + {file = "coverage-6.3.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:93b16b08f94c92cab88073ffd185070cdcb29f1b98df8b28e6649145b7f2c90d"}, + {file = "coverage-6.3.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:fbc86ae8cc129c801e7baaafe3addf3c8d49c9c1597c44bdf2d78139707c3c62"}, + {file = "coverage-6.3.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:b5ba058610e8289a07db2a57bce45a1793ec0d3d11db28c047aae2aa1a832572"}, + {file = "coverage-6.3.3-cp37-cp37m-win32.whl", hash = "sha256:8329635c0781927a2c6ae068461e19674c564e05b86736ab8eb29c420ee7dc20"}, + {file = "coverage-6.3.3-cp37-cp37m-win_amd64.whl", hash = "sha256:e5af1feee71099ae2e3b086ec04f57f9950e1be9ecf6c420696fea7977b84738"}, + {file = "coverage-6.3.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e814a4a5a1d95223b08cdb0f4f57029e8eab22ffdbae2f97107aeef28554517e"}, + {file = "coverage-6.3.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:61f4fbf3633cb0713437291b8848634ea97f89c7e849c2be17a665611e433f53"}, + {file = "coverage-6.3.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3401b0d2ed9f726fadbfa35102e00d1b3547b73772a1de5508ef3bdbcb36afe7"}, + {file = "coverage-6.3.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8586b177b4407f988731eb7f41967415b2197f35e2a6ee1a9b9b561f6323c8e9"}, + {file = "coverage-6.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:892e7fe32191960da559a14536768a62e83e87bbb867e1b9c643e7e0fbce2579"}, + {file = "coverage-6.3.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:afb03f981fadb5aed1ac6e3dd34f0488e1a0875623d557b6fad09b97a942b38a"}, + {file = "coverage-6.3.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:cbe91bc84be4e5ef0b1480d15c7b18e29c73bdfa33e07d3725da7d18e1b0aff2"}, + {file = "coverage-6.3.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:91502bf27cbd5c83c95cfea291ef387469f2387508645602e1ca0fd8a4ba7548"}, + {file = "coverage-6.3.3-cp38-cp38-win32.whl", hash = "sha256:c488db059848702aff30aa1d90ef87928d4e72e4f00717343800546fdbff0a94"}, + {file = "coverage-6.3.3-cp38-cp38-win_amd64.whl", hash = "sha256:ceb6534fcdfb5c503affb6b1130db7b5bfc8a0f77fa34880146f7a5c117987d0"}, + {file = "coverage-6.3.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:cc692c9ee18f0dd3214843779ba6b275ee4bb9b9a5745ba64265bce911aefd1a"}, + {file = "coverage-6.3.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:462105283de203df8de58a68c1bb4ba2a8a164097c2379f664fa81d6baf94b81"}, + {file = "coverage-6.3.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc972d829ad5ef4d4c5fcabd2bbe2add84ce8236f64ba1c0c72185da3a273130"}, + {file = "coverage-6.3.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:06f54765cdbce99901871d50fe9f41d58213f18e98b170a30ca34f47de7dd5e8"}, + {file = "coverage-6.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7835f76a081787f0ca62a53504361b3869840a1620049b56d803a8cb3a9eeea3"}, + {file = "coverage-6.3.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:6f5fee77ec3384b934797f1873758f796dfb4f167e1296dc00f8b2e023ce6ee9"}, + {file = "coverage-6.3.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:baa8be8aba3dd1e976e68677be68a960a633a6d44c325757aefaa4d66175050f"}, + {file = "coverage-6.3.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4d06380e777dd6b35ee936f333d55b53dc4a8271036ff884c909cf6e94be8b6c"}, + {file = "coverage-6.3.3-cp39-cp39-win32.whl", hash = "sha256:f8cabc5fd0091976ab7b020f5708335033e422de25e20ddf9416bdce2b7e07d8"}, + {file = "coverage-6.3.3-cp39-cp39-win_amd64.whl", hash = "sha256:9c9441d57b0963cf8340268ad62fc83de61f1613034b79c2b1053046af0c5284"}, +] +"cppython-core 0.3.3.dev19" = [ + {file = "cppython_core-0.3.3.dev19-py3-none-any.whl", hash = "sha256:98f1cf0ec9789b8823279c471e9500f9ff99bd8659f42259cc1b9eac94abdc9e"}, + {file = "cppython-core-0.3.3.dev19.tar.gz", hash = "sha256:430c7eacfaeffea440c88340c036845d35dfd4c305262958cc3df4b95e2fa72e"}, ] "dill 0.3.4" = [ {file = "dill-0.3.4-py2.py3-none-any.whl", hash = "sha256:7e40e4a70304fd9ceab3535d36e58791d9c4a776b38ec7f7ec9afc8d3dca4d4f"}, @@ -464,9 +462,9 @@ content_hash = "sha256:9842348d0ddc71440b500499ed71e9b60aea9edcf388f5d8ef170c125 {file = "pylint-2.13.8-py3-none-any.whl", hash = "sha256:f87e863a0b08f64b5230e7e779bcb75276346995737b2c0dc2793070487b1ff6"}, {file = "pylint-2.13.8.tar.gz", hash = "sha256:ced8968c3b699df0615e2a709554dec3ddac2f5cd06efadb69554a69eeca364a"}, ] -"pyparsing 3.0.8" = [ - {file = "pyparsing-3.0.8-py3-none-any.whl", hash = "sha256:ef7b523f6356f763771559412c0d7134753f037822dad1b16945b7b846f7ad06"}, - {file = "pyparsing-3.0.8.tar.gz", hash = "sha256:7bf433498c016c4314268d95df76c81b842a4cb2b276fa3312cfb1e1d85f6954"}, +"pyparsing 3.0.9" = [ + {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, + {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, ] "pytest 7.1.2" = [ {file = "pytest-7.1.2-py3-none-any.whl", hash = "sha256:13d0e3ccfc2b6e26be000cb6568c832ba67ba32e719443bfe725814d3c42433c"}, @@ -484,9 +482,9 @@ content_hash = "sha256:9842348d0ddc71440b500499ed71e9b60aea9edcf388f5d8ef170c125 {file = "pytest_mock-3.7.0-py3-none-any.whl", hash = "sha256:6cff27cec936bf81dc5ee87f07132b807bcda51106b5ec4b90a04331cba76231"}, {file = "pytest-mock-3.7.0.tar.gz", hash = "sha256:5112bd92cc9f186ee96e1a92efc84969ea494939c3aead39c50f421c4cc69534"}, ] -"setuptools 62.1.0" = [ - {file = "setuptools-62.1.0-py3-none-any.whl", hash = "sha256:26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8"}, - {file = "setuptools-62.1.0.tar.gz", hash = "sha256:47c7b0c0f8fc10eec4cf1e71c6fdadf8decaa74ffa087e68cd1c20db7ad6a592"}, +"setuptools 62.2.0" = [ + {file = "setuptools-62.2.0-py3-none-any.whl", hash = "sha256:5534570b9980fc650d45c62877ff603c7aaaf24893371708736cc016bd221c3c"}, + {file = "setuptools-62.2.0.tar.gz", hash = "sha256:ca6ba73b7fd5f734ae70ece8c4c1f7062b07f3352f6428f6277e27c8f5c64237"}, ] "tomli 2.0.1" = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, diff --git a/tests/unit/test_project.py b/tests/unit/test_project.py index 892d95b..e6cb3d2 100644 --- a/tests/unit/test_project.py +++ b/tests/unit/test_project.py @@ -100,11 +100,13 @@ def test_generator_creation(self, mocker: MockerFixture): builder = ProjectBuilder(configuration) generator_configuration = GeneratorConfiguration() - generators = builder.create_generators([], generator_configuration, default_pyproject) + generators = builder.create_generators([], generator_configuration, default_pep621, default_cppython_data) assert not generators generator = mocker.Mock() - generators = builder.create_generators([generator], generator_configuration, default_pyproject) + generators = builder.create_generators( + [generator], generator_configuration, default_pep621, default_cppython_data + ) assert len(generators) == 1