diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..269d223 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @keriksson-rosenqvist @owen-oqc @hamidelmaazouz @bgsach \ No newline at end of file diff --git a/.github/workflows/package-publish.yml b/.github/workflows/package-publish.yml new file mode 100644 index 0000000..253a593 --- /dev/null +++ b/.github/workflows/package-publish.yml @@ -0,0 +1,124 @@ +name: Publish package to PyPI and TestPyPI + +on: + push: + branches: [ main ] + tags: [ '[0-9]+.[0-9]+.[0-9]+' ] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Poetry + uses: snok/install-poetry@v1 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Poetry install + run: poetry install --sync + + - name: Poetry build + run: poetry build + + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: Publish to PyPI + needs: + - build + runs-on: ubuntu-latest + env: + name: pypi + url: https://pypi.org/p/qat-config # Replace with your PyPI project name + permissions: + id-token: write + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + - name: Install Poetry + uses: snok/install-poetry@v1 + + github-release: + name: >- + Sign the Python distribution + and upload them to GitHub Release + needs: + - publish-to-pypi + runs-on: ubuntu-latest + + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + id-token: write # IMPORTANT: mandatory for sigstore + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v2.1.1 + with: + inputs: >- + ./dist/*.tar.gz + ./dist/*.whl + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release create + '${{ github.ref_name }}' + --repo '${{ github.repository }}' + --notes "" + - name: Upload artifact signatures to GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + # Upload to GitHub Release using the `gh` CLI. + # `dist/` contains the built packages, and the + # sigstore-produced signatures and certificates. + run: >- + gh release upload + '${{ github.ref_name }}' dist/** + --repo '${{ github.repository }}' + - name: Install Poetry + uses: snok/install-poetry@v1 + + publish-to-testpypi: + name: Publish to TestPyPI + needs: + - build + runs-on: ubuntu-latest + + env: + name: testpypi + url: https://test.pypi.org/p/qat-config + + permissions: + id-token: write + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/.github/workflows/package-tests.yml b/.github/workflows/package-tests.yml new file mode 100644 index 0000000..1e7b34b --- /dev/null +++ b/.github/workflows/package-tests.yml @@ -0,0 +1,101 @@ +name: Build + +on: + pull_request: + branches: [main, develop] + workflow_dispatch: + +permissions: + contents: write + actions: write + pull-requests: write + +run-name: Build from ${{ github.ref }} + +jobs: + formatting-tests: + name: Consistency and formatting + runs-on: ${{ matrix.os }} + strategy: + # fail-fast: true + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + python: ["3.10", "3.11", "3.12"] + defaults: + run: + shell: bash + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.x + uses: actions/setup-python@v5 + id: setup-python + with: + python-version: ${{ matrix.python }} + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Load cached venv + id: cached-pip-wheels + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install dependancies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --sync --with dev + + - name: Formatting tests + run: | + poetry run black --check . + poetry run isort --check . + poetry run autoflake --check . + poetry run pip-audit --desc + + + unit-tests: + name: Unit Tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + python: ["3.10", "3.11", "3.12"] + defaults: + run: + shell: bash + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.x + id: setup-python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Load cached venv + id: cached-pip-wheels + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install dependancies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --sync + + - name: Unit tests + run: poetry run pytest \ No newline at end of file diff --git a/compiler_config/__init__.py b/compiler_config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/compiler_config/config.py b/compiler_config/config.py new file mode 100644 index 0000000..dc870b3 --- /dev/null +++ b/compiler_config/config.py @@ -0,0 +1,447 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Oxford Quantum Circuits Ltd +from __future__ import annotations + +import inspect +import re +import sys +from enum import Enum, Flag, IntEnum, auto +from typing import List, Optional + +from compiler_config.serialiser import json_dumps, json_loads + + +class InlineResultsProcessing(Flag): + """ + Results transforms applied directly to the read-out value on the QPU. In most + situations applied post-execution, but can also be interwoven. + """ + + # Raw readout from the QPU. Normally Z-axis values for each shot. + Raw = auto() + + # Shot results averaged out to get a single 0/1 value for each qubit. + Binary = auto() + + # Return the values in numpy arrays not Python lists. + NumpyArrays = auto() + + Experiment = Raw | NumpyArrays + Program = Binary + + def __repr__(self): + return self.name + + +class ResultsFormatting(Flag): + # Transforms each shot into binary then counts the instances. + # Example for two qubits: { '00': 15, '01': 2524, '10': 250, '11': 730 } + BinaryCount = auto() + + # Change results value based on conditions for ease-of-use. Set as a flag because + # it means that return values from execution may change format unexpectedly, so + # should have a way to disable it for certain uses. + DynamicStructureReturn = auto() + + # If your qubit results are lists of binary, squash to one string representation. + # Changes 1: [1, 0, 0, 1] to 1: '1001'. + # Only works when Binary format is returned. + SquashBinaryResultArrays = auto() + + def __repr__(self): + return self.name + + +class QuantumResultsFormat: + def __init__(self): + self.format: Optional[InlineResultsProcessing] = None + self.transforms: Optional[ResultsFormatting] = ( + ResultsFormatting.DynamicStructureReturn + ) + + def raw(self) -> QuantumResultsFormat: + self.format = InlineResultsProcessing.Raw + return self + + def binary(self) -> QuantumResultsFormat: + self.format = InlineResultsProcessing.Binary + return self + + def binary_count(self): + """ + Returns a count of each instance of measured qubit registers. + Switches result format to raw. + """ + self.transforms = ( + ResultsFormatting.BinaryCount | ResultsFormatting.DynamicStructureReturn + ) + self.format = InlineResultsProcessing.Raw + return self + + def squash_binary_result_arrays(self): + """ + Squashes binary result list into a singular bit string. Switches results to + binary. + """ + self.transforms = ( + ResultsFormatting.SquashBinaryResultArrays + | ResultsFormatting.DynamicStructureReturn + ) + self.format = InlineResultsProcessing.Binary + return self + + def __contains__(self, other): + if isinstance(other, ResultsFormatting): + return self.transforms.__contains__(other) + elif isinstance(other, InlineResultsProcessing): + return self.format.__contains__(other) + return False + + def __or__(self, other): + if isinstance(other, ResultsFormatting): + self.transforms = self.transforms.__or__(other) + elif isinstance(other, InlineResultsProcessing): + self.format = self.format.__or__(other) + return self + + def __and__(self, other): + if isinstance(other, ResultsFormatting): + self.transforms = self.transforms.__and__(other) + elif isinstance(other, InlineResultsProcessing): + self.format = self.format.__and__(other) + return self + + def __xor__(self, other): + if isinstance(other, ResultsFormatting): + self.transforms = self.transforms.__xor__(other) + elif isinstance(other, InlineResultsProcessing): + self.format = self.format.__xor__(other) + return self + + def __repr__(self): + return f"Format: {str(self.format)}. Transforms: {str(self.transforms)}." + + def __eq__(self, other): + return self.format == other.format and self.transforms == other.transforms + + +class TketOptimizations(Flag): + """Flags for the various Tket optimizations we can apply.""" + + Empty = auto() + DefaultMappingPass = auto() + FullPeepholeOptimise = auto() + ContextSimp = auto() + DirectionalCXGates = auto() + CliffordSimp = auto() + DecomposeArbitrarilyControlledGates = auto() + # EulerAngleReduction = auto() + GlobalisePhasedX = auto() + # GuidedPauliSimp = auto() + KAKDecomposition = auto() + # OptimisePhaseGadgets = auto() + # PauliSimp = auto() + # PauliSquash = auto() + PeepholeOptimise2Q = auto() + RemoveDiscarded = auto() + RemoveBarriers = auto() + RemoveRedundancies = auto() + ThreeQubitSquash = auto() + SimplifyMeasured = auto() + + One = DefaultMappingPass | DirectionalCXGates + Two = One | FullPeepholeOptimise | ContextSimp + + +class QiskitOptimizations(Flag): + """Flags for the various Qiskit optimizations we can apply.""" + + Empty = auto() + + +class QatOptimizations(Flag): + """Flags for the various Qat optimizations we can apply.""" + + Empty = auto() + + +class MetricsType(Flag): + Empty = auto() + + # Returns circuit after optimizations have been run. + OptimizedCircuit = auto() + + # Count of transformed instructions after all forms of optimizations have + # been performed. + OptimizedInstructionCount = auto() + + # Set of basic metrics that should be returned at all times. + Default = OptimizedCircuit | OptimizedInstructionCount + + def is_composite(self): + """ + Any flags that are only composed of other ones should be signaled here. This + is used for automatic metric generation and whether to build/validate this + particular value. + """ + return self == self.Default or self == self.Empty + + def snake_case_name(self): + """ + Generate the Python field name that'll be used to hold the results of this + metric. + """ + name = self.name + name = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name) + return re.sub("([a-z0-9])([A-Z])", r"\1_\2", name).lower() + + +class ErrorMitigationConfig(Flag): + Empty = auto() + MatrixMitigation = auto() + LinearMitigation = auto() + + +class ExperimentalFeatures: + error_mitigation = ErrorMitigationConfig.Empty + + +class CompilerConfig: + """ + Full settings for the compiler. All values are defaulted on initialization. + + If no explicit optimizations are passed then the default set of optimization for the + language you're attempting to compile will be applied. + """ + + def __init__( + self, + repeats=None, + repetition_period=None, + results_format: QuantumResultsFormat = None, + metrics=MetricsType.Default, + active_calibrations=None, + optimizations: "OptimizationConfig" = None, + error_mitigation: ErrorMitigationConfig = None, + ): + self.repeats: Optional[int] = repeats + self.repetition_period: Optional[float] = repetition_period + self.results_format: QuantumResultsFormat = results_format or QuantumResultsFormat() + self.metrics: MetricsType = metrics + self.active_calibrations: List[CalibrationArguments] = active_calibrations or [] + self.optimizations: Optional[OptimizationConfig] = optimizations + self.error_mitigation: Optional[ErrorMitigationConfig] = error_mitigation + + def to_json(self): + return json_dumps(self, serializable_types=get_serializable_types()) + + def from_json(self, json: str): + vars(self).update( + vars(json_loads(json, serializable_types=get_serializable_types())) + ) + return self + + @classmethod + def create_from_json(cls, json: str): + return CompilerConfig().from_json(json) + + def validate(self, hardware): + + if ( + self.error_mitigation is not None + and self.error_mitigation != ErrorMitigationConfig.Empty + ): + if ( + hardware.error_mitigation is None + or not hardware.error_mitigation.readout_mitigation + ): + raise ValueError("Error mitigation not calibrated on this device.") + if ResultsFormatting.BinaryCount not in self.results_format: + raise ValueError( + "Binary Count format required for readout error mitigation" + ) + + +class CalibrationArguments: + """Base class for individual calibration arguments.""" + + def to_json(self): + return json_dumps(self) + + def from_json(self, json: str): + self.from_dict(json_loads(json)) + + def _get_field_names(self): + """Get existing field names for all attributes and properties""" + existing_field_names = set(vars(self).keys()) + # Include class properties + class_type = type(self) + for prop in dir(class_type): + if isinstance(getattr(class_type, prop), property): + existing_field_names.add(prop) + + return existing_field_names + + def from_dict(self, dict_values): + """ + Loads this dictionary into the arguments. Throws if key dosen't exist on the + object. + """ + valid_names = self._get_field_names() + invalid_fields = [val for val in dict_values.keys() if val not in valid_names] + if any(invalid_fields): + raise ValueError( + f"Field(s) {','.join(invalid_fields)} are not valid for " + f"{self.__class__.__name__}." + ) + + vars(self).update(dict_values) + + +class Languages(IntEnum): + Empty, Qasm2, Qasm3, QIR = range(4) + + def __repr__(self): + return self.name + + +class OptimizationConfig: + """ + Base class for instantiated optimizations as well as mix-in classes. Built this way + so we can mix and match optimization objects across multiple setups and languages + without duplication. + """ + + def __init__(self): + super().__init__() + + def default(self): + """Apply default set of optimizations to the current set.""" + return self + + def disable(self): + """Disable all optimizations.""" + return self + + def minimum(self): + """ + Apply minimum working set for current optimizations. + """ + return self + + def __contains__(self, item): + return False + + +class Tket(OptimizationConfig): + def __init__(self, tket_optimization=None): + super().__init__() + self.tket_optimizations: TketOptimizations = TketOptimizations.Empty + if tket_optimization is not None: + self.tket_optimizations = tket_optimization + + def default(self): + self.tket_optimizations = TketOptimizations.One + return self + + def disable(self): + self.tket_optimizations = TketOptimizations.Empty + return self + + def minimum(self): + self.tket_optimizations = TketOptimizations.DefaultMappingPass + return self + + def __contains__(self, item): + if isinstance(item, TketOptimizations) and item in self.tket_optimizations: + return True + return super().__contains__(item) + + +class Qiskit(OptimizationConfig): + def __init__(self): + super().__init__() + self.qiskit_optimizations: QiskitOptimizations = QiskitOptimizations.Empty + + def default(self): + self.qiskit_optimizations = QiskitOptimizations.Empty + return self + + def __contains__(self, item): + if isinstance(item, QiskitOptimizations) and item in self.qiskit_optimizations: + return True + return super().__contains__(item) + + +class Qasm2Optimizations(Tket, Qiskit): + def __init__(self): + super().__init__() + self.default() + + def __repr__(self): + return f"Qiskit: {self.qiskit_optimizations}. Tket: {self.tket_optimizations}." + + +class Qasm3Optimizations(OptimizationConfig): + pass + + +class QIROptimizations(OptimizationConfig): + pass + + +def get_optimizer_config(lang: Languages) -> Optional[OptimizationConfig]: + """ + Returns the optimization config for this particular language. None if no valid ones + found. + """ + if lang == Languages.Qasm2: + return Qasm2Optimizations() + elif lang == Languages.Qasm3: + return Qasm3Optimizations() + elif lang == Languages.QIR: + return QIROptimizations() + return None + + +def get_config(lang: Languages, **kwargs): + """ + Helper method to build a compiler config for a particular language. Forwards + keywords to the CompilerConfig constructor. + """ + config = CompilerConfig(**kwargs) + config.optimizations = get_optimizer_config(lang) + return config + + +serializable_types_dict = None + + +def get_serializable_types(): + global serializable_types_dict + + if serializable_types_dict is not None: + return serializable_types_dict + + serializable_types = {} + + def update_dict(type): + if issubclass(type, Enum): + serializable_types.update({f"": type}) + else: + serializable_types.update({str(type): type}) + + def get_serializable_types_dict(type): + update_dict(type) + + for subclass in type.__subclasses__(): + get_serializable_types_dict(subclass) + + types_in_module = inspect.getmembers(sys.modules[__name__], inspect.isclass) + + for name, typ in types_in_module: + get_serializable_types_dict(typ) + + serializable_types_dict = serializable_types + + return serializable_types_dict diff --git a/compiler_config/serialiser.py b/compiler_config/serialiser.py new file mode 100644 index 0000000..87fbc1d --- /dev/null +++ b/compiler_config/serialiser.py @@ -0,0 +1,181 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Oxford Quantum Circuits Ltd +import json +import re +import sys +from dataclasses import asdict, is_dataclass +from enum import Enum +from importlib import import_module +from json import JSONDecoder, JSONEncoder + + +# Set of common methods so we don't have to add/remove the custom serializer. +def json_dumps(*args, serializable_types=None, **kwargs): + kwargs.setdefault("cls", CustomJSONEncoder) + return json.dumps(*args, serializable_types=serializable_types, **kwargs) + + +def json_loads(*args, serializable_types=None, **kwargs): + kwargs.setdefault("cls", CustomJsonDecoder) + return json.loads(*args, serializable_types=serializable_types, **kwargs) + + +def json_dump(*args, serializable_types=None, **kwargs): + kwargs.setdefault("cls", CustomJSONEncoder) + return json.dump(*args, serializable_types=serializable_types, **kwargs) + + +def json_load(*args, serializable_types=None, **kwargs): + kwargs.setdefault("cls", CustomJsonDecoder) + return json.load(*args, serializable_types=serializable_types, **kwargs) + + +class CustomJsonDecoder(JSONDecoder): + def __init__(self, *args, serializable_types=None, model=None, **kwargs): + self.serializable_types = serializable_types + super().__init__(object_hook=self.default, *args, **kwargs) + + def default(self, obj): + if not isinstance(obj, dict): + return obj + + # Components are objects directly related to hardware and you never want to serialize them, so we re-link + # upon deserialization. + + obj_type = obj.get("$type") + if obj_type is None: + return obj + + if obj_type == "": + return tuple(obj["$data"]) + + if self.serializable_types is not None: + old_paths = ["scc.compiler.config", "qat.purr.compiler.config"] + for old_path in old_paths: + if old_path in obj_type: + obj_type = obj_type.replace(old_path, "compiler_config.config") + break + + typ = self.serializable_types.get(obj_type) + if typ is None: + raise ValueError(f"Invalid type attempted to be serialized: {obj_type}.") + else: + typ = _get_type(obj_type) + + if issubclass(typ, Enum): + return typ(obj["$value"]) + + if "$data" in obj: + data = obj["$data"] + if obj.get("$dataclass", False): + fields = self.default(data) + return typ(**fields) + elif isinstance(data, dict): + new_obj = object.__new__(typ) + new_obj.__dict__ = {key: self.default(value) for key, value in data.items()} + return new_obj + elif isinstance(data, str): + return typ(data) + else: + return data + + return obj + + +class CustomJSONEncoder(JSONEncoder): + """ + It is a customised JSON encoder, which allows the serialization of the more complex + objects. + + There are four major cases, based on the provided object to be serialized: + + - if the type of the object is supported by the default :class:`JSONEncoder`, than + the default method is used. + - if the class of the object is a :class:`dataclass`, then the serialization will + contain the name of the type, ``dataclass`` flag in order to help at the + deserialization, and the dictionary of the fields. + - if the object is none from the above, then the type name is saved, and the + interior data using ``__dict__``. + - if an exception is encountered from any cases from above (e.g. ``__dict__`` is not + available in case of complex numbers), then the type name is saved, and the data + is the string representation of the object. + """ + + def __init__(self, *args, serializable_types=None, **kwargs): + self.serializable_types = serializable_types + super().__init__(*args, **kwargs) + + def default(self, obj): + typ = type(obj) + if issubclass(typ, Enum): + typ_str = f"" + else: + typ_str = str(typ) + + if self.serializable_types is not None: + if ( + typ_str not in self.serializable_types + and type(obj).__module__ != "builtins" + ): + raise ValueError(f"Invalid type attempted to be serialized: {(type(obj))}.") + + try: + + # TODO: Acquire is a special wrapper component, not an actual component. Have a few too many special-cases + # for it now, think about reverting its special status. + if is_dataclass(obj): + return { + "$type": typ_str, + "$dataclass": True, + "$data": self.default(asdict(obj)), + } + elif isinstance(obj, Enum): + return {"$type": typ_str, "$value": obj.value} + elif isinstance(obj, complex): + return {"$type": typ_str, "$data": str(obj)} + elif isinstance(obj, tuple): + return { + "$type": typ_str, + "$data": tuple(self.default(val) for val in obj), + } + + if hasattr(obj, "__dict__"): + return { + "$type": typ_str, + "$data": { + key: self.default(value) for key, value in obj.__dict__.items() + }, + } + except (TypeError, AttributeError): + pass + + return obj + + +_type_name_matcher = r"<(?:class|enum) '((?:\w+\.)*)(\w+)'>" + + +def _get_type(s: str): + match = re.match(_type_name_matcher, s) + if match: + namespace = match.group(1) + if namespace != "": + expanded_namespace = namespace[:-1].split(".") + module_name = expanded_namespace.pop(0) + imported_module = import_module(module_name) + for item in expanded_namespace: + module_name = f"{module_name}.{item}" + try: + imported_module = getattr(imported_module, item) + except AttributeError: + import_module(module_name) + imported_module = getattr(imported_module, item) + else: + imported_module = sys.modules["builtins"] + try: + return getattr(imported_module, match.group(2)) + except AttributeError: + raise AttributeError( + f"Class {s} not found in built-in modules or namespace '{namespace}'" + ) + return None diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..ba77f41 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,823 @@ +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. + +[[package]] +name = "autoflake" +version = "2.3.1" +description = "Removes unused imports and unused variables" +optional = false +python-versions = ">=3.8" +files = [ + {file = "autoflake-2.3.1-py3-none-any.whl", hash = "sha256:3ae7495db9084b7b32818b4140e6dc4fc280b712fb414f5b8fe57b0a8e85a840"}, + {file = "autoflake-2.3.1.tar.gz", hash = "sha256:c98b75dc5b0a86459c4f01a1d32ac7eb4338ec4317a4469515ff1e687ecd909e"}, +] + +[package.dependencies] +pyflakes = ">=3.0.0" +tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} + +[[package]] +name = "black" +version = "24.4.2" +description = "The uncompromising code formatter." +optional = false +python-versions = ">=3.8" +files = [ + {file = "black-24.4.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dd1b5a14e417189db4c7b64a6540f31730713d173f0b63e55fabd52d61d8fdce"}, + {file = "black-24.4.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8e537d281831ad0e71007dcdcbe50a71470b978c453fa41ce77186bbe0ed6021"}, + {file = "black-24.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eaea3008c281f1038edb473c1aa8ed8143a5535ff18f978a318f10302b254063"}, + {file = "black-24.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:7768a0dbf16a39aa5e9a3ded568bb545c8c2727396d063bbaf847df05b08cd96"}, + {file = "black-24.4.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:257d724c2c9b1660f353b36c802ccece186a30accc7742c176d29c146df6e474"}, + {file = "black-24.4.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bdde6f877a18f24844e381d45e9947a49e97933573ac9d4345399be37621e26c"}, + {file = "black-24.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e151054aa00bad1f4e1f04919542885f89f5f7d086b8a59e5000e6c616896ffb"}, + {file = "black-24.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:7e122b1c4fb252fd85df3ca93578732b4749d9be076593076ef4d07a0233c3e1"}, + {file = "black-24.4.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:accf49e151c8ed2c0cdc528691838afd217c50412534e876a19270fea1e28e2d"}, + {file = "black-24.4.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:88c57dc656038f1ab9f92b3eb5335ee9b021412feaa46330d5eba4e51fe49b04"}, + {file = "black-24.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be8bef99eb46d5021bf053114442914baeb3649a89dc5f3a555c88737e5e98fc"}, + {file = "black-24.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:415e686e87dbbe6f4cd5ef0fbf764af7b89f9057b97c908742b6008cc554b9c0"}, + {file = "black-24.4.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bf10f7310db693bb62692609b397e8d67257c55f949abde4c67f9cc574492cc7"}, + {file = "black-24.4.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:98e123f1d5cfd42f886624d84464f7756f60ff6eab89ae845210631714f6db94"}, + {file = "black-24.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:48a85f2cb5e6799a9ef05347b476cce6c182d6c71ee36925a6c194d074336ef8"}, + {file = "black-24.4.2-cp38-cp38-win_amd64.whl", hash = "sha256:b1530ae42e9d6d5b670a34db49a94115a64596bc77710b1d05e9801e62ca0a7c"}, + {file = "black-24.4.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:37aae07b029fa0174d39daf02748b379399b909652a806e5708199bd93899da1"}, + {file = "black-24.4.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:da33a1a5e49c4122ccdfd56cd021ff1ebc4a1ec4e2d01594fef9b6f267a9e741"}, + {file = "black-24.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef703f83fc32e131e9bcc0a5094cfe85599e7109f896fe8bc96cc402f3eb4b6e"}, + {file = "black-24.4.2-cp39-cp39-win_amd64.whl", hash = "sha256:b9176b9832e84308818a99a561e90aa479e73c523b3f77afd07913380ae2eab7"}, + {file = "black-24.4.2-py3-none-any.whl", hash = "sha256:d36ed1124bb81b32f8614555b34cc4259c3fbc7eec17870e8ff8ded335b58d8c"}, + {file = "black-24.4.2.tar.gz", hash = "sha256:c872b53057f000085da66a19c55d68f6f8ddcac2642392ad3a355878406fbd4d"}, +] + +[package.dependencies] +click = ">=8.0.0" +mypy-extensions = ">=0.4.3" +packaging = ">=22.0" +pathspec = ">=0.9.0" +platformdirs = ">=2" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] + +[[package]] +name = "boolean-py" +version = "4.0" +description = "Define boolean algebras, create and parse boolean expressions and create custom boolean DSL." +optional = false +python-versions = "*" +files = [ + {file = "boolean.py-4.0-py3-none-any.whl", hash = "sha256:2876f2051d7d6394a531d82dc6eb407faa0b01a0a0b3083817ccd7323b8d96bd"}, + {file = "boolean.py-4.0.tar.gz", hash = "sha256:17b9a181630e43dde1851d42bef546d616d5d9b4480357514597e78b203d06e4"}, +] + +[[package]] +name = "cachecontrol" +version = "0.14.0" +description = "httplib2 caching for requests" +optional = false +python-versions = ">=3.7" +files = [ + {file = "cachecontrol-0.14.0-py3-none-any.whl", hash = "sha256:f5bf3f0620c38db2e5122c0726bdebb0d16869de966ea6a2befe92470b740ea0"}, + {file = "cachecontrol-0.14.0.tar.gz", hash = "sha256:7db1195b41c81f8274a7bbd97c956f44e8348265a1bc7641c37dfebc39f0c938"}, +] + +[package.dependencies] +filelock = {version = ">=3.8.0", optional = true, markers = "extra == \"filecache\""} +msgpack = ">=0.5.2,<2.0.0" +requests = ">=2.16.0" + +[package.extras] +dev = ["CacheControl[filecache,redis]", "black", "build", "cherrypy", "furo", "mypy", "pytest", "pytest-cov", "sphinx", "sphinx-copybutton", "tox", "types-redis", "types-requests"] +filecache = ["filelock (>=3.8.0)"] +redis = ["redis (>=2.10.5)"] + +[[package]] +name = "certifi" +version = "2024.8.30" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, + {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, +] + +[[package]] +name = "charset-normalizer" +version = "3.3.2" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, + {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, +] + +[[package]] +name = "click" +version = "8.1.7" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.7" +files = [ + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "cyclonedx-python-lib" +version = "7.6.0" +description = "Python library for CycloneDX" +optional = false +python-versions = "<4.0,>=3.8" +files = [ + {file = "cyclonedx_python_lib-7.6.0-py3-none-any.whl", hash = "sha256:30655e89e5f987dc8d57835919748d71589fafeb33ff1dec45048eb72eda3cf9"}, + {file = "cyclonedx_python_lib-7.6.0.tar.gz", hash = "sha256:fa481d5f0d82728cb6a32e55f8ba9c666ba75a2bd99eb643228e3011c56bb5c4"}, +] + +[package.dependencies] +license-expression = ">=30,<31" +packageurl-python = ">=0.11,<2" +py-serializable = ">=1.1.0,<2.0.0" +sortedcontainers = ">=2.4.0,<3.0.0" + +[package.extras] +json-validation = ["jsonschema[format] (>=4.18,<5.0)"] +validation = ["jsonschema[format] (>=4.18,<5.0)", "lxml (>=4,<6)"] +xml-validation = ["lxml (>=4,<6)"] + +[[package]] +name = "defusedxml" +version = "0.7.1" +description = "XML bomb protection for Python stdlib modules" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "defusedxml-0.7.1-py2.py3-none-any.whl", hash = "sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61"}, + {file = "defusedxml-0.7.1.tar.gz", hash = "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69"}, +] + +[[package]] +name = "exceptiongroup" +version = "1.2.2" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "filelock" +version = "3.15.4" +description = "A platform independent file lock." +optional = false +python-versions = ">=3.8" +files = [ + {file = "filelock-3.15.4-py3-none-any.whl", hash = "sha256:6ca1fffae96225dab4c6eaf1c4f4f28cd2568d3ec2a44e15a08520504de468e7"}, + {file = "filelock-3.15.4.tar.gz", hash = "sha256:2207938cbc1844345cb01a5a95524dae30f0ce089eba5b00378295a17e3e90cb"}, +] + +[package.extras] +docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pytest-asyncio (>=0.21)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)", "virtualenv (>=20.26.2)"] +typing = ["typing-extensions (>=4.8)"] + +[[package]] +name = "html5lib" +version = "1.1" +description = "HTML parser based on the WHATWG HTML specification" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "html5lib-1.1-py2.py3-none-any.whl", hash = "sha256:0d78f8fde1c230e99fe37986a60526d7049ed4bf8a9fadbad5f00e22e58e041d"}, + {file = "html5lib-1.1.tar.gz", hash = "sha256:b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f"}, +] + +[package.dependencies] +six = ">=1.9" +webencodings = "*" + +[package.extras] +all = ["chardet (>=2.2)", "genshi", "lxml"] +chardet = ["chardet (>=2.2)"] +genshi = ["genshi"] +lxml = ["lxml"] + +[[package]] +name = "idna" +version = "3.8" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.6" +files = [ + {file = "idna-3.8-py3-none-any.whl", hash = "sha256:050b4e5baadcd44d760cedbd2b8e639f2ff89bbc7a5730fcc662954303377aac"}, + {file = "idna-3.8.tar.gz", hash = "sha256:d838c2c0ed6fced7693d5e8ab8e734d5f8fda53a039c0164afb0b82e771e3603"}, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] + +[[package]] +name = "isort" +version = "5.13.2" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, +] + +[package.extras] +colors = ["colorama (>=0.4.6)"] + +[[package]] +name = "license-expression" +version = "30.3.1" +description = "license-expression is a comprehensive utility library to parse, compare, simplify and normalize license expressions (such as SPDX license expressions) using boolean logic." +optional = false +python-versions = ">=3.8" +files = [ + {file = "license_expression-30.3.1-py3-none-any.whl", hash = "sha256:97904b9185c7bbb1e98799606fa7424191c375e70ba63a524b6f7100e42ddc46"}, + {file = "license_expression-30.3.1.tar.gz", hash = "sha256:60d5bec1f3364c256a92b9a08583d7ea933c7aa272c8d36d04144a89a3858c01"}, +] + +[package.dependencies] +"boolean.py" = ">=4.0" + +[package.extras] +docs = ["Sphinx (>=5.0.2)", "doc8 (>=0.11.2)", "sphinx-autobuild", "sphinx-copybutton", "sphinx-reredirects (>=0.1.2)", "sphinx-rtd-dark-mode (>=1.3.0)", "sphinx-rtd-theme (>=1.0.0)", "sphinxcontrib-apidoc (>=0.4.0)"] +testing = ["black", "isort", "pytest (>=6,!=7.0.0)", "pytest-xdist (>=2)", "twine"] + +[[package]] +name = "markdown-it-py" +version = "3.0.0" +description = "Python port of markdown-it. Markdown parsing, done right!" +optional = false +python-versions = ">=3.8" +files = [ + {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"}, + {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"}, +] + +[package.dependencies] +mdurl = ">=0.1,<1.0" + +[package.extras] +benchmarking = ["psutil", "pytest", "pytest-benchmark"] +code-style = ["pre-commit (>=3.0,<4.0)"] +compare = ["commonmark (>=0.9,<1.0)", "markdown (>=3.4,<4.0)", "mistletoe (>=1.0,<2.0)", "mistune (>=2.0,<3.0)", "panflute (>=2.3,<3.0)"] +linkify = ["linkify-it-py (>=1,<3)"] +plugins = ["mdit-py-plugins"] +profiling = ["gprof2dot"] +rtd = ["jupyter_sphinx", "mdit-py-plugins", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx_book_theme"] +testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] + +[[package]] +name = "mdurl" +version = "0.1.2" +description = "Markdown URL utilities" +optional = false +python-versions = ">=3.7" +files = [ + {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, + {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, +] + +[[package]] +name = "msgpack" +version = "1.0.8" +description = "MessagePack serializer" +optional = false +python-versions = ">=3.8" +files = [ + {file = "msgpack-1.0.8-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:505fe3d03856ac7d215dbe005414bc28505d26f0c128906037e66d98c4e95868"}, + {file = "msgpack-1.0.8-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e6b7842518a63a9f17107eb176320960ec095a8ee3b4420b5f688e24bf50c53c"}, + {file = "msgpack-1.0.8-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:376081f471a2ef24828b83a641a02c575d6103a3ad7fd7dade5486cad10ea659"}, + {file = "msgpack-1.0.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e390971d082dba073c05dbd56322427d3280b7cc8b53484c9377adfbae67dc2"}, + {file = "msgpack-1.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:00e073efcba9ea99db5acef3959efa45b52bc67b61b00823d2a1a6944bf45982"}, + {file = "msgpack-1.0.8-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82d92c773fbc6942a7a8b520d22c11cfc8fd83bba86116bfcf962c2f5c2ecdaa"}, + {file = "msgpack-1.0.8-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:9ee32dcb8e531adae1f1ca568822e9b3a738369b3b686d1477cbc643c4a9c128"}, + {file = "msgpack-1.0.8-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e3aa7e51d738e0ec0afbed661261513b38b3014754c9459508399baf14ae0c9d"}, + {file = "msgpack-1.0.8-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:69284049d07fce531c17404fcba2bb1df472bc2dcdac642ae71a2d079d950653"}, + {file = "msgpack-1.0.8-cp310-cp310-win32.whl", hash = "sha256:13577ec9e247f8741c84d06b9ece5f654920d8365a4b636ce0e44f15e07ec693"}, + {file = "msgpack-1.0.8-cp310-cp310-win_amd64.whl", hash = "sha256:e532dbd6ddfe13946de050d7474e3f5fb6ec774fbb1a188aaf469b08cf04189a"}, + {file = "msgpack-1.0.8-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9517004e21664f2b5a5fd6333b0731b9cf0817403a941b393d89a2f1dc2bd836"}, + {file = "msgpack-1.0.8-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d16a786905034e7e34098634b184a7d81f91d4c3d246edc6bd7aefb2fd8ea6ad"}, + {file = "msgpack-1.0.8-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e2872993e209f7ed04d963e4b4fbae72d034844ec66bc4ca403329db2074377b"}, + {file = "msgpack-1.0.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c330eace3dd100bdb54b5653b966de7f51c26ec4a7d4e87132d9b4f738220ba"}, + {file = "msgpack-1.0.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:83b5c044f3eff2a6534768ccfd50425939e7a8b5cf9a7261c385de1e20dcfc85"}, + {file = "msgpack-1.0.8-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1876b0b653a808fcd50123b953af170c535027bf1d053b59790eebb0aeb38950"}, + {file = "msgpack-1.0.8-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:dfe1f0f0ed5785c187144c46a292b8c34c1295c01da12e10ccddfc16def4448a"}, + {file = "msgpack-1.0.8-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3528807cbbb7f315bb81959d5961855e7ba52aa60a3097151cb21956fbc7502b"}, + {file = "msgpack-1.0.8-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e2f879ab92ce502a1e65fce390eab619774dda6a6ff719718069ac94084098ce"}, + {file = "msgpack-1.0.8-cp311-cp311-win32.whl", hash = "sha256:26ee97a8261e6e35885c2ecd2fd4a6d38252246f94a2aec23665a4e66d066305"}, + {file = "msgpack-1.0.8-cp311-cp311-win_amd64.whl", hash = "sha256:eadb9f826c138e6cf3c49d6f8de88225a3c0ab181a9b4ba792e006e5292d150e"}, + {file = "msgpack-1.0.8-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:114be227f5213ef8b215c22dde19532f5da9652e56e8ce969bf0a26d7c419fee"}, + {file = "msgpack-1.0.8-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d661dc4785affa9d0edfdd1e59ec056a58b3dbb9f196fa43587f3ddac654ac7b"}, + {file = "msgpack-1.0.8-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d56fd9f1f1cdc8227d7b7918f55091349741904d9520c65f0139a9755952c9e8"}, + {file = "msgpack-1.0.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0726c282d188e204281ebd8de31724b7d749adebc086873a59efb8cf7ae27df3"}, + {file = "msgpack-1.0.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8db8e423192303ed77cff4dce3a4b88dbfaf43979d280181558af5e2c3c71afc"}, + {file = "msgpack-1.0.8-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:99881222f4a8c2f641f25703963a5cefb076adffd959e0558dc9f803a52d6a58"}, + {file = "msgpack-1.0.8-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b5505774ea2a73a86ea176e8a9a4a7c8bf5d521050f0f6f8426afe798689243f"}, + {file = "msgpack-1.0.8-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:ef254a06bcea461e65ff0373d8a0dd1ed3aa004af48839f002a0c994a6f72d04"}, + {file = "msgpack-1.0.8-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:e1dd7839443592d00e96db831eddb4111a2a81a46b028f0facd60a09ebbdd543"}, + {file = "msgpack-1.0.8-cp312-cp312-win32.whl", hash = "sha256:64d0fcd436c5683fdd7c907eeae5e2cbb5eb872fafbc03a43609d7941840995c"}, + {file = "msgpack-1.0.8-cp312-cp312-win_amd64.whl", hash = "sha256:74398a4cf19de42e1498368c36eed45d9528f5fd0155241e82c4082b7e16cffd"}, + {file = "msgpack-1.0.8-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:0ceea77719d45c839fd73abcb190b8390412a890df2f83fb8cf49b2a4b5c2f40"}, + {file = "msgpack-1.0.8-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1ab0bbcd4d1f7b6991ee7c753655b481c50084294218de69365f8f1970d4c151"}, + {file = "msgpack-1.0.8-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:1cce488457370ffd1f953846f82323cb6b2ad2190987cd4d70b2713e17268d24"}, + {file = "msgpack-1.0.8-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3923a1778f7e5ef31865893fdca12a8d7dc03a44b33e2a5f3295416314c09f5d"}, + {file = "msgpack-1.0.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a22e47578b30a3e199ab067a4d43d790249b3c0587d9a771921f86250c8435db"}, + {file = "msgpack-1.0.8-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bd739c9251d01e0279ce729e37b39d49a08c0420d3fee7f2a4968c0576678f77"}, + {file = "msgpack-1.0.8-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d3420522057ebab1728b21ad473aa950026d07cb09da41103f8e597dfbfaeb13"}, + {file = "msgpack-1.0.8-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:5845fdf5e5d5b78a49b826fcdc0eb2e2aa7191980e3d2cfd2a30303a74f212e2"}, + {file = "msgpack-1.0.8-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6a0e76621f6e1f908ae52860bdcb58e1ca85231a9b0545e64509c931dd34275a"}, + {file = "msgpack-1.0.8-cp38-cp38-win32.whl", hash = "sha256:374a8e88ddab84b9ada695d255679fb99c53513c0a51778796fcf0944d6c789c"}, + {file = "msgpack-1.0.8-cp38-cp38-win_amd64.whl", hash = "sha256:f3709997b228685fe53e8c433e2df9f0cdb5f4542bd5114ed17ac3c0129b0480"}, + {file = "msgpack-1.0.8-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:f51bab98d52739c50c56658cc303f190785f9a2cd97b823357e7aeae54c8f68a"}, + {file = "msgpack-1.0.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:73ee792784d48aa338bba28063e19a27e8d989344f34aad14ea6e1b9bd83f596"}, + {file = "msgpack-1.0.8-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f9904e24646570539a8950400602d66d2b2c492b9010ea7e965025cb71d0c86d"}, + {file = "msgpack-1.0.8-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e75753aeda0ddc4c28dce4c32ba2f6ec30b1b02f6c0b14e547841ba5b24f753f"}, + {file = "msgpack-1.0.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5dbf059fb4b7c240c873c1245ee112505be27497e90f7c6591261c7d3c3a8228"}, + {file = "msgpack-1.0.8-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4916727e31c28be8beaf11cf117d6f6f188dcc36daae4e851fee88646f5b6b18"}, + {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7938111ed1358f536daf311be244f34df7bf3cdedb3ed883787aca97778b28d8"}, + {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:493c5c5e44b06d6c9268ce21b302c9ca055c1fd3484c25ba41d34476c76ee746"}, + {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, + {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, + {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, + {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, +] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + +[[package]] +name = "packageurl-python" +version = "0.15.6" +description = "A purl aka. Package URL parser and builder" +optional = false +python-versions = ">=3.7" +files = [ + {file = "packageurl_python-0.15.6-py3-none-any.whl", hash = "sha256:a40210652c89022772a6c8340d6066f7d5dc67132141e5284a4db7a27d0a8ab0"}, + {file = "packageurl_python-0.15.6.tar.gz", hash = "sha256:cbc89afd15d5f4d05db4f1b61297e5b97a43f61f28799f6d282aff467ed2ee96"}, +] + +[package.extras] +build = ["setuptools", "wheel"] +lint = ["black", "isort", "mypy"] +sqlalchemy = ["sqlalchemy (>=2.0.0)"] +test = ["pytest"] + +[[package]] +name = "packaging" +version = "24.1" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, + {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, +] + +[[package]] +name = "pathspec" +version = "0.12.1" +description = "Utility library for gitignore style pattern matching of file paths." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, + {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, +] + +[[package]] +name = "pip" +version = "24.2" +description = "The PyPA recommended tool for installing Python packages." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pip-24.2-py3-none-any.whl", hash = "sha256:2cd581cf58ab7fcfca4ce8efa6dcacd0de5bf8d0a3eb9ec927e07405f4d9e2a2"}, + {file = "pip-24.2.tar.gz", hash = "sha256:5b5e490b5e9cb275c879595064adce9ebd31b854e3e803740b72f9ccf34a45b8"}, +] + +[[package]] +name = "pip-api" +version = "0.0.34" +description = "An unofficial, importable pip API" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pip_api-0.0.34-py3-none-any.whl", hash = "sha256:8b2d7d7c37f2447373aa2cf8b1f60a2f2b27a84e1e9e0294a3f6ef10eb3ba6bb"}, + {file = "pip_api-0.0.34.tar.gz", hash = "sha256:9b75e958f14c5a2614bae415f2adf7eeb54d50a2cfbe7e24fd4826471bac3625"}, +] + +[package.dependencies] +pip = "*" + +[[package]] +name = "pip-audit" +version = "2.7.3" +description = "A tool for scanning Python environments for known vulnerabilities" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pip_audit-2.7.3-py3-none-any.whl", hash = "sha256:46a11faee3323f76adf7987de8171daeb660e8f57d8088cc27fb1c1e5c7747b0"}, + {file = "pip_audit-2.7.3.tar.gz", hash = "sha256:08891bbf179bffe478521f150818112bae998424f58bf9285c0078965aef38bc"}, +] + +[package.dependencies] +CacheControl = {version = ">=0.13.0", extras = ["filecache"]} +cyclonedx-python-lib = ">=5,<8" +html5lib = ">=1.1" +packaging = ">=23.0.0" +pip-api = ">=0.0.28" +pip-requirements-parser = ">=32.0.0" +requests = ">=2.31.0" +rich = ">=12.4" +toml = ">=0.10" + +[package.extras] +dev = ["build", "bump (>=1.3.2)", "pip-audit[doc,lint,test]"] +doc = ["pdoc"] +lint = ["interrogate", "mypy", "ruff (<0.4.3)", "setuptools", "types-html5lib", "types-requests", "types-toml"] +test = ["coverage[toml] (>=7.0,!=7.3.3,<8.0)", "pretend", "pytest", "pytest-cov"] + +[[package]] +name = "pip-requirements-parser" +version = "32.0.1" +description = "pip requirements parser - a mostly correct pip requirements parsing library because it uses pip's own code." +optional = false +python-versions = ">=3.6.0" +files = [ + {file = "pip-requirements-parser-32.0.1.tar.gz", hash = "sha256:b4fa3a7a0be38243123cf9d1f3518da10c51bdb165a2b2985566247f9155a7d3"}, + {file = "pip_requirements_parser-32.0.1-py3-none-any.whl", hash = "sha256:4659bc2a667783e7a15d190f6fccf8b2486685b6dba4c19c3876314769c57526"}, +] + +[package.dependencies] +packaging = "*" +pyparsing = "*" + +[package.extras] +docs = ["Sphinx (>=3.3.1)", "doc8 (>=0.8.1)", "sphinx-rtd-theme (>=0.5.0)"] +testing = ["aboutcode-toolkit (>=6.0.0)", "black", "pytest (>=6,!=7.0.0)", "pytest-xdist (>=2)"] + +[[package]] +name = "platformdirs" +version = "4.2.2" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." +optional = false +python-versions = ">=3.8" +files = [ + {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, + {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, +] + +[package.extras] +docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] +type = ["mypy (>=1.8)"] + +[[package]] +name = "pluggy" +version = "1.5.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "py-serializable" +version = "1.1.0" +description = "Library for serializing and deserializing Python Objects to and from JSON and XML." +optional = false +python-versions = "<4.0,>=3.8" +files = [ + {file = "py_serializable-1.1.0-py3-none-any.whl", hash = "sha256:ae7ae4326b0d037b7e710f6e8bb1a97ece4ac2895a1f443a17ffd17f85547d76"}, + {file = "py_serializable-1.1.0.tar.gz", hash = "sha256:3311ab39063b131caca0fb75e2038153682e55576c67f24a2de72d402dccb6e0"}, +] + +[package.dependencies] +defusedxml = ">=0.7.1,<0.8.0" + +[[package]] +name = "pyflakes" +version = "3.2.0" +description = "passive checker of Python programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, +] + +[[package]] +name = "pygments" +version = "2.18.0" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a"}, + {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, +] + +[package.extras] +windows-terminal = ["colorama (>=0.4.6)"] + +[[package]] +name = "pyparsing" +version = "3.1.4" +description = "pyparsing module - Classes and methods to define and execute parsing grammars" +optional = false +python-versions = ">=3.6.8" +files = [ + {file = "pyparsing-3.1.4-py3-none-any.whl", hash = "sha256:a6a7ee4235a3f944aa1fa2249307708f893fe5717dc603503c6c7969c070fb7c"}, + {file = "pyparsing-3.1.4.tar.gz", hash = "sha256:f86ec8d1a83f11977c9a6ea7598e8c27fc5cddfa5b07ea2241edbbde1d7bc032"}, +] + +[package.extras] +diagrams = ["jinja2", "railroad-diagrams"] + +[[package]] +name = "pytest" +version = "8.3.2" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-8.3.2-py3-none-any.whl", hash = "sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5"}, + {file = "pytest-8.3.2.tar.gz", hash = "sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=1.5,<2" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} + +[package.extras] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "requests" +version = "2.32.3" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.8" +files = [ + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "rich" +version = "13.8.0" +description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "rich-13.8.0-py3-none-any.whl", hash = "sha256:2e85306a063b9492dffc86278197a60cbece75bcb766022f3436f567cae11bdc"}, + {file = "rich-13.8.0.tar.gz", hash = "sha256:a5ac1f1cd448ade0d59cc3356f7db7a7ccda2c8cbae9c7a90c28ff463d3e91f4"}, +] + +[package.dependencies] +markdown-it-py = ">=2.2.0" +pygments = ">=2.13.0,<3.0.0" +typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9\""} + +[package.extras] +jupyter = ["ipywidgets (>=7.5.1,<9)"] + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "sortedcontainers" +version = "2.4.0" +description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set" +optional = false +python-versions = "*" +files = [ + {file = "sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0"}, + {file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"}, +] + +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] + +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, +] + +[[package]] +name = "urllib3" +version = "2.2.2" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.8" +files = [ + {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, + {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +h2 = ["h2 (>=4,<5)"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "webencodings" +version = "0.5.1" +description = "Character encoding aliases for legacy web content" +optional = false +python-versions = "*" +files = [ + {file = "webencodings-0.5.1-py2.py3-none-any.whl", hash = "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78"}, + {file = "webencodings-0.5.1.tar.gz", hash = "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"}, +] + +[metadata] +lock-version = "2.0" +python-versions = ">=3.8.1,<3.13" +content-hash = "d748e725a4ae5228b60468d18cb93dd7b72366c7b0dc884ccfb564fb2d03be7d" diff --git a/poetry_scripts.py b/poetry_scripts.py new file mode 100644 index 0000000..e7bee77 --- /dev/null +++ b/poetry_scripts.py @@ -0,0 +1,7 @@ +import os + + +def format_code(): + os.system("poetry run black .") + os.system("poetry run isort .") + os.system("poetry run autoflake .") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bb68695 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,48 @@ +[tool.poetry] +name = "compiler-config" +version = "1.0.0" +description = "" +authors = ["jamie "] +readme = "README.md" + +packages = [ + { include = "compiler_config" } +] + + +[tool.poetry.dependencies] +python = ">=3.8.1,<3.13" + + +[tool.poetry.group.dev.dependencies] +pytest = "^8.3.2" +isort = "^5.13.2" +black = "^24.4.2" +autoflake = "^2.3.1" +pip-audit = "^2.7.3" + + +[tool.autoflake] +remove-all-unused-imports = true +ignore-init-module-imports = true +ignore-pass-after-docstring = true +in-place = true +recursive = true + +[tool.isort] +py_version = 39 +profile = "black" +line_length = 92 +known_first_party = ["qat"] + +[tool.black] +line-length = 92 +target-version = ["py38", "py39", "py310"] + +[tool.poetry.scripts] +format-code = "poetry_scripts:format_code" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..df768bb --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,19 @@ +from os.path import abspath, dirname, join + +SUPPORTED_CONFIG_VERSIONS = ["v02", "v01", "v1"] + + +class TestType: + pass + + +def _get_json_path(file_name): + return join( + abspath(join(dirname(__file__), "serialised_compiler_config_templates", file_name)) + ) + + +def _get_contents(file_path): + """Get Json from a file.""" + with open(_get_json_path(file_path)) as ifile: + return ifile.read() diff --git a/tests/serialised_compiler_config_templates/serialised_default_compiler_config_v01.json b/tests/serialised_compiler_config_templates/serialised_default_compiler_config_v01.json new file mode 100644 index 0000000..8bfc5cb --- /dev/null +++ b/tests/serialised_compiler_config_templates/serialised_default_compiler_config_v01.json @@ -0,0 +1 @@ +{"$type": "", "$data": {"repeats": null, "repetition_period": null, "results_format": {"$type": "", "$data": {"format": null, "transforms": {"$type": "", "$value": 2}}}, "metrics": {"$type": "", "$value": 6}, "active_calibrations": [], "optimizations": null}} diff --git a/tests/serialised_compiler_config_templates/serialised_default_compiler_config_v02.json b/tests/serialised_compiler_config_templates/serialised_default_compiler_config_v02.json new file mode 100644 index 0000000..13a5df5 --- /dev/null +++ b/tests/serialised_compiler_config_templates/serialised_default_compiler_config_v02.json @@ -0,0 +1 @@ +{"$type": "", "$data": {"repeats": null, "repetition_period": null, "results_format": {"$type": "", "$data": {"format": null, "transforms": {"$type": "", "$value": 2}}}, "metrics": {"$type": "", "$value": 6}, "active_calibrations": [], "optimizations": null}} diff --git a/tests/serialised_compiler_config_templates/serialised_default_compiler_config_v1.json b/tests/serialised_compiler_config_templates/serialised_default_compiler_config_v1.json new file mode 100644 index 0000000..98b08cf --- /dev/null +++ b/tests/serialised_compiler_config_templates/serialised_default_compiler_config_v1.json @@ -0,0 +1 @@ +{"$type": "", "$data": {"repeats": null, "repetition_period": null, "results_format": {"$type": "", "$data": {"format": null, "transforms": {"$type": "", "$value": 2}}}, "metrics": {"$type": "", "$value": 6}, "active_calibrations": [], "optimizations": null}} diff --git a/tests/serialised_compiler_config_templates/serialised_full_compiler_config_v01.json b/tests/serialised_compiler_config_templates/serialised_full_compiler_config_v01.json new file mode 100644 index 0000000..3aad4ca --- /dev/null +++ b/tests/serialised_compiler_config_templates/serialised_full_compiler_config_v01.json @@ -0,0 +1 @@ +{"$type": "", "$data": {"repeats": 1000, "repetition_period": 10, "results_format": {"$type": "", "$data": {"format": {"$type": "", "$value": 2}, "transforms": {"$type": "", "$value": 2}}}, "metrics": {"$type": "", "$value": 4}, "active_calibrations": [], "optimizations": {"$type": "", "$data": {"qiskit_optimizations": {"$type": "", "$value": 1}, "tket_optimizations": {"$type": "", "$value": 18}}}}} diff --git a/tests/serialised_compiler_config_templates/serialised_full_compiler_config_v02.json b/tests/serialised_compiler_config_templates/serialised_full_compiler_config_v02.json new file mode 100644 index 0000000..0e4b328 --- /dev/null +++ b/tests/serialised_compiler_config_templates/serialised_full_compiler_config_v02.json @@ -0,0 +1 @@ +{"$type": "", "$data": {"repeats": 1000, "repetition_period": 10, "results_format": {"$type": "", "$data": {"format": {"$type": "", "$value": 2}, "transforms": {"$type": "", "$value": 2}}}, "metrics": {"$type": "", "$value": 4}, "active_calibrations": [], "optimizations": {"$type": "", "$data": {"qiskit_optimizations": {"$type": "", "$value": 1}, "tket_optimizations": {"$type": "", "$value": 18}}}}} diff --git a/tests/serialised_compiler_config_templates/serialised_full_compiler_config_v1.json b/tests/serialised_compiler_config_templates/serialised_full_compiler_config_v1.json new file mode 100644 index 0000000..5c791ca --- /dev/null +++ b/tests/serialised_compiler_config_templates/serialised_full_compiler_config_v1.json @@ -0,0 +1 @@ +{"$type": "", "$data": {"repeats": 1000, "repetition_period": 10, "results_format": {"$type": "", "$data": {"format": {"$type": "", "$value": 2}, "transforms": {"$type": "", "$value": 2}}}, "metrics": {"$type": "", "$value": 4}, "active_calibrations": [], "optimizations": {"$type": "", "$data": {"qiskit_optimizations": {"$type": "", "$value": 1}, "tket_optimizations": {"$type": "", "$value": 18}}}}} diff --git a/tests/test_config.py b/tests/test_config.py new file mode 100644 index 0000000..0ac2290 --- /dev/null +++ b/tests/test_config.py @@ -0,0 +1,173 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Oxford Quantum Circuits Ltd + +from sys import __loader__ + +import pytest +from conftest import SUPPORTED_CONFIG_VERSIONS, TestType, _get_contents + +from compiler_config.config import ( + CompilerConfig, + InlineResultsProcessing, + MetricsType, + OptimizationConfig, + Qasm2Optimizations, + QiskitOptimizations, + QuantumResultsFormat, + ResultsFormatting, + TketOptimizations, +) + + +def test_config_opt_contains(): + opt = Qasm2Optimizations() + assert TketOptimizations.DefaultMappingPass in opt + assert QiskitOptimizations.Empty in opt + + +def test_default_config(): + first_conf = CompilerConfig() + serialized_data = first_conf.to_json() + second_conf = CompilerConfig.create_from_json(serialized_data) + + assert first_conf.results_format.format == second_conf.results_format.format + assert first_conf.results_format.transforms == second_conf.results_format.transforms + + conf1_dict = dict(vars(first_conf)) + del conf1_dict["results_format"] + conf2_dict = dict(vars(second_conf)) + del conf2_dict["results_format"] + + assert conf1_dict == conf2_dict + + +def test_specific_config_optimizations(): + first_conf = CompilerConfig() + first_conf.optimizations = Qasm2Optimizations() + serialized_data = first_conf.to_json() + second_conf = CompilerConfig.create_from_json(serialized_data) + assert ( + first_conf.optimizations.tket_optimizations + == second_conf.optimizations.tket_optimizations + ) + assert ( + first_conf.optimizations.qiskit_optimizations + == second_conf.optimizations.qiskit_optimizations + ) + + +def test_all_config_optimizations(): + def get_subclasses(object): + subclasses = [] + + def find_subclasses(obj): + for subclass in obj.__subclasses__(): + subclasses.append(subclass) + find_subclasses(subclass) + + find_subclasses(object) + + return subclasses + + optimizations = get_subclasses(OptimizationConfig) + + first_conf = CompilerConfig() + + for optimization in optimizations: + first_conf.optimizations = optimization() + serialized_data = first_conf.to_json() + second_conf = CompilerConfig.create_from_json(serialized_data) + + assert vars(first_conf.optimizations) == vars(second_conf.optimizations) + + +def test_config_repeats(): + first_conf = CompilerConfig() + first_conf.repeats = 1000 + first_conf.repetition_period = 10 + serialized_data = first_conf.to_json() + second_conf = CompilerConfig.create_from_json(serialized_data) + + assert first_conf.repeats == second_conf.repeats + assert first_conf.repetition_period == second_conf.repetition_period + + +def test_config_metrics(): + first_conf = CompilerConfig() + + for value in MetricsType: + first_conf.metrics = value + serialized_data = first_conf.to_json() + second_conf = CompilerConfig.create_from_json(serialized_data) + + assert first_conf.metrics == second_conf.metrics + + +def test_config_quantum_results_format(): + first_conf = CompilerConfig() + + for format in InlineResultsProcessing: + for transform in ResultsFormatting: + first_conf.results_format = QuantumResultsFormat() + first_conf.results_format.format = format + first_conf.results_format.transforms = transform + serialized_data = first_conf.to_json() + second_conf = CompilerConfig.create_from_json(serialized_data) + + assert first_conf.results_format == second_conf.results_format + + +def test_config_serialisation_raises_error(): + class A: + pass + + first_conf = CompilerConfig() + first_conf.optimizations = A() # A is not an allowed type + + with pytest.raises(ValueError): + first_conf.to_json() + + first_conf.optimizations = TestType # Not an allowed custom type in project + + with pytest.raises(ValueError): + first_conf.to_json() + + first_conf.optimizations = __loader__ # Not an allowed type from system module + + with pytest.raises(ValueError): + first_conf.to_json() + + +def test_config_deserialization_raises_error(): + serialized_data = str( + { + "$type": "", + "$data": {"repeats": 1000, "repetition_period": 1000}, + } + ) + with pytest.raises(ValueError): + CompilerConfig.create_from_json(serialized_data) + + +@pytest.mark.parametrize("version", SUPPORTED_CONFIG_VERSIONS) +def test_json_version_compatibility_default(version): + serialised_data = _get_contents(f"serialised_default_compiler_config_{version}.json") + deserialised_conf = CompilerConfig.create_from_json(serialised_data) + assert deserialised_conf.metrics == MetricsType.Default + assert deserialised_conf.results_format == QuantumResultsFormat() + + +@pytest.mark.parametrize("version", SUPPORTED_CONFIG_VERSIONS) +def test_json_version_compatibility_full(version): + serialised_data = _get_contents(f"serialised_full_compiler_config_{version}.json") + deserialised_conf = CompilerConfig.create_from_json(serialised_data) + assert deserialised_conf.repeats == 1000 + assert deserialised_conf.repetition_period == 10 + assert deserialised_conf.metrics == MetricsType.OptimizedInstructionCount + assert deserialised_conf.results_format.format == InlineResultsProcessing.Binary + assert ( + deserialised_conf.results_format.transforms + == ResultsFormatting.DynamicStructureReturn + ) + assert deserialised_conf.optimizations.qiskit_optimizations == QiskitOptimizations.Empty + assert deserialised_conf.optimizations.tket_optimizations == TketOptimizations.One