From a6397e1886dc6de35e191b10010b910ef49f6dd8 Mon Sep 17 00:00:00 2001 From: vanyae-cqc Date: Tue, 25 Nov 2025 10:09:34 +0000 Subject: [PATCH] feat: warn on deprecated QuantinuumConfig usage --- .cz.toml | 5 ++++- quantinuum_schemas/models/backend_config.py | 22 +++++++++++++++++++++ uv.lock | 4 ++-- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.cz.toml b/.cz.toml index a7deb99..e6fc21e 100644 --- a/.cz.toml +++ b/.cz.toml @@ -3,7 +3,10 @@ name = "cz_customize" tag_format = "v$version" version = "7.3.0" version_scheme = "semver" -version_files = ["pyproject.toml"] +version_files = [ + "pyproject.toml:version", + "uv.lock:version" +] update_changelog_on_bump = true template = "templates/CHANGELOG.md.j2" diff --git a/quantinuum_schemas/models/backend_config.py b/quantinuum_schemas/models/backend_config.py index 9a390ec..29f780f 100644 --- a/quantinuum_schemas/models/backend_config.py +++ b/quantinuum_schemas/models/backend_config.py @@ -8,6 +8,7 @@ # pylint: disable=too-many-lines,no-member import abc from typing import Any, Dict, Literal, Optional, Type, TypeVar, Union +import warnings from pydantic import ConfigDict, PositiveInt, field_validator, model_validator from pydantic.fields import Field @@ -245,6 +246,27 @@ class QuantinuumConfig(BaseBackendConfig): max_cost: Optional[int] = None error_params: Optional[UserErrorParams] = None + @model_validator(mode="after") + def show_deprecation_warnings(self) -> Self: + """Warn about deprecated usage.""" + + if self.user_group is not None: + warnings.warn( + "'QuantinuumConfig.user_group' is deprecated and will be " + "removed in a future release. Please specify user_group in the execute job" + "submission parameters instead.", + DeprecationWarning, + ) + + if self.device_name.startswith("Helios"): + warnings.warn( + "QuantinuumConfig is deprecated for submission to Helios systems and support " + "will be removed in a future release. Please use HeliosConfig instead.", + DeprecationWarning, + ) + + return self + class IBMQConfig(BaseBackendConfig): """Runs circuits on IBM's quantum devices.""" diff --git a/uv.lock b/uv.lock index 1ab447f..8fd5b7d 100644 --- a/uv.lock +++ b/uv.lock @@ -833,7 +833,7 @@ wheels = [ [[package]] name = "quantinuum-schemas" -version = "7.2.0" +version = "7.3.0" source = { editable = "." } dependencies = [ { name = "orjson" }, @@ -868,7 +868,7 @@ dev = [ { name = "pylint-pytest", specifier = ">=1.1.8" }, { name = "pyright", specifier = ">=1.1.302" }, { name = "pytest", specifier = ">=8.0.0,<9.0.0" }, - { name = "pytest-cov", specifier = ">=5.0.0,<7.2.0" }, + { name = "pytest-cov", specifier = ">=5.0.0,<7.3.0" }, { name = "ruff", specifier = ">0.11" }, ]