From 31bfe0bc3984fd43e74d1e8ca06f009352c5e7df Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:11:41 +0200 Subject: [PATCH 01/20] chore(ty): add ty as dev dependency and minimal [tool.ty] config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pin ty==0.0.32 (matches ../infrahub) and configure environment.python-version to 3.10 — the project's floor — so checks reflect the broadest supported API. No suppressions and no CI integration yet; subsequent commits add the lint invoke task, capture the baseline, and drive per-module fixes. Co-Authored-By: Claude Opus 4.7 (1M context) --- pyproject.toml | 6 ++++++ uv.lock | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index c2f2d95..b3e4c2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ dev = [ "ruff==0.15.5", "pytest>=9.0.2,<10", "pytest-xdist>=3.8", + "ty==0.0.32", "types-python-slugify>=8.0.2.20240310", ] @@ -300,3 +301,8 @@ max-complexity = 33 "tasks/**.py" = [ "T201", # print() is standard for invoke task status messages ] + +[tool.ty] + +[tool.ty.environment] +python-version = "3.10" diff --git a/uv.lock b/uv.lock index a7b751c..32e66ad 100644 --- a/uv.lock +++ b/uv.lock @@ -506,6 +506,7 @@ dev = [ { name = "pytest-xdist" }, { name = "requests" }, { name = "ruff" }, + { name = "ty" }, { name = "typer-cli" }, { name = "types-python-slugify" }, { name = "types-pyyaml" }, @@ -531,6 +532,7 @@ requires-dist = [ { name = "ruff", marker = "extra == 'dev'", specifier = "==0.15.5" }, { name = "structlog", specifier = ">=25.1,<26.0" }, { name = "tqdm", specifier = ">=4.67" }, + { name = "ty", marker = "extra == 'dev'", specifier = "==0.0.32" }, { name = "typer-cli", marker = "extra == 'dev'" }, { name = "types-python-slugify", marker = "extra == 'dev'", specifier = ">=8.0.2.20240310" }, { name = "types-pyyaml", marker = "extra == 'dev'" }, @@ -1656,6 +1658,30 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl", hash = "sha256:b74e89e397b1ed28cc831db7aea759ba6640cb3de13090ca145426688ff1ac4f", size = 85359, upload-time = "2024-04-19T11:11:46.763Z" }, ] +[[package]] +name = "ty" +version = "0.0.32" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/85/7e/2aa791c9ae7b8cd5024cd4122e92267f664ca954cea3def3211919fa3c1f/ty-0.0.32.tar.gz", hash = "sha256:8743174c5f920f6700a4a0c9de140109189192ba16226884cd50095b43b8a45c", size = 5522294, upload-time = "2026-04-20T19:29:01.626Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/eb/1075dc6a49d7acbe2584ae4d5b410c41b1f177a5adcc567e09eca4c69000/ty-0.0.32-py3-none-linux_armv6l.whl", hash = "sha256:dacbc2f6cd698d488ae7436838ff929570455bf94bfa4d9fe57a630c552aff83", size = 10902959, upload-time = "2026-04-20T19:28:31.907Z" }, + { url = "https://files.pythonhosted.org/packages/33/d2/c35fc8bc66e98d1ee9b0f8ed319bf743e450e1f1e997574b178fab75670f/ty-0.0.32-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:914bbc4f605ce2a9e2a78982e28fae1d3359a169d141f9dc3b4c7749cd5eca81", size = 10726172, upload-time = "2026-04-20T19:28:44.765Z" }, + { url = "https://files.pythonhosted.org/packages/96/32/c827da3ca480456fb02d8cea68a2609273b6c220fea0be9a4c8d8470b86e/ty-0.0.32-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4787ac9fe1f86b1f3133f5c6732adbe2df5668b50c679ac6e2d98cd284da812f", size = 10163701, upload-time = "2026-04-20T19:28:27.005Z" }, + { url = "https://files.pythonhosted.org/packages/ba/9e/2734478fbdb90c160cb2813a3916a16a2af5c1e231f87d635f6131d781fb/ty-0.0.32-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8ea0a728af99fe40dd744cba6441a2404f80b7f4bde17aa6da393810af5ea57", size = 10656220, upload-time = "2026-04-20T19:29:03.814Z" }, + { url = "https://files.pythonhosted.org/packages/44/9f/0007da2d35e424debe7e9f86ffbc1ab7f60983cfbc5f0411324ab2de5292/ty-0.0.32-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2850561f9b018ae33d7e5bbfa0ac414d3c518513edcffe43877dc9801446b9c5", size = 10696086, upload-time = "2026-04-20T19:28:46.829Z" }, + { url = "https://files.pythonhosted.org/packages/3b/5e/ce5fd4ec803222ae3e69a76d2a2db2eed55e19f5b131702b9789ef45f93d/ty-0.0.32-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b5fa2fb3c614349ee211d36476b49d88c5ef79a687cdb91b2872ad023b94d2f8", size = 11184800, upload-time = "2026-04-20T19:28:42.57Z" }, + { url = "https://files.pythonhosted.org/packages/6c/46/ebcf67a5999421331214aac51a7464db42de2be15bbe929c612a3ed0b039/ty-0.0.32-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2b89969307ab2417d41c9be8059dd79feea577234e1e10d35132f5495e0d42c6", size = 11718718, upload-time = "2026-04-20T19:28:36.433Z" }, + { url = "https://files.pythonhosted.org/packages/18/2c/2141c86ed0ce0962b45cefb658a95e734f59759d47f20afdcd9c732910a1/ty-0.0.32-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b59868ede9b1d69a088f0d695df52a0061f95fa7baa1d5e0dc6fc9cf06e1334", size = 11346369, upload-time = "2026-04-20T19:28:48.967Z" }, + { url = "https://files.pythonhosted.org/packages/7a/da/ed6f772339cf29bd9a46def9d6db5084689eb574ee4d150ff704224c1ed8/ty-0.0.32-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8300caf35345498e9b9b03e550bba03cee8f5f5f8ab4c83c3b1ff1b7403b7d3a", size = 11280714, upload-time = "2026-04-20T19:28:51.516Z" }, + { url = "https://files.pythonhosted.org/packages/da/9b/c6813987edf4816a40e0c8e408b555f97d3f267c7b3a1688c8bbdf65609c/ty-0.0.32-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:583c7094f4574b02f724db924f98b804d1387a0bd9405ecb5e078cc0f47fbcfb", size = 10638806, upload-time = "2026-04-20T19:28:29.651Z" }, + { url = "https://files.pythonhosted.org/packages/4e/d4/0cefcbd2ad0f3d51762ccf58e652ec7da146eb6ae34f87228f6254bbb8be/ty-0.0.32-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e44ebe1bb4143a5628bc4db67ac0dfebe14594af671e4ee66f6f2e983da56501", size = 10726106, upload-time = "2026-04-20T19:29:06.3Z" }, + { url = "https://files.pythonhosted.org/packages/32/ad/2c8a97f91f06311f4367400f7d13534bbda2522c73c99a3e4c0757dff9b8/ty-0.0.32-py3-none-musllinux_1_2_i686.whl", hash = "sha256:06f17ada3e069cba6148342ef88e9929156beca8473e8d4f101b68f66c75643e", size = 10872951, upload-time = "2026-04-20T19:28:34.077Z" }, + { url = "https://files.pythonhosted.org/packages/ba/68/42293f9248106dd51875120971a5cc6ea315c2c4dcfb8e59aa063aa0af26/ty-0.0.32-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e96e60fa556cec04f15d7ea62d2ceee5982bd389233e961ab9fd42304e278175", size = 11363334, upload-time = "2026-04-20T19:28:54.036Z" }, + { url = "https://files.pythonhosted.org/packages/df/92/be9abf4d3e589ad5023e2ea965b93e204ec856420d46adf73c5c36c04678/ty-0.0.32-py3-none-win32.whl", hash = "sha256:2ff2ebb4986b24aebcf1444db7db5ca41b36086040e95eea9f8fb851c11e805c", size = 10260689, upload-time = "2026-04-20T19:28:56.541Z" }, + { url = "https://files.pythonhosted.org/packages/14/61/dc86acea899349d2579cb8419aecedd83dc504d7d6a10df65eef546c8300/ty-0.0.32-py3-none-win_amd64.whl", hash = "sha256:ba7284a4a954b598c1b31500352b3ec1f89bff533825592b5958848226fdc7ee", size = 11255371, upload-time = "2026-04-20T19:28:39.917Z" }, + { url = "https://files.pythonhosted.org/packages/43/01/beffec56d71ca25b343ede63adb076456b5b3e211f1c066452a44cd120b3/ty-0.0.32-py3-none-win_arm64.whl", hash = "sha256:7e10aadbdbda989a7d567ee6a37f8b98d4d542e31e3b190a2879fd581f75d658", size = 10658087, upload-time = "2026-04-20T19:28:59.286Z" }, +] + [[package]] name = "typer" version = "0.23.1" From fa341a721beb0cb0e7c0dadd55d10934b5bce656 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:13:45 +0200 Subject: [PATCH 02/20] chore(ty): add lint-ty invoke task and wire into `invoke lint` `uv run invoke lint` now runs ruff -> pylint -> yaml -> ty. The aggregate currently exits non-zero because ty reports the existing 302 diagnostics; subsequent commits suppress the baseline (T4) and then fix per module (T6). Co-Authored-By: Claude Opus 4.7 (1M context) --- tasks/linter.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tasks/linter.py b/tasks/linter.py index 9673a14..c6b804d 100644 --- a/tasks/linter.py +++ b/tasks/linter.py @@ -16,6 +16,7 @@ def lint_all(context: Context) -> None: lint_ruff(context) lint_pylint(context) lint_yaml(context) + lint_ty(context) print(f" - [{NAMESPACE}] All linter have been executed!") @@ -67,6 +68,17 @@ def lint_yaml(context: Context) -> None: context.run(exec_cmd, pty=True) +@task +def lint_ty(context: Context) -> None: + """Run ty type checker against project files.""" + + print(f" - [{NAMESPACE}] Check code with ty") + exec_cmd = "uv run ty check ." + + with context.cd(ESCAPED_REPO_PATH): + context.run(exec_cmd) + + # ---------------------------------------------------------------------------- # Formatting tasks - Python # ---------------------------------------------------------------------------- From ca11ab7eebcc599d4ed1800d18a99549a097a120 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:16:14 +0200 Subject: [PATCH 03/20] chore(ty): capture ty error baseline for migration tracking Baseline output from `uv run ty check .` plus rule-name and per-module diagnostic distributions. Used to drive [tool.ty.overrides] suppressions in the next commit; removed at the end of the migration. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/superpowers/notes/ty-baseline.txt | 3087 ++++++++++++++++++++++++ 1 file changed, 3087 insertions(+) create mode 100644 docs/superpowers/notes/ty-baseline.txt diff --git a/docs/superpowers/notes/ty-baseline.txt b/docs/superpowers/notes/ty-baseline.txt new file mode 100644 index 0000000..7d5663e --- /dev/null +++ b/docs/superpowers/notes/ty-baseline.txt @@ -0,0 +1,3087 @@ +warning[unsupported-base]: Unsupported class base + --> examples/aci_to_infrahub/aci/sync_models.py:26:26 + | +26 | class DcimPhysicalDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `DcimPhysicalDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/aci_to_infrahub/aci/sync_models.py:41:29 + | +41 | class DcimPhysicalInterface(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `DcimPhysicalInterface` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/aci_to_infrahub/aci/sync_models.py:53:24 + | +53 | class LocationBuilding(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationBuilding` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/aci_to_infrahub/aci/sync_models.py:65:21 + | +65 | class LocationMetro(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationMetro` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/aci_to_infrahub/aci/sync_models.py:76:28 + | +76 | class OrganizationCustomer(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationCustomer` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/aci_to_infrahub/infrahub/sync_models.py:26:26 + | +26 | class DcimPhysicalDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `DcimPhysicalDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/aci_to_infrahub/infrahub/sync_models.py:41:29 + | +41 | class DcimPhysicalInterface(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `DcimPhysicalInterface` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/aci_to_infrahub/infrahub/sync_models.py:53:24 + | +53 | class LocationBuilding(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationBuilding` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/aci_to_infrahub/infrahub/sync_models.py:65:21 + | +65 | class LocationMetro(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationMetro` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/aci_to_infrahub/infrahub/sync_models.py:76:28 + | +76 | class OrganizationCustomer(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationCustomer` due to this base +info: Only class objects or `Any` are supported as class bases + +error[unresolved-import]: Module `typing` has no member `Self` + --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:9:24 + | +9 | from typing import Self + | ^^^^ + | +info: The member may be available on other Python versions or platforms +info: Python 3.10 was assumed when resolving imports + --> pyproject.toml:308:18 + | +308 | python-version = "3.10" + | ^^^^^^ Python version configuration + | + +error[invalid-argument-type]: Argument to bound method `MockDBClient.get_all_nodes` is incorrect + --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:114:51 + | +114 | nodes = self.client.get_all_nodes(resource_name) + | ^^^^^^^^^^^^^ Expected `str`, found `str | None` + | +info: element `None` of union `str | None` is not assignable to `str` +info: Method defined here + --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:52:9 + | +52 | def get_all_nodes(self, model: str) -> list[dict[str, Any]]: + | ^^^^^^^^^^^^^ ---------- Parameter declared here + | + +error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` + --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:118:55 + | +118 | if self.config.source.name.title() == self.type.title(): + | ^^^^^^^^^^^^^^^ + | + +error[call-non-callable]: Object of type `MockdbModel` is not callable + --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:132:30 + | +132 | self.add(model(**data)) + | ^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` + --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:172:67 + | +172 | … matched = [ref for ref in all_refs if ref.local_id == str(ref_id)] + | ^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` + --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:180:67 + | +180 | … matched = [ref for ref in all_refs if ref.local_id == str(ref_id)] + | ^^^^^^^^^^^^ + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:198:48 + | +198 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ --------- Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:198:57 + | +198 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ ----------- Parameter declared here + | + +warning[unsupported-base]: Unsupported class base + --> examples/custom_adapter/infrahub/sync_models.py:26:19 + | +26 | class InfraDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/custom_adapter/mockdb/sync_models.py:26:19 + | +26 | class InfraDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/device42_to_infrahub/genericrestapi/sync_models.py:26:18 + | +26 | class BuiltinTag(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/device42_to_infrahub/genericrestapi/sync_models.py:36:20 + | +36 | class LocationSite(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationSite` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/device42_to_infrahub/genericrestapi/sync_models.py:47:26 + | +47 | class OrganizationTenant(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationTenant` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/device42_to_infrahub/infrahub/sync_models.py:26:18 + | +26 | class BuiltinTag(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/device42_to_infrahub/infrahub/sync_models.py:36:20 + | +36 | class LocationSite(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationSite` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/device42_to_infrahub/infrahub/sync_models.py:47:26 + | +47 | class OrganizationTenant(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationTenant` due to this base +info: Only class objects or `Any` are supported as class bases + +error[unresolved-import]: Cannot resolve imported module `.sync_models` + --> examples/infrahub_to_peering-manager/infrahub/sync_adapter.py:5:7 + | +5 | from .sync_models import ( + | ^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:26:29 + | +26 | class InfraAutonomousSystem(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:42:25 + | +42 | class InfraBGPPeerGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPPeerGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:57:25 + | +57 | class InfraBGPCommunity(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPCommunity` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:71:29 + | +71 | class InfraBGPRoutingPolicy(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPRoutingPolicy` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:87:16 + | +87 | class InfraIXP(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXP` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:102:26 + | +102 | class InfraIXPConnection(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXPConnection` due to this base +info: Only class objects or `Any` are supported as class bases + +error[unresolved-import]: Cannot resolve imported module `.sync_models` + --> examples/infrahub_to_peering-manager/peeringmanager/sync_adapter.py:5:7 + | +5 | from .sync_models import ( + | ^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:26:29 + | +26 | class InfraAutonomousSystem(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:42:25 + | +42 | class InfraBGPPeerGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPPeerGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:57:25 + | +57 | class InfraBGPCommunity(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPCommunity` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:71:29 + | +71 | class InfraBGPRoutingPolicy(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPRoutingPolicy` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:87:16 + | +87 | class InfraIXP(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXP` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:102:26 + | +102 | class InfraIXPConnection(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXPConnection` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/librenms_to_infrahub/genericrestapi/sync_models.py:26:25 + | +26 | class CoreStandardGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/librenms_to_infrahub/genericrestapi/sync_models.py:37:19 + | +37 | class InfraDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/librenms_to_infrahub/genericrestapi/sync_models.py:49:21 + | +49 | class IpamIPAddress(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/librenms_to_infrahub/genericrestapi/sync_models.py:60:20 + | +60 | class LocationSite(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationSite` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/librenms_to_infrahub/infrahub/sync_models.py:26:25 + | +26 | class CoreStandardGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/librenms_to_infrahub/infrahub/sync_models.py:37:19 + | +37 | class InfraDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/librenms_to_infrahub/infrahub/sync_models.py:49:21 + | +49 | class IpamIPAddress(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/librenms_to_infrahub/infrahub/sync_models.py:60:20 + | +60 | class LocationSite(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationSite` due to this base +info: Only class objects or `Any` are supported as class bases + +error[unresolved-import]: Cannot resolve imported module `infrahub_sync.adapters.librenms` + --> examples/librenms_to_infrahub/librenms/sync_adapter.py:1:6 + | +1 | from infrahub_sync.adapters.librenms import LibrenmsAdapter + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-import]: Cannot resolve imported module `infrahub_sync.adapters.librenms` + --> examples/librenms_to_infrahub/librenms/sync_models.py:5:6 + | +5 | from infrahub_sync.adapters.librenms import LibrenmsModel + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-import]: Cannot resolve imported module `.sync_models` + --> examples/nautobot-v1_to_infrahub/infrahub/sync_adapter.py:3:7 + | +3 | from .sync_models import ( + | ^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-import]: Cannot resolve imported module `.sync_models` + --> examples/nautobot-v1_to_infrahub/nautobot/sync_adapter.py:3:7 + | +3 | from .sync_models import ( + | ^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-import]: Cannot resolve imported module `.sync_models` + --> examples/nautobot-v2_to_infrahub/infrahub/sync_adapter.py:5:7 + | +5 | from .sync_models import ( + | ^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:26:25 + | +26 | class CoreStandardGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:37:18 + | +37 | class BuiltinTag(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:48:29 + | +48 | class InfraAutonomousSystem(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:61:20 + | +61 | class InfraCircuit(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraCircuit` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:77:25 + | +77 | class ChoiceCircuitType(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceCircuitType` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:88:19 + | +88 | class InfraDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:108:24 + | +108 | class ChoiceDeviceType(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceDeviceType` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:123:22 + | +123 | class InfraFrontPort(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraFrontPort` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:137:26 + | +137 | class InfraInterfaceL2L3(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraInterfaceL2L3` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:166:22 + | +166 | class InfraIPAddress(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIPAddress` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:182:26 + | +182 | class ChoiceLocationType(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceLocationType` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:193:25 + | +193 | class NautobotNamespace(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `NautobotNamespace` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:204:21 + | +204 | class InfraPlatform(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPlatform` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:217:28 + | +217 | class InfraProviderNetwork(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraProviderNetwork` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:232:19 + | +232 | class InfraPrefix(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPrefix` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:249:17 + | +249 | class InfraRack(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRack` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:266:21 + | +266 | class InfraRearPort(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRearPort` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:279:24 + | +279 | class InfraRouteTarget(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRouteTarget` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:291:17 + | +291 | class InfraVLAN(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVLAN` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:308:16 + | +308 | class InfraVRF(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVRF` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:324:27 + | +324 | class OrganizationGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:337:21 + | +337 | class StatusGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `StatusGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:349:19 + | +349 | class RoleGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `RoleGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:361:23 + | +361 | class LocationGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +error[unresolved-import]: Cannot resolve imported module `.sync_models` + --> examples/nautobot-v2_to_infrahub/nautobot/sync_adapter.py:5:7 + | +5 | from .sync_models import ( + | ^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:26:25 + | +26 | class CoreStandardGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:37:18 + | +37 | class BuiltinTag(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:48:29 + | +48 | class InfraAutonomousSystem(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:61:20 + | +61 | class InfraCircuit(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraCircuit` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:77:25 + | +77 | class ChoiceCircuitType(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceCircuitType` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:88:19 + | +88 | class InfraDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:108:24 + | +108 | class ChoiceDeviceType(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceDeviceType` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:123:22 + | +123 | class InfraFrontPort(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraFrontPort` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:137:26 + | +137 | class InfraInterfaceL2L3(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraInterfaceL2L3` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:166:22 + | +166 | class InfraIPAddress(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIPAddress` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:182:26 + | +182 | class ChoiceLocationType(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceLocationType` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:193:25 + | +193 | class NautobotNamespace(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `NautobotNamespace` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:204:21 + | +204 | class InfraPlatform(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPlatform` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:217:28 + | +217 | class InfraProviderNetwork(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraProviderNetwork` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:232:19 + | +232 | class InfraPrefix(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPrefix` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:249:17 + | +249 | class InfraRack(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRack` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:266:21 + | +266 | class InfraRearPort(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRearPort` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:279:24 + | +279 | class InfraRouteTarget(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRouteTarget` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:291:17 + | +291 | class InfraVLAN(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVLAN` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:308:16 + | +308 | class InfraVRF(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVRF` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:324:27 + | +324 | class OrganizationGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:337:21 + | +337 | class StatusGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `StatusGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:349:19 + | +349 | class RoleGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `RoleGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:361:23 + | +361 | class LocationGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:26:25 + | +26 | class CoreStandardGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:37:18 + | +37 | class BuiltinTag(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:48:25 + | +48 | class ChoiceCircuitType(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceCircuitType` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:60:24 + | +60 | class ChoiceDeviceType(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceDeviceType` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:75:20 + | +75 | class InfraCircuit(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraCircuit` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:90:19 + | +90 | class InfraDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:109:22 + | +109 | class InfraIPAddress(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIPAddress` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:122:26 + | +122 | class InfraInterfaceL2L3(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraInterfaceL2L3` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:141:19 + | +141 | class InfraPrefix(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPrefix` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:156:28 + | +156 | class InfraProviderNetwork(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraProviderNetwork` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:170:17 + | +170 | class InfraRack(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRack` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:187:24 + | +187 | class InfraRouteTarget(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRouteTarget` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:199:17 + | +199 | class InfraVLAN(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVLAN` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:214:16 + | +214 | class InfraVRF(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVRF` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:229:23 + | +229 | class LocationGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:244:27 + | +244 | class OrganizationGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/infrahub/sync_models.py:256:19 + | +256 | class RoleGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `RoleGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:26:25 + | +26 | class CoreStandardGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:37:18 + | +37 | class BuiltinTag(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:48:25 + | +48 | class ChoiceCircuitType(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceCircuitType` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:60:24 + | +60 | class ChoiceDeviceType(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceDeviceType` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:75:20 + | +75 | class InfraCircuit(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraCircuit` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:90:19 + | +90 | class InfraDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:109:22 + | +109 | class InfraIPAddress(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIPAddress` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:122:26 + | +122 | class InfraInterfaceL2L3(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraInterfaceL2L3` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:141:19 + | +141 | class InfraPrefix(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPrefix` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:156:28 + | +156 | class InfraProviderNetwork(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraProviderNetwork` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:170:17 + | +170 | class InfraRack(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRack` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:187:24 + | +187 | class InfraRouteTarget(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRouteTarget` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:199:17 + | +199 | class InfraVLAN(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVLAN` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:214:16 + | +214 | class InfraVRF(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVRF` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:229:23 + | +229 | class LocationGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:244:27 + | +244 | class OrganizationGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/netbox_to_infrahub/netbox/sync_models.py:256:19 + | +256 | class RoleGeneric(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `RoleGeneric` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/observium_to_infrahub/genericrestapi/sync_models.py:26:25 + | +26 | class CoreStandardGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/observium_to_infrahub/genericrestapi/sync_models.py:37:19 + | +37 | class InfraDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/observium_to_infrahub/genericrestapi/sync_models.py:51:21 + | +51 | class IpamIPAddress(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/observium_to_infrahub/infrahub/sync_models.py:26:25 + | +26 | class CoreStandardGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/observium_to_infrahub/infrahub/sync_models.py:37:19 + | +37 | class InfraDevice(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/observium_to_infrahub/infrahub/sync_models.py:51:21 + | +51 | class IpamIPAddress(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base +info: Only class objects or `Any` are supported as class bases + +error[unresolved-import]: Cannot resolve imported module `infrahub_sync.adapters.observium` + --> examples/observium_to_infrahub/observium/sync_adapter.py:1:6 + | +1 | from infrahub_sync.adapters.observium import ObserviumAdapter + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-import]: Cannot resolve imported module `infrahub_sync.adapters.observium` + --> examples/observium_to_infrahub/observium/sync_models.py:5:6 + | +5 | from infrahub_sync.adapters.observium import ObserviumModel + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-import]: Cannot resolve imported module `.sync_models` + --> examples/peering-manager_to_infrahub/infrahub/sync_adapter.py:5:7 + | +5 | from .sync_models import ( + | ^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:26:21 + | +26 | class IpamIPAddress(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:37:28 + | +37 | class OrganizationProvider(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationProvider` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:47:29 + | +47 | class InfraAutonomousSystem(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:72:25 + | +72 | class InfraBGPPeerGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPPeerGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:87:25 + | +87 | class InfraBGPCommunity(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPCommunity` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:101:29 + | +101 | class InfraBGPRoutingPolicy(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPRoutingPolicy` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:117:16 + | +117 | class InfraIXP(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXP` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:132:26 + | +132 | class InfraIXPConnection(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXPConnection` due to this base +info: Only class objects or `Any` are supported as class bases + +error[unresolved-import]: Cannot resolve imported module `.sync_models` + --> examples/peering-manager_to_infrahub/peeringmanager/sync_adapter.py:5:7 + | +5 | from .sync_models import ( + | ^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:26:21 + | +26 | class IpamIPAddress(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:37:28 + | +37 | class OrganizationProvider(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationProvider` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:47:29 + | +47 | class InfraAutonomousSystem(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:72:25 + | +72 | class InfraBGPPeerGroup(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPPeerGroup` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:87:25 + | +87 | class InfraBGPCommunity(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPCommunity` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:101:29 + | +101 | class InfraBGPRoutingPolicy(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPRoutingPolicy` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:117:16 + | +117 | class InfraIXP(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXP` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:132:26 + | +132 | class InfraIXPConnection(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXPConnection` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peeringdb_to_infrahub/genericrestapi/sync_models.py:26:29 + | +26 | class InfraAutonomousSystem(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base +info: Only class objects or `Any` are supported as class bases + +warning[unsupported-base]: Unsupported class base + --> examples/peeringdb_to_infrahub/infrahub/sync_models.py:26:29 + | +26 | class InfraAutonomousSystem(_ModelBaseClass): + | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` + | +info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base +info: Only class objects or `Any` are supported as class bases + +error[unresolved-import]: Cannot resolve imported module `.sync_models` + --> examples/prometheus_to_infrahub (node_exporter)/infrahub/sync_adapter.py:3:7 + | +3 | from .sync_models import ( + | ^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-import]: Cannot resolve imported module `.sync_models` + --> examples/prometheus_to_infrahub (node_exporter)/prometheus/sync_adapter.py:3:7 + | +3 | from .sync_models import ( + | ^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +warning[deprecated]: The function `validator` is deprecated + --> infrahub_sync/__init__.py:26:26 + | +26 | from pydantic import validator as validator_decorator + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details + | + +error[no-matching-overload]: No overload of function `field_validator` matches arguments + --> infrahub_sync/__init__.py:79:6 + | +79 | @validator_decorator("diffsync_flags", **validator_kwargs) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: First overload defined here + --> .venv/lib/python3.11/site-packages/pydantic/functional_validators.py:379:5 + | +379 | def field_validator( + | _____^ +380 | | field: str, +381 | | /, +382 | | *fields: str, +383 | | mode: Literal['wrap'], +384 | | check_fields: bool | None = ..., +385 | | json_schema_input_type: Any = ..., +386 | | ) -> Callable[[_V2WrapValidatorType], _V2WrapValidatorType]: ... + | |___________________________________________________________^ + | +info: Possible overloads for function `field_validator`: +info: (field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return) +info: (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return) +info: (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return) +info: Overload implementation defined here + --> .venv/lib/python3.11/site-packages/pydantic/functional_validators.py:410:5 + | +410 | def field_validator( + | _____^ +411 | | field: str, +412 | | /, +413 | | *fields: str, +414 | | mode: FieldValidatorModes = 'after', +415 | | check_fields: bool | None = None, +416 | | json_schema_input_type: Any = PydanticUndefined, +417 | | ) -> Callable[[Any], Any]: + | |_________________________^ + | +info: Union variant `Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]` is incompatible with this call site +info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` + +error[invalid-argument-type]: Argument to function `validator` is incorrect + --> infrahub_sync/__init__.py:79:44 + | +79 | @validator_decorator("diffsync_flags", **validator_kwargs) + | ^^^^^^^^^^^^^^^^^^ Expected `bool`, found `str | bool` + | +info: element `str` of union `str | bool` is not assignable to `bool` +info: Function defined here + --> .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:82:5 + | +82 | def validator( + | ^^^^^^^^^ +83 | __field: str, +84 | *fields: str, +85 | pre: bool = False, + | ----------------- Parameter declared here + | +info: Union variant `def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return)` is incompatible with this call site +info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` + +error[invalid-argument-type]: Argument to function `validator` is incorrect + --> infrahub_sync/__init__.py:79:44 + | +79 | @validator_decorator("diffsync_flags", **validator_kwargs) + | ^^^^^^^^^^^^^^^^^^ Expected `bool`, found `str | bool` + | +info: element `str` of union `str | bool` is not assignable to `bool` +info: Function defined here + --> .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:82:5 + | +82 | def validator( + | ^^^^^^^^^ +83 | __field: str, +84 | *fields: str, +85 | pre: bool = False, +86 | each_item: bool = False, + | ----------------------- Parameter declared here + | +info: Union variant `def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return)` is incompatible with this call site +info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` + +error[invalid-argument-type]: Argument to function `validator` is incorrect + --> infrahub_sync/__init__.py:79:44 + | +79 | @validator_decorator("diffsync_flags", **validator_kwargs) + | ^^^^^^^^^^^^^^^^^^ Expected `bool`, found `str | bool` + | +info: element `str` of union `str | bool` is not assignable to `bool` +info: Function defined here + --> .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:82:5 + | +82 | def validator( + | ^^^^^^^^^ +83 | __field: str, +84 | *fields: str, +85 | pre: bool = False, +86 | each_item: bool = False, +87 | always: bool = False, + | -------------------- Parameter declared here + | +info: Union variant `def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return)` is incompatible with this call site +info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` + +error[invalid-argument-type]: Argument to function `validator` is incorrect + --> infrahub_sync/__init__.py:79:44 + | +79 | @validator_decorator("diffsync_flags", **validator_kwargs) + | ^^^^^^^^^^^^^^^^^^ Expected `bool | None`, found `str | bool` + | +info: element `str` of union `str | bool` is not assignable to `bool | None` +info: Function defined here + --> .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:82:5 + | +82 | def validator( + | ^^^^^^^^^ + | + ::: .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:88:5 + | +88 | check_fields: bool | None = None, + | -------------------------------- Parameter declared here + | +info: Union variant `def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return)` is incompatible with this call site +info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` + +error[invalid-argument-type]: Argument to function `validator` is incorrect + --> infrahub_sync/__init__.py:79:44 + | +79 | @validator_decorator("diffsync_flags", **validator_kwargs) + | ^^^^^^^^^^^^^^^^^^ Expected `bool`, found `str | bool` + | +info: element `str` of union `str | bool` is not assignable to `bool` +info: Function defined here + --> .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:82:5 + | +82 | def validator( + | ^^^^^^^^^ + | + ::: .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:89:5 + | +89 | allow_reuse: bool = False, + | ------------------------- Parameter declared here + | +info: Union variant `def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return)` is incompatible with this call site +info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` + +error[unresolved-attribute]: Object of type `Self@load` has no attribute `top_level` + --> infrahub_sync/__init__.py:136:21 + | +136 | for item in self.top_level: + | ^^^^^^^^^^^^^^ + | + +error[missing-argument]: No argument provided for required parameter `b` + --> infrahub_sync/__init__.py:159:20 + | +159 | return operation_func(field_value) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: Union variant `(a: object, b: object, /) -> Any` is incompatible with this call site +info: Attempted to call union type `((a: object, b: object, /) -> Any) | ((field, value) -> Unknown | bool) | ((field) -> bool | Unknown) | ((field, pattern) -> bool)` + +error[missing-argument]: No argument provided for required parameter `value` + --> infrahub_sync/__init__.py:159:20 + | +159 | return operation_func(field_value) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: Union variant `(field, value) -> Unknown | bool` is incompatible with this call site +info: Attempted to call union type `((a: object, b: object, /) -> Any) | ((field, value) -> Unknown | bool) | ((field) -> bool | Unknown) | ((field, pattern) -> bool)` + +error[missing-argument]: No argument provided for required parameter `pattern` + --> infrahub_sync/__init__.py:159:20 + | +159 | return operation_func(field_value) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: Union variant `(field, pattern) -> bool` is incompatible with this call site +info: Attempted to call union type `((a: object, b: object, /) -> Any) | ((field, value) -> Unknown | bool) | ((field) -> bool | Unknown) | ((field, pattern) -> bool)` + +error[too-many-positional-arguments]: Too many positional arguments: expected 1, got 2 + --> infrahub_sync/__init__.py:161:44 + | +161 | return operation_func(field_value, value) + | ^^^^^ + | +info: Union variant `(field) -> bool | Unknown` is incompatible with this call site +info: Attempted to call union type `((a: object, b: object, /) -> Any) | ((field, value) -> Unknown | bool) | ((field) -> bool | Unknown) | ((field, pattern) -> bool)` + +error[call-non-callable]: Object of type `object` is not callable + --> infrahub_sync/__init__.py:194:17 + | +194 | cls._add_custom_filters(native_env, item) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[invalid-return-type]: Return type does not match returned value + --> infrahub_sync/__init__.py:249:77 + | +249 | def get_resource_name(cls, schema_mapping: list[SchemaMappingModel]) -> str: + | --- Expected `str` because of return type +250 | """Get the resource name from the schema mapping.""" +251 | for element in schema_mapping: +252 | if element.name == cls.__name__: +253 | return element.mapping + | ^^^^^^^^^^^^^^^ expected `str`, found `str | None` + | + +error[unresolved-attribute]: Object of type `type[Self@is_list]` has no attribute `__fields__` + --> infrahub_sync/__init__.py:259:17 + | +259 | field = cls.__fields__.get(name) + | ^^^^^^^^^^^^^^ + | + +error[unresolved-import]: Module `typing` has no member `Self` + --> infrahub_sync/adapters/genericrestapi.py:7:24 + | +7 | from typing import Self + | ^^^^ + | +info: The member may be available on other Python versions or platforms +info: Python 3.10 was assumed when resolving imports + --> pyproject.toml:308:18 + | +308 | python-version = "3.10" + | ^^^^^^ Python version configuration + | + +error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` + --> infrahub_sync/adapters/genericrestapi.py:168:51 + | +168 | if self.config.source.name.title() == self.type.title(): + | ^^^^^^^^^^^^^^^ + | + +error[call-non-callable]: Object of type `GenericrestapiModel` is not callable + --> infrahub_sync/adapters/genericrestapi.py:181:24 + | +181 | item = model(**data) + | ^^^^^^^^^^^^^ + | + +error[invalid-return-type]: Return type does not match returned value + --> infrahub_sync/adapters/genericrestapi.py:217:16 + | +217 | return objs + | ^^^^ expected `list[dict[str, Any]]`, found `(Unknown & Top[list[Unknown]]) | list[object] | list[Unknown]` + | + ::: infrahub_sync/adapters/genericrestapi.py:189:10 + | +189 | ) -> list[dict[str, Any]]: + | -------------------- Expected `list[dict[str, Any]]` because of return type + | + +error[unresolved-attribute]: Object of type `GenericrestapiModel` has no attribute `__name__` + --> infrahub_sync/adapters/genericrestapi.py:230:68 + | +230 | msg = f"No fields defined in schema mapping for model {model.__name__}" + | ^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` + --> infrahub_sync/adapters/genericrestapi.py:260:73 + | +260 | … matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + | ^^^^^^^^^^^^^ + | + +error[not-iterable]: Object of type `Any | None` may not be iterable + --> infrahub_sync/adapters/genericrestapi.py:272:33 + | +272 | for node in get_value(obj, field.mapping): + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: It may not have an `__iter__` method or a `__getitem__` method + +error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` + --> infrahub_sync/adapters/genericrestapi.py:280:69 + | +280 | matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + | ^^^^^^^^^^^^^ + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/genericrestapi.py:303:48 + | +303 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ --------- Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/genericrestapi.py:303:57 + | +303 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ ----------- Parameter declared here + | + +error[unresolved-import]: Module `typing` has no member `Self` + --> infrahub_sync/adapters/infrahub.py:12:24 + | +12 | from typing import Self + | ^^^^ + | +info: The member may be available on other Python versions or platforms +info: Python 3.10 was assumed when resolving imports + --> pyproject.toml:308:18 + | +308 | python-version = "3.10" + | ^^^^^^ Python version configuration + | + +error[unresolved-attribute]: Attribute `get` is not defined on `None` in union `InfrahubClientSync | None` + --> infrahub_sync/adapters/infrahub.py:89:21 + | +89 | peer_node = client.get(id=key, kind=rel_schema.peer, populate_store=True) + | ^^^^^^^^^^ + | + +error[invalid-assignment]: Object of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` + --> infrahub_sync/adapters/infrahub.py:125:30 + | +125 | peer_schema: MainSchemaTypesAPI = schemas.get(rel_schema.peer) + | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible value of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` + | | + | Declared type + | +info: element `None` of union `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` + +error[unresolved-attribute]: Object of type `NodeSchema` has no attribute `relationship_names` + --> infrahub_sync/adapters/infrahub.py:194:19 + | +194 | if key in node_schema.relationship_names: + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[invalid-assignment]: Object of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` + --> infrahub_sync/adapters/infrahub.py:196:30 + | +196 | peer_schema: MainSchemaTypesAPI = schemas.get(rel_schema.peer) + | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible value of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` + | | + | Declared type + | +info: element `None` of union `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` + +error[invalid-argument-type]: Argument to function `resolve_peer_node` is incorrect + --> infrahub_sync/adapters/infrahub.py:206:25 + | +206 | rel_schema=rel_schema, + | ^^^^^^^^^^^^^^^^^^^^^ Expected `RelationshipSchemaAPI`, found `RelationshipSchema` + | +info: Function defined here + --> infrahub_sync/adapters/infrahub.py:55:5 + | +55 | def resolve_peer_node( + | ^^^^^^^^^^^^^^^^^ +56 | key: str, +57 | rel_schema: RelationshipSchemaAPI, + | --------------------------------- Parameter declared here + | + +error[invalid-argument-type]: Argument to function `resolve_peer_node` is incorrect + --> infrahub_sync/adapters/infrahub.py:223:29 + | +223 | … rel_schema=rel_schema, + | ^^^^^^^^^^^^^^^^^^^^^ Expected `RelationshipSchemaAPI`, found `RelationshipSchema` + | +info: Function defined here + --> infrahub_sync/adapters/infrahub.py:55:5 + | +55 | def resolve_peer_node( + | ^^^^^^^^^^^^^^^^^ +56 | key: str, +57 | rel_schema: RelationshipSchemaAPI, + | --------------------------------- Parameter declared here + | + +error[no-matching-overload]: No overload of bound method `InfrahubClientSync.all` matches arguments + --> infrahub_sync/adapters/infrahub.py:313:21 + | +313 | nodes = self.client.all(kind=model_name, include=model._attributes, populate_store=True) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: First overload defined here + --> .venv/lib/python3.11/site-packages/infrahub_sdk/client.py:1962:9 + | +1962 | def all( + | _________^ +1963 | | self, +1964 | | kind: type[SchemaTypeSync], +1965 | | at: Timestamp | None = ..., +1966 | | branch: str | None = ..., +1967 | | timeout: int | None = ..., +1968 | | populate_store: bool = ..., +1969 | | offset: int | None = ..., +1970 | | limit: int | None = ..., +1971 | | include: list[str] | None = ..., +1972 | | exclude: list[str] | None = ..., +1973 | | fragment: bool = ..., +1974 | | prefetch_relationships: bool = ..., +1975 | | property: bool = ..., +1976 | | parallel: bool = ..., +1977 | | order: Order | None = ..., +1978 | | include_metadata: bool = ..., +1979 | | ) -> list[SchemaTypeSync]: ... + | |_____________________________^ + | +info: Possible overloads for bound method `all`: +info: [SchemaTypeSync](self, kind: type[SchemaTypeSync], at: Timestamp | None = ..., branch: str | None = ..., timeout: int | None = ..., populate_store: bool = ..., offset: int | None = ..., limit: int | None = ..., include: list[str] | None = ..., exclude: list[str] | None = ..., fragment: bool = ..., prefetch_relationships: bool = ..., property: bool = ..., parallel: bool = ..., order: Order | None = ..., include_metadata: bool = ...) -> list[SchemaTypeSync] +info: (self, kind: str, at: Timestamp | None = ..., branch: str | None = ..., timeout: int | None = ..., populate_store: bool = ..., offset: int | None = ..., limit: int | None = ..., include: list[str] | None = ..., exclude: list[str] | None = ..., fragment: bool = ..., prefetch_relationships: bool = ..., property: bool = ..., parallel: bool = ..., order: Order | None = ..., include_metadata: bool = ...) -> list[InfrahubNodeSync] +info: Overload implementation defined here + --> .venv/lib/python3.11/site-packages/infrahub_sdk/client.py:2001:9 + | +2001 | def all( + | _________^ +2002 | | self, +2003 | | kind: str | type[SchemaTypeSync], +2004 | | at: Timestamp | None = None, +2005 | | branch: str | None = None, +2006 | | timeout: int | None = None, +2007 | | populate_store: bool = True, +2008 | | offset: int | None = None, +2009 | | limit: int | None = None, +2010 | | include: list[str] | None = None, +2011 | | exclude: list[str] | None = None, +2012 | | fragment: bool = False, +2013 | | prefetch_relationships: bool = False, +2014 | | property: bool = False, +2015 | | parallel: bool = False, +2016 | | order: Order | None = None, +2017 | | include_metadata: bool = False, +2018 | | ) -> list[InfrahubNodeSync] | list[SchemaTypeSync]: + | |______________________________________________________^ + | + +error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` + --> infrahub_sync/adapters/infrahub.py:322:51 + | +322 | if self.config.source.name.title() == self.type.title(): + | ^^^^^^^^^^^^^^^ + | + +error[call-non-callable]: Object of type `InfrahubModel` is not callable + --> infrahub_sync/adapters/infrahub.py:335:24 + | +335 | item = model(**transformed_obj) + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[invalid-assignment]: Object of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` + --> infrahub_sync/adapters/infrahub.py:364:26 + | +364 | peer_schema: MainSchemaTypesAPI = self.schema.get(rel_schema.peer) + | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible value of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` + | | + | Declared type + | +info: element `None` of union `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` + +error[invalid-method-override]: Invalid override of method `create` + --> infrahub_sync/adapters/infrahub.py:450:9 + | +450 | def create( + | _________^ +451 | | cls, +452 | | adapter: InfrahubAdapter, +453 | | ids: Mapping[Any, Any], +454 | | attrs: Mapping[Any, Any], +455 | | ) -> Self | None: + | |____________________^ Definition is incompatible with `DiffSyncModel.create` + | + ::: .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ------------------------------------------------------------------------- `DiffSyncModel.create` defined here + | +info: parameter `adapter` has an incompatible type: `Adapter` is not assignable to `InfrahubAdapter` +info: This violates the Liskov Substitution Principle + +error[invalid-argument-type]: Argument to function `diffsync_to_infrahub` is incorrect + --> infrahub_sync/adapters/infrahub.py:458:35 + | +458 | ids=ids, attrs=attrs, node_schema=node_schema, store=adapter.client.store, schemas=adapter.schema + | ^^^^^^^^^^^^^^^^^^^^^^^ Expected `NodeSchema`, found `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` + | +info: element `NodeSchemaAPI` of union `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` is not assignable to `NodeSchema` +info: Function defined here + --> infrahub_sync/adapters/infrahub.py:178:5 + | +178 | def diffsync_to_infrahub( + | ^^^^^^^^^^^^^^^^^^^^ +179 | ids: Mapping[Any, Any], +180 | attrs: Mapping[Any, Any], +181 | store: NodeStoreSync, +182 | node_schema: NodeSchema, + | ----------------------- Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/infrahub.py:470:48 + | +470 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ --------- Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/infrahub.py:470:57 + | +470 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ ----------- Parameter declared here + | + +error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `client` + --> infrahub_sync/adapters/infrahub.py:473:16 + | +473 | node = self.adapter.client.get(id=self.local_id, kind=self.__class__.__name__) + | ^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `Self@update` has no attribute `local_id` + --> infrahub_sync/adapters/infrahub.py:473:43 + | +473 | node = self.adapter.client.get(id=self.local_id, kind=self.__class__.__name__) + | ^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `source_node` + --> infrahub_sync/adapters/infrahub.py:474:21 + | +474 | source_id = self.adapter.source_node.id if self.adapter.source_node else None + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `source_node` + --> infrahub_sync/adapters/infrahub.py:474:52 + | +474 | source_id = self.adapter.source_node.id if self.adapter.source_node else None + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `owner_node` + --> infrahub_sync/adapters/infrahub.py:475:20 + | +475 | owner_id = self.adapter.owner_node.id if self.adapter.owner_node else None + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `owner_node` + --> infrahub_sync/adapters/infrahub.py:475:50 + | +475 | owner_id = self.adapter.owner_node.id if self.adapter.owner_node else None + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-import]: Module `typing` has no member `Self` + --> infrahub_sync/adapters/ipfabricsync.py:9:24 + | +9 | from typing import Self + | ^^^^ + | +info: The member may be available on other Python versions or platforms +info: Python 3.10 was assumed when resolving imports + --> pyproject.toml:308:18 + | +308 | python-version = "3.10" + | ^^^^^^ Python version configuration + | + +error[unresolved-import]: Cannot resolve imported module `ipfabric` + --> infrahub_sync/adapters/ipfabricsync.py:27:10 + | +27 | from ipfabric import IPFClient + | ^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` + --> infrahub_sync/adapters/ipfabricsync.py:87:51 + | +87 | if self.config.source.name.title() == self.type.title(): + | ^^^^^^^^^^^^^^^ + | + +error[call-non-callable]: Object of type `IpfabricsyncModel` is not callable + --> infrahub_sync/adapters/ipfabricsync.py:99:24 + | +99 | item = model(**data) + | ^^^^^^^^^^^^^ + | + +error[not-iterable]: Object of type `list[SchemaMappingField] | None` may not be iterable + --> infrahub_sync/adapters/ipfabricsync.py:105:22 + | +105 | for field in mapping.fields: # pylint: disable=too-many-nested-blocks + | ^^^^^^^^^^^^^^ + | +info: It may not have an `__iter__` method or a `__getitem__` method + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/ipfabricsync.py:170:48 + | +170 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ --------- Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/ipfabricsync.py:170:57 + | +170 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ ----------- Parameter declared here + | + +error[unresolved-import]: Module `typing` has no member `Self` + --> infrahub_sync/adapters/nautobot.py:9:24 + | +9 | from typing import Self + | ^^^^ + | +info: The member may be available on other Python versions or platforms +info: Python 3.10 was assumed when resolving imports + --> pyproject.toml:308:18 + | +308 | python-version = "3.10" + | ^^^^^^ Python version configuration + | + +error[unresolved-import]: Cannot resolve imported module `pynautobot` + --> infrahub_sync/adapters/nautobot.py:13:8 + | +13 | import pynautobot + | ^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` + --> infrahub_sync/adapters/nautobot.py:85:51 + | +85 | if self.config.source.name.title() == self.type.title(): + | ^^^^^^^^^^^^^^^ + | + +error[call-non-callable]: Object of type `NautobotModel` is not callable + --> infrahub_sync/adapters/nautobot.py:98:24 + | +98 | item = model(**data) + | ^^^^^^^^^^^^^ + | + +error[not-iterable]: Object of type `list[SchemaMappingField] | None` may not be iterable + --> infrahub_sync/adapters/nautobot.py:105:22 + | +105 | for field in mapping.fields: # pylint: disable=too-many-nested-blocks + | ^^^^^^^^^^^^^^ + | +info: It may not have an `__iter__` method or a `__getitem__` method + +error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` + --> infrahub_sync/adapters/nautobot.py:132:73 + | +132 | … matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + | ^^^^^^^^^^^^^ + | + +error[not-iterable]: Object of type `Any | None` may not be iterable + --> infrahub_sync/adapters/nautobot.py:142:33 + | +142 | for node in get_value(obj, field.mapping): + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: It may not have an `__iter__` method or a `__getitem__` method + +error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` + --> infrahub_sync/adapters/nautobot.py:150:69 + | +150 | matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + | ^^^^^^^^^^^^^ + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/nautobot.py:170:48 + | +170 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ --------- Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/nautobot.py:170:57 + | +170 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ ----------- Parameter declared here + | + +error[unresolved-import]: Module `typing` has no member `Self` + --> infrahub_sync/adapters/netbox.py:11:24 + | +11 | from typing import Self + | ^^^^ + | +info: The member may be available on other Python versions or platforms +info: Python 3.10 was assumed when resolving imports + --> pyproject.toml:308:18 + | +308 | python-version = "3.10" + | ^^^^^^ Python version configuration + | + +error[unresolved-import]: Cannot resolve imported module `pynetbox` + --> infrahub_sync/adapters/netbox.py:14:8 + | +14 | import pynetbox + | ^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` + --> infrahub_sync/adapters/netbox.py:89:51 + | +89 | if self.config.source.name.title() == self.type.title(): + | ^^^^^^^^^^^^^^^ + | + +error[call-non-callable]: Object of type `NetboxModel` is not callable + --> infrahub_sync/adapters/netbox.py:102:24 + | +102 | item = model(**data) + | ^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` + --> infrahub_sync/adapters/netbox.py:137:73 + | +137 | … matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + | ^^^^^^^^^^^^^ + | + +error[not-iterable]: Object of type `Any | None` may not be iterable + --> infrahub_sync/adapters/netbox.py:147:33 + | +147 | for node in get_value(obj, field.mapping): + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: It may not have an `__iter__` method or a `__getitem__` method + +error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` + --> infrahub_sync/adapters/netbox.py:155:69 + | +155 | matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + | ^^^^^^^^^^^^^ + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/netbox.py:174:48 + | +174 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ --------- Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/netbox.py:174:57 + | +174 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ ----------- Parameter declared here + | + +error[unresolved-import]: Module `typing` has no member `Self` + --> infrahub_sync/adapters/peeringmanager.py:6:24 + | +6 | from typing import Self + | ^^^^ + | +info: The member may be available on other Python versions or platforms +info: Python 3.10 was assumed when resolving imports + --> pyproject.toml:308:18 + | +308 | python-version = "3.10" + | ^^^^^^ Python version configuration + | + +error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `config` + --> infrahub_sync/adapters/peeringmanager.py:72:73 + | +72 | resource_name = self.__class__.get_resource_name(schema_mapping=self.adapter.config.schema_mapping) + | ^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `config` + --> infrahub_sync/adapters/peeringmanager.py:80:22 + | +80 | for field in self.adapter.config.schema_mapping: + | ^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `store` is not defined on `None` in union `Adapter | None` + --> infrahub_sync/adapters/peeringmanager.py:90:55 + | +90 | … all_nodes_for_reference = self.adapter.store.get_all(model=field_mapping.reference) + | ^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` + --> infrahub_sync/adapters/peeringmanager.py:97:68 + | +97 | … mapped_attrs[target_field_name] = [node.local_id for node in filtered_nodes] + | ^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `DiffSyncModel & ~AlwaysFalsy` has no attribute `local_id` + --> infrahub_sync/adapters/peeringmanager.py:105:71 + | +105 | … mapped_attrs[target_field_name] = filtered_node.local_id + | ^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `client` + --> infrahub_sync/adapters/peeringmanager.py:111:13 + | +111 | self.adapter.client.patch(endpoint, data=mapped_attrs) + | ^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-import]: Cannot resolve imported module `prometheus_client.parser` + --> infrahub_sync/adapters/prometheus.py:8:6 + | +8 | from prometheus_client.parser import text_string_to_metric_families + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-import]: Module `typing` has no member `Self` + --> infrahub_sync/adapters/prometheus.py:11:24 + | +11 | from typing import Self + | ^^^^ + | +info: The member may be available on other Python versions or platforms +info: Python 3.10 was assumed when resolving imports + --> pyproject.toml:308:18 + | +308 | python-version = "3.10" + | ^^^^^^ Python version configuration + | + +error[invalid-argument-type]: Argument to `LookupResolver.__init__` is incorrect + --> infrahub_sync/adapters/prometheus.py:464:39 + | +464 | self._lookup = LookupResolver(samples_by_metric=self._samples_by_metric) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `dict[str, list[dict[str, Any]]]`, found `dict[str, list[dict[Unknown, Unknown]]] | None | dict[str, list[dict[str, Any]]]` + | +info: element `None` of union `dict[str, list[dict[Unknown, Unknown]]] | None | dict[str, list[dict[str, Any]]]` is not assignable to `dict[str, list[dict[str, Any]]]` +info: Method defined here + --> infrahub_sync/adapters/prometheus.py:264:9 + | +264 | def __init__(self, samples_by_metric: dict[str, list[dict[str, Any]]]) -> None: + | ^^^^^^^^ -------------------------------------------------- Parameter declared here + | + +error[invalid-return-type]: Return type does not match returned value + --> infrahub_sync/adapters/prometheus.py:465:16 + | +465 | return self._samples_by_metric + | ^^^^^^^^^^^^^^^^^^^^^^^ expected `dict[str, list[dict[str, Any]]]`, found `dict[str, list[dict[Unknown, Unknown]]] | None | dict[str, list[dict[str, Any]]]` + | + ::: infrahub_sync/adapters/prometheus.py:436:34 + | +436 | def _ensure_samples(self) -> dict[str, list[dict[str, Any]]]: + | ------------------------------- Expected `dict[str, list[dict[str, Any]]]` because of return type + | + +error[unresolved-attribute]: Attribute `resolve_fn` is not defined on `None` in union `LookupResolver | None` + --> infrahub_sync/adapters/prometheus.py:490:86 + | +490 | return lambda metric, key_or_path, value_path, default=None: self._lookup.resolve_fn( + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` + --> infrahub_sync/adapters/prometheus.py:496:51 + | +496 | if self.config.source.name.title() == self.type.title(): + | ^^^^^^^^^^^^^^^ + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/prometheus.py:563:48 + | +563 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ --------- Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/prometheus.py:563:57 + | +563 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ ----------- Parameter declared here + | + +error[unresolved-import]: Module `typing` has no member `Self` + --> infrahub_sync/adapters/slurpitsync.py:9:24 + | +9 | from typing import Self + | ^^^^ + | +info: The member may be available on other Python versions or platforms +info: Python 3.10 was assumed when resolving imports + --> pyproject.toml:308:18 + | +308 | python-version = "3.10" + | ^^^^^^ Python version configuration + | + +error[unresolved-import]: Cannot resolve imported module `slurpit` + --> infrahub_sync/adapters/slurpitsync.py:13:8 + | +13 | import slurpit + | ^^^^^^^ + | +info: Searched in the following paths during module resolution: +info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) +info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) +info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) +info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment + +error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` + --> infrahub_sync/adapters/slurpitsync.py:206:51 + | +206 | if self.config.source.name.title() == self.type.title(): + | ^^^^^^^^^^^^^^^ + | + +error[call-non-callable]: Object of type `SlurpitsyncModel` is not callable + --> infrahub_sync/adapters/slurpitsync.py:218:28 + | +218 | item = model(**data) + | ^^^^^^^^^^^^^ + | + +error[not-iterable]: Object of type `list[SchemaMappingField] | None` may not be iterable + --> infrahub_sync/adapters/slurpitsync.py:233:22 + | +233 | for field in mapping.fields: + | ^^^^^^^^^^^^^^ + | +info: It may not have an `__iter__` method or a `__getitem__` method + +error[invalid-return-type]: Return type does not match returned value + --> infrahub_sync/adapters/slurpitsync.py:265:36 + | +265 | … return None + | ^^^^ expected `dict[Unknown, Unknown]`, found `None` + | + ::: infrahub_sync/adapters/slurpitsync.py:229:10 + | +229 | ) -> dict: + | ---- Expected `dict[Unknown, Unknown]` because of return type + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/slurpitsync.py:294:48 + | +294 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ --------- Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect + --> infrahub_sync/adapters/slurpitsync.py:294:57 + | +294 | return super().create(adapter=adapter, ids=ids, attrs=attrs) + | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 + | +227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: + | ^^^^^^ ----------- Parameter declared here + | + +error[unresolved-attribute]: Object of type `Adapter` has no attribute `config` + --> infrahub_sync/adapters/utils.py:16:33 + | +16 | (element for element in adapter.config.schema_mapping if element.name == modelname), + | ^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `_identifiers` is not defined on `None` in union `DiffSyncModel | type[DiffSyncModel] | None` + --> infrahub_sync/adapters/utils.py:33:23 + | +33 | for identifier in object_class._identifiers: + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:98:12 + | +98 | if sync_instance.adapters_path: + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:99:13 + | +99 | sync_instance.adapters_path.extend(adapter_path) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[invalid-assignment]: Object of type `list[str]` is not assignable to attribute `adapters_path` on type `SyncInstance | None` + --> infrahub_sync/cli.py:101:13 + | +101 | sync_instance.adapters_path = adapter_path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[invalid-argument-type]: Argument to function `get_potenda_from_instance` is incorrect + --> infrahub_sync/cli.py:106:13 + | +106 | sync_instance=sync_instance, branch=branch, show_progress=show_progress, verbosity=verbosity_level + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `SyncInstance`, found `SyncInstance | None` + | +info: element `None` of union `SyncInstance | None` is not assignable to `SyncInstance` +info: Function defined here + --> infrahub_sync/utils.py:170:5 + | +170 | def get_potenda_from_instance( + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +171 | sync_instance: SyncInstance, + | --------------------------- Parameter declared here + | + +error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:148:12 + | +148 | if sync_instance.adapters_path: + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:149:13 + | +149 | sync_instance.adapters_path.extend(adapter_path) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[invalid-assignment]: Object of type `list[str]` is not assignable to attribute `adapters_path` on type `SyncInstance | None` + --> infrahub_sync/cli.py:151:13 + | +151 | sync_instance.adapters_path = adapter_path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[invalid-argument-type]: Argument to function `get_potenda_from_instance` is incorrect + --> infrahub_sync/cli.py:156:13 + | +156 | sync_instance=sync_instance, branch=branch, show_progress=show_progress, verbosity=verbosity_level + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `SyncInstance`, found `SyncInstance | None` + | +info: element `None` of union `SyncInstance | None` is not assignable to `SyncInstance` +info: Function defined here + --> infrahub_sync/utils.py:170:5 + | +170 | def get_potenda_from_instance( + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +171 | sync_instance: SyncInstance, + | --------------------------- Parameter declared here + | + +error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:201:12 + | +201 | if sync_instance.adapters_path: + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:202:13 + | +202 | sync_instance.adapters_path.extend(adapter_path) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[invalid-assignment]: Object of type `list[str] & ~AlwaysFalsy` is not assignable to attribute `adapters_path` on type `SyncInstance | None` + --> infrahub_sync/cli.py:204:13 + | +204 | sync_instance.adapters_path = adapter_path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `destination` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:211:8 + | +211 | if sync_instance.destination.name == "infrahub" and sync_instance.destination.settings: + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `destination` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:211:57 + | +211 | if sync_instance.destination.name == "infrahub" and sync_instance.destination.settings: + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `destination` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:212:28 + | +212 | infrahub_address = sync_instance.destination.settings.get("url") or "" + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `destination` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:213:51 + | +213 | sdk_config = get_infrahub_config(settings=sync_instance.destination.settings, branch=branch) + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `source` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:214:10 + | +214 | elif sync_instance.source.name == "infrahub" and sync_instance.source.settings: + | ^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `source` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:214:54 + | +214 | elif sync_instance.source.name == "infrahub" and sync_instance.source.settings: + | ^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `source` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:215:28 + | +215 | infrahub_address = sync_instance.source.settings.get("url") or "" + | ^^^^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `source` is not defined on `None` in union `SyncInstance | None` + --> infrahub_sync/cli.py:216:51 + | +216 | sdk_config = get_infrahub_config(settings=sync_instance.source.settings, branch=branch) + | ^^^^^^^^^^^^^^^^^^^^ + | + +error[invalid-argument-type]: Argument to function `find_missing_schema_model` is incorrect + --> infrahub_sync/cli.py:226:55 + | +226 | missing_schema_models = find_missing_schema_model(sync_instance=sync_instance, schema=schema) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `SyncInstance`, found `SyncInstance | None` + | +info: element `None` of union `SyncInstance | None` is not assignable to `SyncInstance` +info: Function defined here + --> infrahub_sync/utils.py:27:5 + | +27 | def find_missing_schema_model( + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +28 | sync_instance: SyncInstance, + | --------------------------- Parameter declared here + | + +error[invalid-argument-type]: Argument to function `find_missing_schema_model` is incorrect + --> infrahub_sync/cli.py:226:84 + | +226 | missing_schema_models = find_missing_schema_model(sync_instance=sync_instance, schema=schema) + | ^^^^^^^^^^^^^ Expected `MutableMapping[str, NodeSchema | GenericSchema]`, found `MutableMapping[str, NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI]` + | +info: element `NodeSchema` of union `NodeSchema | GenericSchema` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` +info: Function defined here + --> infrahub_sync/utils.py:27:5 + | +27 | def find_missing_schema_model( + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +28 | sync_instance: SyncInstance, +29 | schema: MutableMapping[str, Union[NodeSchema, GenericSchema]], + | ------------------------------------------------------------- Parameter declared here + | + +error[invalid-argument-type]: Argument to function `render_adapter` is incorrect + --> infrahub_sync/cli.py:230:37 + | +230 | rendered_files = render_adapter(sync_instance=sync_instance, schema=schema) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `SyncInstance`, found `SyncInstance | None` + | +info: element `None` of union `SyncInstance | None` is not assignable to `SyncInstance` +info: Function defined here + --> infrahub_sync/utils.py:41:5 + | +41 | def render_adapter( + | ^^^^^^^^^^^^^^ +42 | sync_instance: SyncInstance, + | --------------------------- Parameter declared here + | + +error[invalid-argument-type]: Argument to function `render_adapter` is incorrect + --> infrahub_sync/cli.py:230:66 + | +230 | rendered_files = render_adapter(sync_instance=sync_instance, schema=schema) + | ^^^^^^^^^^^^^ Expected `MutableMapping[str, NodeSchema | GenericSchema]`, found `MutableMapping[str, NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI]` + | +info: element `NodeSchema` of union `NodeSchema | GenericSchema` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` +info: Function defined here + --> infrahub_sync/utils.py:41:5 + | +41 | def render_adapter( + | ^^^^^^^^^^^^^^ +42 | sync_instance: SyncInstance, +43 | schema: MutableMapping[str, Union[NodeSchema, GenericSchema]], + | ------------------------------------------------------------- Parameter declared here + | + +error[not-iterable]: Object of type `list[SchemaMappingField] | None` may not be iterable + --> infrahub_sync/generator/__init__.py:56:28 + | +56 | for subitem in item.fields: + | ^^^^^^^^^^^ + | +info: It may not have an `__iter__` method or a `__getitem__` method + +error[invalid-attribute-access]: Cannot assign to ClassVar `top_level` from an instance of type `Adapter` + --> infrahub_sync/potenda/__init__.py:37:9 + | +37 | self.source.top_level = top_level + | ^^^^^^^^^^^^^^^^^^^^^ + | + +error[invalid-attribute-access]: Cannot assign to ClassVar `top_level` from an instance of type `Adapter` + --> infrahub_sync/potenda/__init__.py:38:9 + | +38 | self.destination.top_level = top_level + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + +error[not-iterable]: Object of type `list[str | DiffSyncFlags] | None` may not be iterable + --> infrahub_sync/potenda/__init__.py:49:21 + | +49 | for flag in self.config.diffsync_flags: + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +info: It may not have an `__iter__` method or a `__getitem__` method + +error[unsupported-operator]: Unsupported `|=` operation + --> infrahub_sync/potenda/__init__.py:50:13 + | +50 | self.flags |= flag + | ----------^^^^---- + | | | + | | Has type `str | DiffSyncFlags` + | Has type `Literal[DiffSyncFlags.NONE]` + | + +error[invalid-argument-type]: Argument to function `render_template` is incorrect + --> infrahub_sync/utils.py:61:17 + | +61 | template_file=item[0], + | ^^^^^^^^^^^^^^^^^^^^^ Expected `Path`, found `Literal["diffsync_models.j2", "diffsync_adapter.j2"]` + | +info: element `Literal["diffsync_models.j2"]` of union `Literal["diffsync_models.j2", "diffsync_adapter.j2"]` is not assignable to `Path` +info: Function defined here + --> infrahub_sync/generator/__init__.py:154:5 + | +154 | def render_template(template_file: Path, output_dir: Path, output_file: Path, context: dict[str, Any]) -> None: + | ^^^^^^^^^^^^^^^ ------------------- Parameter declared here + | + +error[invalid-argument-type]: Argument to function `render_template` is incorrect + --> infrahub_sync/utils.py:63:17 + | +63 | output_file=item[1], + | ^^^^^^^^^^^^^^^^^^^ Expected `Path`, found `Literal["sync_models.py", "sync_adapter.py"]` + | +info: element `Literal["sync_models.py"]` of union `Literal["sync_models.py", "sync_adapter.py"]` is not assignable to `Path` +info: Function defined here + --> infrahub_sync/generator/__init__.py:154:5 + | +154 | def render_template(template_file: Path, output_dir: Path, output_file: Path, context: dict[str, Any]) -> None: + | ^^^^^^^^^^^^^^^ ----------------- Parameter declared here + | + +error[invalid-argument-type]: Argument to constructor `Path.__new__` is incorrect + --> infrahub_sync/utils.py:152:17 + | +152 | if Path(config_file).is_absolute() or directory is None: + | ^^^^^^^^^^^ Expected `str | PathLike[str]`, found `str | None` + | +info: element `None` of union `str | None` is not assignable to `str | PathLike[str]` +info: └── type `None` is not assignable to any element of the union `str | PathLike[str]` +info: ├── type `None` is not assignable to protocol `PathLike[str]` +info: │ └── protocol member `__fspath__` is not defined on type `None` +info: └── ... omitted 1 union element without additional context +info: Function defined here + --> stdlib/pathlib/__init__.pyi:310:13 + | +310 | def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... + | ^^^^^^^ -------------- Parameter declared here + | + +error[invalid-argument-type]: Argument to constructor `Path.__new__` is incorrect + --> infrahub_sync/utils.py:153:37 + | +153 | config_file_path = Path(config_file) + | ^^^^^^^^^^^ Expected `str | PathLike[str]`, found `str | None` + | +info: element `None` of union `str | None` is not assignable to `str | PathLike[str]` +info: └── type `None` is not assignable to any element of the union `str | PathLike[str]` +info: ├── type `None` is not assignable to protocol `PathLike[str]` +info: │ └── protocol member `__fspath__` is not defined on type `None` +info: └── ... omitted 1 union element without additional context +info: Function defined here + --> stdlib/pathlib/__init__.pyi:310:13 + | +310 | def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... + | ^^^^^^^ -------------- Parameter declared here + | + +error[invalid-argument-type]: Argument to constructor `Path.__new__` is incorrect + --> infrahub_sync/utils.py:155:48 + | +155 | config_file_path = Path(directory, config_file) + | ^^^^^^^^^^^ Expected `str | PathLike[str]`, found `str | None` + | +info: element `None` of union `str | None` is not assignable to `str | PathLike[str]` +info: └── type `None` is not assignable to any element of the union `str | PathLike[str]` +info: ├── type `None` is not assignable to protocol `PathLike[str]` +info: │ └── protocol member `__fspath__` is not defined on type `None` +info: └── ... omitted 1 union element without additional context +info: Function defined here + --> stdlib/pathlib/__init__.pyi:310:13 + | +310 | def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... + | ^^^^^^^ -------------- Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `Collection.add_collection` is incorrect + --> tasks/__init__.py:17:19 + | +17 | ns.add_collection(linter) + | ^^^^^^ Expected `Collection`, found `` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/invoke/collection.py:285:9 + | +285 | def add_collection( + | ^^^^^^^^^^^^^^ +286 | self, +287 | coll: "Collection", + | ------------------ Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `Collection.add_collection` is incorrect + --> tasks/__init__.py:18:19 + | +18 | ns.add_collection(docs) + | ^^^^ Expected `Collection`, found `` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/invoke/collection.py:285:9 + | +285 | def add_collection( + | ^^^^^^^^^^^^^^ +286 | self, +287 | coll: "Collection", + | ------------------ Parameter declared here + | + +error[invalid-argument-type]: Argument to bound method `Collection.add_collection` is incorrect + --> tasks/__init__.py:19:19 + | +19 | ns.add_collection(tests) + | ^^^^^ Expected `Collection`, found `` + | +info: Method defined here + --> .venv/lib/python3.11/site-packages/invoke/collection.py:285:9 + | +285 | def add_collection( + | ^^^^^^^^^^^^^^ +286 | self, +287 | coll: "Collection", + | ------------------ Parameter declared here + | + +error[unresolved-attribute]: Module `tasks.docs` has no member `generate_doc` + --> tasks/__init__.py:52:5 + | +52 | docs.generate_doc(context) + | ^^^^^^^^^^^^^^^^^ + | + +error[unresolved-attribute]: Attribute `exited` is not defined on `None` in union `Result | None` + --> tasks/docs.py:72:8 + | +72 | if output.exited != 0: + | ^^^^^^^^^^^^^ + | + +error[invalid-argument-type]: Argument to bound method `_PrintCallVisitor.visit_FunctionDef` is incorrect + --> tests/test_logging.py:39:32 + | +39 | self.visit_FunctionDef(node) # type: ignore[arg-type] + | ^^^^ Expected `FunctionDef`, found `AsyncFunctionDef` + | +info: Method defined here + --> tests/test_logging.py:32:9 + | +32 | def visit_FunctionDef(self, node: ast.FunctionDef) -> None: + | ^^^^^^^^^^^^^^^^^ --------------------- Parameter declared here + | + +Found 302 diagnostics + +=== Rule distribution === + 144 warning[unsupported-base] + 52 error[unresolved-attribute] + 41 error[invalid-argument-type] + 28 error[unresolved-import] + 8 error[not-iterable] + 8 error[call-non-callable] + 6 error[invalid-assignment] + 4 error[invalid-return-type] + 3 error[missing-argument] + 2 error[no-matching-overload] + 2 error[invalid-attribute-access] + 1 warning[deprecated] + 1 error[unsupported-operator] + 1 error[too-many-positional-arguments] + 1 error[invalid-method-override] + +=== Per-module diagnostic counts === +--- top-level modules (one diagnostic = one primary location) --- + 166 examples + 82 infrahub_sync/adapters + 23 infrahub_sync/cli + 15 infrahub_sync/__init__ + 5 tasks + 5 infrahub_sync/utils + 4 infrahub_sync/potenda + 1 tests + 1 infrahub_sync/generator + +--- top-level .py files in infrahub_sync/ --- + 23 infrahub_sync/cli.py + 15 infrahub_sync/__init__.py + 5 infrahub_sync/utils.py From 014b1d91071154fdba2887a52158e3ce548f3d46 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:18:47 +0200 Subject: [PATCH 04/20] chore(ty): suppress baseline diagnostics per module to unblock CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exclude examples/** from ty (generated sync_models.py inherits a dynamically resolved _ModelBaseClass that produces 144 unsupported-base warnings — not worth typing). Add [[tool.ty.overrides]] blocks for each remaining module covering exactly the rules that fire there today. Subsequent commits will remove these blocks one module at a time as real fixes land. Co-Authored-By: Claude Opus 4.7 (1M context) --- pyproject.toml | 103 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b3e4c2d..8655539 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -304,5 +304,108 @@ max-complexity = 33 [tool.ty] +[tool.ty.src] +exclude = ["examples/**"] + [tool.ty.environment] python-version = "3.10" + +[[tool.ty.overrides]] +include = ["infrahub_sync/adapters/**"] + +[tool.ty.overrides.rules] +################################################################################################## +# The ignored rules below should be removed once the code has been updated, they are included # +# like this so that we can reactivate them one by one. # +################################################################################################## +call-non-callable = "ignore" +invalid-argument-type = "ignore" +invalid-assignment = "ignore" +invalid-method-override = "ignore" +invalid-return-type = "ignore" +no-matching-overload = "ignore" +not-iterable = "ignore" +unresolved-attribute = "ignore" +unresolved-import = "ignore" + +[[tool.ty.overrides]] +include = ["infrahub_sync/cli.py"] + +[tool.ty.overrides.rules] +################################################################################################## +# The ignored rules below should be removed once the code has been updated, they are included # +# like this so that we can reactivate them one by one. # +################################################################################################## +invalid-argument-type = "ignore" +invalid-assignment = "ignore" +unresolved-attribute = "ignore" + +[[tool.ty.overrides]] +include = ["infrahub_sync/__init__.py"] + +[tool.ty.overrides.rules] +################################################################################################## +# The ignored rules below should be removed once the code has been updated, they are included # +# like this so that we can reactivate them one by one. # +################################################################################################## +call-non-callable = "ignore" +deprecated = "ignore" +invalid-argument-type = "ignore" +invalid-return-type = "ignore" +missing-argument = "ignore" +no-matching-overload = "ignore" +too-many-positional-arguments = "ignore" +unresolved-attribute = "ignore" + +[[tool.ty.overrides]] +include = ["infrahub_sync/utils.py"] + +[tool.ty.overrides.rules] +################################################################################################## +# The ignored rules below should be removed once the code has been updated, they are included # +# like this so that we can reactivate them one by one. # +################################################################################################## +invalid-argument-type = "ignore" + +[[tool.ty.overrides]] +include = ["infrahub_sync/potenda/**"] + +[tool.ty.overrides.rules] +################################################################################################## +# The ignored rules below should be removed once the code has been updated, they are included # +# like this so that we can reactivate them one by one. # +################################################################################################## +invalid-attribute-access = "ignore" +not-iterable = "ignore" +unsupported-operator = "ignore" + +[[tool.ty.overrides]] +include = ["infrahub_sync/generator/**"] + +[tool.ty.overrides.rules] +################################################################################################## +# The ignored rules below should be removed once the code has been updated, they are included # +# like this so that we can reactivate them one by one. # +################################################################################################## +not-iterable = "ignore" + +[[tool.ty.overrides]] +include = ["tasks/**"] + +[tool.ty.overrides.rules] +################################################################################################## +# The ignored rules below should be removed once the code has been updated, they are included # +# like this so that we can reactivate them one by one. # +################################################################################################## +invalid-argument-type = "ignore" +unresolved-attribute = "ignore" + +[[tool.ty.overrides]] +include = ["tests/**"] + +[tool.ty.overrides.rules] +################################################################################################## +# The ignored rules below should be removed once the code has been updated, they are included # +# like this so that we can reactivate them one by one. # +################################################################################################## +invalid-argument-type = "ignore" From b7d111ab7480145f51081f956ac838de63b0b4cd Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:21:06 +0200 Subject: [PATCH 05/20] docs: point contributors at ty instead of mypy AGENTS.md (mirrored to CLAUDE.md via symlink) now references `uv run invoke linter.lint-ty` in the Quickstart and Required Development Workflow, and the Policy / Known Issues / Approval Checklist sections cite [[tool.ty.overrides]] and `# ty: ignore[]` instead of the mypy equivalents. Final mypy removal lands in a later commit. Co-Authored-By: Claude Opus 4.7 (1M context) --- AGENTS.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4997fcb..9316441 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -34,7 +34,7 @@ uv run infrahub-sync list --directory examples/ # Make a change, then: uv run invoke format uv run invoke lint -uv run mypy infrahub_sync/ --ignore-missing-imports +uv run invoke linter.lint-ty uv run infrahub-sync list --directory examples/ # If docs/CLI changed: @@ -50,13 +50,13 @@ Run these in order before committing. uv sync uv run invoke format uv run invoke lint -uv run mypy infrahub_sync/ --ignore-missing-imports +uv run invoke linter.lint-ty ``` **Policy:** - New or changed code is Ruff-clean and typed where touched (docstrings, specific exceptions). -- Do not increase existing mypy debt. If needed, use targeted `# type: ignore[]` with a short TODO. +- Do not increase existing ty debt. The `[tool.ty.overrides]` blocks in `pyproject.toml` already cover today's diagnostic baseline — do not add rules to them. If a real fix is impossible in your PR, use a targeted `# ty: ignore[]` with a short TODO. - If you add tests, run `uv run pytest -q`. **CLI sanity after changes:** @@ -121,7 +121,7 @@ infrahub-sync/ - Prefer explicit types on new or changed code. - Ruff: formatted and lint-clean. Honor `pyproject.toml`. - Pylint: fix actionable issues in touched code; some warnings are expected. -- Mypy: run with `--ignore-missing-imports`; do not increase the error count. +- ty: run via `uv run invoke linter.lint-ty` (or `uv run ty check .`); do not increase the error count. - Public functions and classes require concise docstrings. - Raise specific exceptions; avoid broad `except Exception:`. @@ -205,7 +205,7 @@ uv run invoke --list - Optional dependencies (for example, `pynetbox`, `pynautobot`) may be missing, producing import warnings. - `generate` and `sync` require running servers (Infrahub, NetBox, Nautobot). -- Existing mypy debt exists; do not increase it and type the code you touch. +- Existing ty debt is suppressed per module via `[[tool.ty.overrides]]` in `pyproject.toml`; do not broaden those blocks, and remove rules from them as you fix the underlying code. - Docs npm audit may flag dev-only vulnerabilities; they do not affect the Python package. ## Development Rules @@ -215,7 +215,7 @@ uv run invoke --list - Do not force-push on shared branches. - Do not amend to hide pre-commit fixes; use a follow-up commit. - Apply PR labels: `bugs`, `breaking`, `enhancements`, `features` (default to `enhancements`). -- Always run the required workflow (format → lint → mypy → CLI sanity) before a PR. +- Always run the required workflow (format → lint → CLI sanity) before a PR. `invoke lint` now includes ty alongside ruff, pylint, and yamllint. ### Commit and PR Messages @@ -236,7 +236,7 @@ uv run invoke --list **Approval checklist:** - [ ] Format and lint clean on changed areas. -- [ ] No increase in mypy errors; new code typed. +- [ ] `uv run ty check .` exits 0; new code typed. - [ ] CLI behaviors validated (`--help`, `list`, targeted `generate`). - [ ] Docs updated if flags or config changed. - [ ] Error handling uses specific exception types and clear messages. From fb845972c613461d27607b2f9571b1fb8adaa8b5 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:23:26 +0200 Subject: [PATCH 06/20] refactor(ty): fix invalid-argument-type in tests/ and drop suppression Extracted shared logic in _PrintCallVisitor into a private _visit_function helper accepting FunctionDef | AsyncFunctionDef so both visitor entrypoints type-check cleanly. Removed the tests/** override block. Co-Authored-By: Claude Opus 4.7 (1M context) --- pyproject.toml | 9 --------- tests/test_logging.py | 7 +++++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8655539..3150200 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -400,12 +400,3 @@ include = ["tasks/**"] invalid-argument-type = "ignore" unresolved-attribute = "ignore" -[[tool.ty.overrides]] -include = ["tests/**"] - -[tool.ty.overrides.rules] -################################################################################################## -# The ignored rules below should be removed once the code has been updated, they are included # -# like this so that we can reactivate them one by one. # -################################################################################################## -invalid-argument-type = "ignore" diff --git a/tests/test_logging.py b/tests/test_logging.py index f441e5c..389e760 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -29,14 +29,17 @@ def visit_ClassDef(self, node: ast.ClassDef) -> None: self.generic_visit(node) self._current_class = old - def visit_FunctionDef(self, node: ast.FunctionDef) -> None: + def _visit_function(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> None: old = self._current_func self._current_func = node.name self.generic_visit(node) self._current_func = old + def visit_FunctionDef(self, node: ast.FunctionDef) -> None: + self._visit_function(node) + def visit_AsyncFunctionDef(self, node: ast.AsyncFunctionDef) -> None: - self.visit_FunctionDef(node) # type: ignore[arg-type] + self._visit_function(node) def visit_Call(self, node: ast.Call) -> None: if isinstance(node.func, ast.Name) and node.func.id == "print" and self._current_func != "_print_callback": From 2acef22fcb1d30fa94e3065723c1e950f35979ac Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:25:23 +0200 Subject: [PATCH 07/20] refactor(ty): fix not-iterable in generator/ and drop suppression Guard optional `item.fields` with `or []` in has_field() so the generator module type-checks cleanly without the not-iterable override. Co-Authored-By: Claude Opus 4.7 (1M context) --- infrahub_sync/generator/__init__.py | 2 +- pyproject.toml | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/infrahub_sync/generator/__init__.py b/infrahub_sync/generator/__init__.py index 1e40036..2269671 100644 --- a/infrahub_sync/generator/__init__.py +++ b/infrahub_sync/generator/__init__.py @@ -53,7 +53,7 @@ def has_node(config: SyncConfig, name: str) -> bool: def has_field(config: SyncConfig, name: str, field: str) -> bool: for item in config.schema_mapping: if item.name == name: - for subitem in item.fields: + for subitem in item.fields or []: if subitem.name == field: return True return False diff --git a/pyproject.toml b/pyproject.toml index 3150200..2360b2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -379,16 +379,6 @@ invalid-attribute-access = "ignore" not-iterable = "ignore" unsupported-operator = "ignore" -[[tool.ty.overrides]] -include = ["infrahub_sync/generator/**"] - -[tool.ty.overrides.rules] -################################################################################################## -# The ignored rules below should be removed once the code has been updated, they are included # -# like this so that we can reactivate them one by one. # -################################################################################################## -not-iterable = "ignore" - [[tool.ty.overrides]] include = ["tasks/**"] From bfae67e5f46190526f2f29f84d51b1037e20170b Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:27:58 +0200 Subject: [PATCH 08/20] refactor(ty): fix invalid-argument-type in utils.py and drop suppression Wrap render_template's str literals in Path() at the call site so the generator signature stays Path-typed. Replace try/except TypeError around Path(config_file) with an explicit None guard so ty can narrow the type. Co-Authored-By: Claude Opus 4.7 (1M context) --- infrahub_sync/utils.py | 18 +++++++++--------- pyproject.toml | 10 ---------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/infrahub_sync/utils.py b/infrahub_sync/utils.py index 3901a81..dcc1308 100644 --- a/infrahub_sync/utils.py +++ b/infrahub_sync/utils.py @@ -58,9 +58,9 @@ def render_adapter( for item in files_to_render: render_template( - template_file=item[0], + template_file=Path(item[0]), output_dir=output_dir_path, - output_file=item[1], + output_file=Path(item[1]), context={"schema": schema, "adapter": adapter, "config": sync_instance}, ) output_file_path = output_dir_path / item[1] @@ -147,16 +147,16 @@ def get_instance( return item return None - config_file_path = None - try: - if Path(config_file).is_absolute() or directory is None: - config_file_path = Path(config_file) - elif directory: - config_file_path = Path(directory, config_file) - except TypeError: + if config_file is None: # TODO: Log or raise an Error/Warning return None + config_file_path: Path | None = None + if Path(config_file).is_absolute() or directory is None: + config_file_path = Path(config_file) + elif directory: + config_file_path = Path(directory, config_file) + if config_file_path: directory_path = config_file_path.parent if config_file_path.is_file(): diff --git a/pyproject.toml b/pyproject.toml index 2360b2b..cb47abb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -357,16 +357,6 @@ no-matching-overload = "ignore" too-many-positional-arguments = "ignore" unresolved-attribute = "ignore" -[[tool.ty.overrides]] -include = ["infrahub_sync/utils.py"] - -[tool.ty.overrides.rules] -################################################################################################## -# The ignored rules below should be removed once the code has been updated, they are included # -# like this so that we can reactivate them one by one. # -################################################################################################## -invalid-argument-type = "ignore" - [[tool.ty.overrides]] include = ["infrahub_sync/potenda/**"] From ce78954b38c85324de032fb3c9b9dfe03e92448b Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:31:14 +0200 Subject: [PATCH 09/20] refactor(ty): fix type errors in potenda/ and drop suppression Annotate `self.flags` as `DiffSyncFlags` so subsequent `|=` against `str | DiffSyncFlags` values is well-typed, guard the optional `config.diffsync_flags` iteration, and resolve string items into enum members inline. Keep two targeted `# ty: ignore[invalid-attribute-access]` on `Adapter.top_level` assignments since diffsync declares it as a ClassVar but supports per-instance overrides at runtime. Co-Authored-By: Claude Opus 4.7 (1M context) --- infrahub_sync/potenda/__init__.py | 13 ++++++++----- pyproject.toml | 12 ------------ 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/infrahub_sync/potenda/__init__.py b/infrahub_sync/potenda/__init__.py index 81ef046..e3d6ed7 100644 --- a/infrahub_sync/potenda/__init__.py +++ b/infrahub_sync/potenda/__init__.py @@ -34,8 +34,11 @@ def __init__( self.source = source self.destination = destination - self.source.top_level = top_level - self.destination.top_level = top_level + # diffsync's `Adapter.top_level` is declared as a ClassVar but the library + # supports per-instance overrides via attribute assignment; ty flags the + # ClassVar assignment so we suppress just those two lines. + self.source.top_level = top_level # ty: ignore[invalid-attribute-access] + self.destination.top_level = top_level # ty: ignore[invalid-attribute-access] self.partition = partition self.progress_bar = None @@ -45,9 +48,9 @@ def __init__( logging.getLogger("diffsync").setLevel(verbosity) # Combine DiffSyncFlags from the configuration - self.flags = DiffSyncFlags.NONE - for flag in self.config.diffsync_flags: - self.flags |= flag + self.flags: DiffSyncFlags = DiffSyncFlags.NONE + for flag in self.config.diffsync_flags or []: + self.flags |= flag if isinstance(flag, DiffSyncFlags) else DiffSyncFlags[flag] # Fallback to `SKIP_UNMATCHED_DST` if nothing is define if self.flags == DiffSyncFlags.NONE: diff --git a/pyproject.toml b/pyproject.toml index cb47abb..cbadfde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -357,18 +357,6 @@ no-matching-overload = "ignore" too-many-positional-arguments = "ignore" unresolved-attribute = "ignore" -[[tool.ty.overrides]] -include = ["infrahub_sync/potenda/**"] - -[tool.ty.overrides.rules] -################################################################################################## -# The ignored rules below should be removed once the code has been updated, they are included # -# like this so that we can reactivate them one by one. # -################################################################################################## -invalid-attribute-access = "ignore" -not-iterable = "ignore" -unsupported-operator = "ignore" - [[tool.ty.overrides]] include = ["tasks/**"] From f0f5281d7870e9b24d523eda537a39a09c01b1a9 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:33:38 +0200 Subject: [PATCH 10/20] refactor(ty): fix type errors in tasks/ and drop suppression Wrapped module args to Collection.add_collection() with Collection.from_module() for sharper type resolution (invoke accepts modules at runtime, but its stubs require Collection). Fixed stale docs.generate_doc reference (renamed to docs.generate). Guarded optional Result from context.run() in docs.docusaurus. Co-Authored-By: Claude Opus 4.7 (1M context) --- pyproject.toml | 12 ------------ tasks/__init__.py | 8 ++++---- tasks/docs.py | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cbadfde..d159965 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -356,15 +356,3 @@ missing-argument = "ignore" no-matching-overload = "ignore" too-many-positional-arguments = "ignore" unresolved-attribute = "ignore" - -[[tool.ty.overrides]] -include = ["tasks/**"] - -[tool.ty.overrides.rules] -################################################################################################## -# The ignored rules below should be removed once the code has been updated, they are included # -# like this so that we can reactivate them one by one. # -################################################################################################## -invalid-argument-type = "ignore" -unresolved-attribute = "ignore" - diff --git a/tasks/__init__.py b/tasks/__init__.py index 95987be..f4b905e 100644 --- a/tasks/__init__.py +++ b/tasks/__init__.py @@ -14,9 +14,9 @@ } } ) -ns.add_collection(linter) -ns.add_collection(docs) -ns.add_collection(tests) +ns.add_collection(Collection.from_module(linter)) +ns.add_collection(Collection.from_module(docs)) +ns.add_collection(Collection.from_module(tests)) @task(name="lint") @@ -49,7 +49,7 @@ def tests_integration(context: Context) -> None: @task(name="generate-doc") def generate_doc(context: Context) -> None: - docs.generate_doc(context) + docs.generate(context) @task(name="docusaurus") diff --git a/tasks/docs.py b/tasks/docs.py index 76b2ed0..481f62b 100644 --- a/tasks/docs.py +++ b/tasks/docs.py @@ -69,5 +69,5 @@ def docusaurus(context: Context) -> None: with context.cd(DOCUMENTATION_DIRECTORY): output = context.run(exec_cmd) - if output.exited != 0: + if output is None or output.exited != 0: sys.exit(-1) From 6976a93caf05eb53f156d5a80ddd51d6e16212df Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:36:33 +0200 Subject: [PATCH 11/20] refactor(ty): fix type errors in cli.py and drop suppression Re-typed `print_error_and_abort` as `NoReturn` (it always raises `typer.Abort`), letting ty narrow `sync_instance` from `SyncInstance | None` to `SyncInstance` after the post-`get_instance` guards. Cast the schema mapping returned by `InfrahubClientSync.schema.all()` (API schema variants) to the `NodeSchema | GenericSchema` mapping expected by utils helpers. Removed the cli.py override block from pyproject.toml. Co-Authored-By: Claude Opus 4.7 (1M context) --- infrahub_sync/cli.py | 17 ++++++++++++++--- pyproject.toml | 12 ------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/infrahub_sync/cli.py b/infrahub_sync/cli.py index 706a17f..ac32c39 100644 --- a/infrahub_sync/cli.py +++ b/infrahub_sync/cli.py @@ -1,6 +1,9 @@ +from __future__ import annotations + import logging from enum import Enum from timeit import default_timer as timer +from typing import TYPE_CHECKING, NoReturn, cast import typer from infrahub_sdk import InfrahubClientSync @@ -15,6 +18,11 @@ render_adapter, ) +if TYPE_CHECKING: + from collections.abc import MutableMapping + + from infrahub_sdk.schema import GenericSchema, NodeSchema + VERBOSITY_MAP = {"quiet": logging.WARNING, "default": logging.INFO, "verbose": logging.DEBUG} app = typer.Typer() @@ -58,7 +66,7 @@ def main( typer.echo(ctx.get_help()) -def print_error_and_abort(message: str) -> typer.Abort: +def print_error_and_abort(message: str) -> NoReturn: logger.error("%s", message) raise typer.Abort @@ -223,10 +231,13 @@ def generate( except ServerNotResponsiveError as exc: print_error_and_abort(str(exc)) - missing_schema_models = find_missing_schema_model(sync_instance=sync_instance, schema=schema) + # The Infrahub SDK returns API schema variants (NodeSchemaAPI, GenericSchemaAPI, ...) that are + # structurally compatible with the (NodeSchema | GenericSchema) mapping expected by utils. + typed_schema = cast("MutableMapping[str, NodeSchema | GenericSchema]", schema) + missing_schema_models = find_missing_schema_model(sync_instance=sync_instance, schema=typed_schema) if missing_schema_models: print_error_and_abort(f"One or more model model are not present in the Schema - {missing_schema_models}") - rendered_files = render_adapter(sync_instance=sync_instance, schema=schema) + rendered_files = render_adapter(sync_instance=sync_instance, schema=typed_schema) for template, output_path in rendered_files: logger.info("Rendered template %s to %s", template, output_path) diff --git a/pyproject.toml b/pyproject.toml index d159965..45f6c88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -328,18 +328,6 @@ not-iterable = "ignore" unresolved-attribute = "ignore" unresolved-import = "ignore" -[[tool.ty.overrides]] -include = ["infrahub_sync/cli.py"] - -[tool.ty.overrides.rules] -################################################################################################## -# The ignored rules below should be removed once the code has been updated, they are included # -# like this so that we can reactivate them one by one. # -################################################################################################## -invalid-argument-type = "ignore" -invalid-assignment = "ignore" -unresolved-attribute = "ignore" - [[tool.ty.overrides]] include = ["infrahub_sync/__init__.py"] From 09a7c6190b0918e31cfbed406e06eb560aa3dbcb Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 14:41:12 +0200 Subject: [PATCH 12/20] refactor(ty): fix type errors in infrahub_sync/__init__.py and drop suppression Annotate validator_kwargs and FILTERS_OPERATIONS to collapse Pydantic v1/v2 overload unions, declare DiffSyncMixin.top_level as a ClassVar, narrow the optional _add_custom_filters hook via getattr, raise on missing mapping in get_resource_name, and look up Pydantic fields via model_fields (v2) with a __fields__ fallback (v1). Single # ty: ignore[no-matching-overload] kept on the version-gated @validator_decorator call site. Co-Authored-By: Claude Opus 4.7 (1M context) --- infrahub_sync/__init__.py | 36 ++++++++++++++++++++++++++++-------- pyproject.toml | 16 ---------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/infrahub_sync/__init__.py b/infrahub_sync/__init__.py index 214667e..a6dd6c9 100644 --- a/infrahub_sync/__init__.py +++ b/infrahub_sync/__init__.py @@ -3,9 +3,12 @@ import logging import operator import re -from typing import Any, Union +from typing import TYPE_CHECKING, Any, ClassVar, Union import pydantic + +if TYPE_CHECKING: + from collections.abc import Callable from diffsync.enum import DiffSyncFlags from jinja2 import StrictUndefined from jinja2.nativetypes import NativeEnvironment @@ -16,14 +19,17 @@ logger = logging.getLogger(__name__) +# Pydantic v1/v2 compatibility shim. The runtime branch picks the right decorator +# and kwargs; ty cannot statically follow this (the kwargs dict has mixed value +# types across branches), so we suppress at the single call-site below. if version.parse(pydantic.__version__) >= version.parse("2.0.0"): # With Pydantic v2, we use `field_validator` with mode "before" from pydantic import field_validator as validator_decorator - validator_kwargs = {"mode": "before"} + validator_kwargs: dict[str, Any] = {"mode": "before"} else: # With Pydantic v1, we use validator with `pre=True` and `allow_reuse=True` - from pydantic import validator as validator_decorator + from pydantic import validator as validator_decorator # ty: ignore[deprecated] validator_kwargs = {"pre": True, "allow_reuse": True} @@ -76,7 +82,9 @@ class SyncConfig(pydantic.BaseModel): schema_mapping: list[SchemaMappingModel] = [] diffsync_flags: list[Union[str, DiffSyncFlags]] | None = [] - @validator_decorator("diffsync_flags", **validator_kwargs) + # ty cannot resolve which overload matches because validator_kwargs holds mixed + # value types across the v1/v2 branches. The runtime branch is correct. + @validator_decorator("diffsync_flags", **validator_kwargs) # ty: ignore[no-matching-overload] def convert_str_to_enum(cls, v): if not isinstance(v, list): msg = "diffsync_flags must be provided as a list" @@ -111,7 +119,7 @@ def convert_to_int(value: Any) -> int: raise ValueError(msg) from exc -FILTERS_OPERATIONS = { +FILTERS_OPERATIONS: dict[str, Callable[..., Any]] = { "==": operator.eq, "!=": operator.ne, ">": lambda field, value: operator.gt(convert_to_int(field), convert_to_int(value)), @@ -131,6 +139,11 @@ def convert_to_int(value: Any) -> int: class DiffSyncMixin: + # `top_level` is supplied by the concrete `DiffSync` subclass (a class + # attribute on `diffsync.DiffSync`). Declare it here so static type + # checkers can resolve `self.top_level` on the mixin. + top_level: ClassVar[list[str]] = [] + def load(self): """Load all the models, one by one based on the order defined in top_level.""" for item in self.top_level: @@ -190,8 +203,9 @@ def apply_transform(cls, item: dict[str, Any], transform_expr: str, field: str) ) # Allow subclasses to add custom filters - if hasattr(cls, "_add_custom_filters"): - cls._add_custom_filters(native_env, item) + add_custom_filters: Callable[..., None] | None = getattr(cls, "_add_custom_filters", None) + if add_custom_filters is not None: + add_custom_filters(native_env, item) # Compile the template with the native env template = native_env.from_string(transform_expr) @@ -250,13 +264,19 @@ def get_resource_name(cls, schema_mapping: list[SchemaMappingModel]) -> str: """Get the resource name from the schema mapping.""" for element in schema_mapping: if element.name == cls.__name__: + if element.mapping is None: + msg = f"Resource mapping is unset for class {cls.__name__}" + raise ValueError(msg) return element.mapping msg = f"Resource name not found for class {cls.__name__}" raise ValueError(msg) @classmethod def is_list(cls, name): - field = cls.__fields__.get(name) + # DiffSync models extend Pydantic; the field map is `model_fields` on v2 + # and `__fields__` on v1. Look up dynamically so this works with both. + fields = getattr(cls, "model_fields", None) or getattr(cls, "__fields__", None) or {} + field = fields.get(name) if not field: msg = f"Unable to find the field {name} under {cls}" raise ValueError(msg) diff --git a/pyproject.toml b/pyproject.toml index 45f6c88..1102f2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -328,19 +328,3 @@ not-iterable = "ignore" unresolved-attribute = "ignore" unresolved-import = "ignore" -[[tool.ty.overrides]] -include = ["infrahub_sync/__init__.py"] - -[tool.ty.overrides.rules] -################################################################################################## -# The ignored rules below should be removed once the code has been updated, they are included # -# like this so that we can reactivate them one by one. # -################################################################################################## -call-non-callable = "ignore" -deprecated = "ignore" -invalid-argument-type = "ignore" -invalid-return-type = "ignore" -missing-argument = "ignore" -no-matching-overload = "ignore" -too-many-positional-arguments = "ignore" -unresolved-attribute = "ignore" From b1e118e8a7b9f4c23815a93aaad4af217f20a45f Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 15:04:24 +0200 Subject: [PATCH 13/20] refactor(ty): fix type errors in adapters/ and drop suppression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Removed the override block for `infrahub_sync/adapters/**` from `pyproject.toml` (last remaining ty suppression). - Real fixes (no ignore needed): - `SchemaMappingModel.fields` is now non-Optional with `default_factory=list`; eliminates 3 `not-iterable` errors. - `DiffSyncModelMixin.local_id` declared on the mixin so static checkers see it on subclasses (covers most `local_id` references). - Every `model_loader(..., model: )` and `*_obj_to_diffsync` helper now correctly takes `type[]` instead of an instance. - `DiffSyncModel.create(...)` overrides now take `dict[Any, Any]` (the diffsync base shape) instead of `Mapping[Any, Any]`, restoring LSP. - Direct import `from typing_extensions import Self` (project targets 3.10 where `typing.Self` doesn't exist; ty couldn't follow the try/except shim). - `slurpitsync.slurpit_obj_to_diffsync` return type is now `dict | None` (matched the actual code path that returns `None`). - `genericrestapi._extract_objects_from_response` introduces a typed `result` variable to satisfy the declared return type. - `prometheus._ensure_samples`/`model_loader` use locally-bound variables so `_lookup` / `_samples_by_metric` narrow correctly. - `infrahub.py`: `resolve_peer_node` now guards `client is None` on the fallback path; `diffsync_to_infrahub`/`infrahub_node_to_diffsync` skip when `schemas.get(peer)` returns None; `InfrahubModel.create` and `.update` assert `isinstance(adapter, InfrahubAdapter)` so all runtime-only attributes (`client`, `source_node`, `owner_node`, `schema`) narrow without ignores; `node_schema` parameter retyped to `NodeSchemaAPI` (was `NodeSchema`, which is missing `relationship_names`/`relationships`). - `client.all(..., include=list(model._attributes), ...)` — coerce the `Tuple[str, ...]` ClassVar to `list[str]` for the overload. - `# ty: ignore` annotations (each with a stated reason): - `unresolved-import` (5): `pynetbox`, `pynautobot`, `slurpit`, `ipfabric`, `prometheus_client.parser` — all optional extras. - `unresolved-attribute` (9): `self.type.title()` across 7 adapters (base `Adapter.type` is `Optional[str]`; override is non-None at runtime), `adapter.config`/`adapter.store`/`adapter.client` calls in `utils.build_mapping` and `peeringmanager.update` (runtime attrs attached by concrete sync adapters), and `node.local_id` on store-returned `DiffSyncModel` (typing limitation: `DiffSync.store.get_all()` returns the base class). Co-Authored-By: Claude Opus 4.7 (1M context) --- infrahub_sync/__init__.py | 6 ++- infrahub_sync/adapters/genericrestapi.py | 47 ++++++++++---------- infrahub_sync/adapters/infrahub.py | 56 ++++++++++++++---------- infrahub_sync/adapters/ipfabricsync.py | 29 ++++++------ infrahub_sync/adapters/nautobot.py | 35 +++++++-------- infrahub_sync/adapters/netbox.py | 35 +++++++-------- infrahub_sync/adapters/peeringmanager.py | 34 +++++++------- infrahub_sync/adapters/prometheus.py | 44 ++++++++++--------- infrahub_sync/adapters/slurpitsync.py | 28 +++++------- infrahub_sync/adapters/utils.py | 6 ++- pyproject.toml | 18 -------- 11 files changed, 165 insertions(+), 173 deletions(-) diff --git a/infrahub_sync/__init__.py b/infrahub_sync/__init__.py index a6dd6c9..54e8e20 100644 --- a/infrahub_sync/__init__.py +++ b/infrahub_sync/__init__.py @@ -58,7 +58,7 @@ class SchemaMappingModel(pydantic.BaseModel): identifiers: list[str] | None = pydantic.Field(default=None) filters: list[SchemaMappingFilter] | None = pydantic.Field(default=None) transforms: list[SchemaMappingTransform] | None = pydantic.Field(default=None) - fields: list[SchemaMappingField] | None = [] + fields: list[SchemaMappingField] = pydantic.Field(default_factory=list) class SyncAdapter(pydantic.BaseModel): @@ -159,6 +159,10 @@ def model_loader(self, model_name: str, model): class DiffSyncModelMixin: + # `local_id` is declared by generated subclasses (see generator/templates/diffsync_models.j2). + # Declare it here so static type checkers can resolve `instance.local_id` on the mixin. + local_id: str | None = None + @classmethod def apply_filter(cls, field_value: Any, operation: str, value: Any) -> bool: """Apply a specified operation to a field value.""" diff --git a/infrahub_sync/adapters/genericrestapi.py b/infrahub_sync/adapters/genericrestapi.py index a4a35e5..d6ae55c 100644 --- a/infrahub_sync/adapters/genericrestapi.py +++ b/infrahub_sync/adapters/genericrestapi.py @@ -1,17 +1,14 @@ from __future__ import annotations -import os -from typing import TYPE_CHECKING, Any - -try: - from typing import Self -except ImportError: - from typing_extensions import Self - import logging +import os +from typing import Any from diffsync import Adapter, DiffSyncModel +# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. +from typing_extensions import Self + from infrahub_sync import ( DiffSyncMixin, DiffSyncModelMixin, @@ -25,9 +22,6 @@ logger = logging.getLogger(__name__) -if TYPE_CHECKING: - from collections.abc import Mapping - class GenericrestapiAdapter(DiffSyncMixin, Adapter): """ @@ -134,7 +128,7 @@ def _create_rest_client(self, settings: dict) -> RestApiClient: verify=verify_ssl, ) - def model_loader(self, model_name: str, model: GenericrestapiModel) -> None: + def model_loader(self, model_name: str, model: type[GenericrestapiModel]) -> None: """ Load and process models using schema mapping filters and transformations. @@ -165,7 +159,8 @@ def model_loader(self, model_name: str, model: GenericrestapiModel) -> None: raise ValueError(msg) from exc total = len(objs) - if self.config.source.name.title() == self.type.title(): + # `self.type` is set via `adapter_type` in __init__ but typed `str | None` on the base. + if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=objs, schema_mapping=element) logger.info("%s: Loading %d/%d %s", self.type, len(filtered_objs), total, resource_name) @@ -207,16 +202,21 @@ def _extract_objects_from_response( objs = response_data.get(response_key, response_data.get(resource_name, {})) # Handle different response formats + result: list[dict[str, Any]] if isinstance(objs, dict): - # If it's a dict, convert values to list (like Observium) - objs = list(objs.values()) + # If it's a dict, convert values to list (like Observium); response values are dict-shaped. + result = list(objs.values()) # ty: ignore[invalid-assignment] elif not isinstance(objs, list): # If it's neither dict nor list, wrap in list - objs = [objs] if objs else [] + result = [objs] if objs else [] + else: + result = objs - return objs + return result - def obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingModel, model: GenericrestapiModel) -> dict: + def obj_to_diffsync( + self, obj: dict[str, Any], mapping: SchemaMappingModel, model: type[GenericrestapiModel] + ) -> dict: """ Convert an object to DiffSync format. @@ -257,7 +257,7 @@ def obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingModel, mode if isinstance(node, dict): matching_nodes = [] node_id = node.get("id", None) - matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + matching_nodes = [item for item in nodes if item.local_id == str(node_id)] # ty: ignore[unresolved-attribute] if len(matching_nodes) == 0: msg = f"Unable to locate the node {model} {node_id}" raise IndexError(msg) @@ -269,7 +269,8 @@ def obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingModel, mode else: data[field.name] = [] - for node in get_value(obj, field.mapping): + # get_value returns Any | None; guarded above by the outer field.mapping check. + for node in get_value(obj, field.mapping) or []: if not node: continue node_id = node.get("id", None) @@ -277,7 +278,7 @@ def obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingModel, mode node_id = node[1] if node[0] == "id" else None if not node_id: continue - matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + matching_nodes = [item for item in nodes if item.local_id == str(node_id)] # ty: ignore[unresolved-attribute] if len(matching_nodes) == 0: msg = f"Unable to locate the node {field.reference} {node_id}" raise IndexError(msg) @@ -296,8 +297,8 @@ class GenericrestapiModel(DiffSyncModelMixin, DiffSyncModel): def create( cls, adapter: Adapter, - ids: Mapping[Any, Any], - attrs: Mapping[Any, Any], + ids: dict[Any, Any], + attrs: dict[Any, Any], ) -> Self | None: # TODO: To implement return super().create(adapter=adapter, ids=ids, attrs=attrs) diff --git a/infrahub_sync/adapters/infrahub.py b/infrahub_sync/adapters/infrahub.py index 188f6f4..4e9e34d 100644 --- a/infrahub_sync/adapters/infrahub.py +++ b/infrahub_sync/adapters/infrahub.py @@ -6,14 +6,6 @@ import os from typing import TYPE_CHECKING, Any -from infrahub_sdk.schema.main import GenericSchemaAPI, NodeSchema, RelationshipSchemaAPI - -try: - from typing import Self -except ImportError: - from typing_extensions import Self - - from diffsync import Adapter, DiffSyncModel from infrahub_sdk import ( Config, @@ -21,8 +13,12 @@ ) from infrahub_sdk.exceptions import NodeNotFoundError from infrahub_sdk.node.property import NodeProperty +from infrahub_sdk.schema.main import GenericSchemaAPI, NodeSchemaAPI, RelationshipSchemaAPI from infrahub_sdk.utils import compare_lists +# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. +from typing_extensions import Self + from infrahub_sync import ( DiffSyncMixin, DiffSyncModelMixin, @@ -84,7 +80,7 @@ def resolve_peer_node( if peer_node and fallback and client and not _node_has_complete_attributes(peer_node): peer_node = client.get(id=key, kind=peer_node.get_kind(), populate_store=True) - if not peer_node and fallback: + if not peer_node and fallback and client is not None: logger.warning("Unable to find %s [%s] in Store - Fallback to Infrahub", rel_schema.peer, key) peer_node = client.get(id=key, kind=rel_schema.peer, populate_store=True) if not peer_node: @@ -122,8 +118,8 @@ def update_node( if attr_name in node._schema.relationship_names: for rel_schema in node._schema.relationships: - peer_schema: MainSchemaTypesAPI = schemas.get(rel_schema.peer) - if attr_name != rel_schema.name: + peer_schema = schemas.get(rel_schema.peer) + if attr_name != rel_schema.name or peer_schema is None: continue if rel_schema.cardinality == "one": @@ -179,7 +175,7 @@ def diffsync_to_infrahub( ids: Mapping[Any, Any], attrs: Mapping[Any, Any], store: NodeStoreSync, - node_schema: NodeSchema, + node_schema: NodeSchemaAPI, schemas: Mapping[str, MainSchemaTypesAPI], ) -> dict[Any, Any]: """ @@ -193,8 +189,8 @@ def diffsync_to_infrahub( for key in list(data.keys()): if key in node_schema.relationship_names: for rel_schema in node_schema.relationships: - peer_schema: MainSchemaTypesAPI = schemas.get(rel_schema.peer) - if key != rel_schema.name: + peer_schema = schemas.get(rel_schema.peer) + if key != rel_schema.name or peer_schema is None: continue if rel_schema.cardinality == "one": @@ -300,7 +296,7 @@ def __init__( # We will keep a copy of the schema self.schema: MutableMapping[str, MainSchemaTypesAPI] = self.client.schema.all(branch=infrahub_branch) - def model_loader(self, model_name: str, model: InfrahubModel) -> None: + def model_loader(self, model_name: str, model: type[InfrahubModel]) -> None: """ Load and process models using schema mapping filters and transformations. @@ -310,7 +306,7 @@ def model_loader(self, model_name: str, model: InfrahubModel) -> None: element = next((el for el in self.config.schema_mapping if el.name == model_name), None) if element: # Retrieve all nodes corresponding to model_name (list of InfrahubNodeSync) - nodes = self.client.all(kind=model_name, include=model._attributes, populate_store=True) + nodes = self.client.all(kind=model_name, include=list(model._attributes), populate_store=True) # Transform the list of InfrahubNodeSync into a list of (node, dict) tuples node_dict_pairs = [(node, self.infrahub_node_to_diffsync(node=node)) for node in nodes] @@ -319,7 +315,8 @@ def model_loader(self, model_name: str, model: InfrahubModel) -> None: # Extract the list of dicts for filtering and transforming list_obj = [pair[1] for pair in node_dict_pairs] - if self.config.source.name.title() == self.type.title(): + # `self.type` is overridden as a non-None ClassVar; ty sees the base Optional[str]. + if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=list_obj, schema_mapping=element) logger.info("%s: Loading %d/%d %s", self.type, len(filtered_objs), total, model_name) @@ -361,7 +358,9 @@ def infrahub_node_to_diffsync(self, node: InfrahubNodeSync) -> dict[str, Any]: for rel_schema in node._schema.relationships: if not has_field(config=self.config, name=node._schema.kind, field=rel_schema.name): continue - peer_schema: MainSchemaTypesAPI = self.schema.get(rel_schema.peer) + peer_schema = self.schema.get(rel_schema.peer) + if peer_schema is None: + continue if rel_schema.cardinality == "one": rel: RelatedNodeSync = getattr(node, rel_schema.name) @@ -449,11 +448,17 @@ class InfrahubModel(DiffSyncModelMixin, DiffSyncModel): @classmethod def create( cls, - adapter: InfrahubAdapter, - ids: Mapping[Any, Any], - attrs: Mapping[Any, Any], + adapter: Adapter, + ids: dict[Any, Any], + attrs: dict[Any, Any], ) -> Self | None: + # `adapter` is typed as the diffsync base for Liskov compatibility with DiffSyncModel.create, + # but at runtime it is always an InfrahubAdapter (registered via add_model). + assert isinstance(adapter, InfrahubAdapter) node_schema = adapter.client.schema.get(kind=cls.__name__) + # client.schema.get() returns MainSchemaTypesAPI; diffsync_to_infrahub requires NodeSchemaAPI. + # All nodes registered as DiffSync models are concrete (NodeSchemaAPI), not generics/profiles. + assert isinstance(node_schema, NodeSchemaAPI) data = diffsync_to_infrahub( ids=ids, attrs=attrs, node_schema=node_schema, store=adapter.client.store, schemas=adapter.schema ) @@ -470,9 +475,12 @@ def create( return super().create(adapter=adapter, ids=ids, attrs=attrs) def update(self, attrs: dict) -> Self | None: - node = self.adapter.client.get(id=self.local_id, kind=self.__class__.__name__) - source_id = self.adapter.source_node.id if self.adapter.source_node else None - owner_id = self.adapter.owner_node.id if self.adapter.owner_node else None + # `self.adapter` is `Adapter | None` on the diffsync base; always set after registration. + adapter = self.adapter + assert isinstance(adapter, InfrahubAdapter) + node = adapter.client.get(id=self.local_id, kind=self.__class__.__name__) + source_id = adapter.source_node.id if adapter.source_node else None + owner_id = adapter.owner_node.id if adapter.owner_node else None node = update_node(node=node, attrs=attrs, source=source_id, owner=owner_id) node.save(allow_upsert=True) diff --git a/infrahub_sync/adapters/ipfabricsync.py b/infrahub_sync/adapters/ipfabricsync.py index 899c86a..f5dee21 100644 --- a/infrahub_sync/adapters/ipfabricsync.py +++ b/infrahub_sync/adapters/ipfabricsync.py @@ -3,15 +3,13 @@ import json import logging import os -from typing import TYPE_CHECKING, Any - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Any, ClassVar from diffsync import Adapter, DiffSyncModel +# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. +from typing_extensions import Self + from infrahub_sync import ( DiffSyncMixin, DiffSyncModelMixin, @@ -24,14 +22,11 @@ logger = logging.getLogger(__name__) try: - from ipfabric import IPFClient + from ipfabric import IPFClient # ty: ignore[unresolved-import] # optional dep, see pyproject extras except ImportError: logger.exception("Failed to import ipfabric") raise -if TYPE_CHECKING: - from collections.abc import Mapping - ipf_filters = { "tables/inventory/summary/platforms": {"and": [{"platform": ["empty", False]}]}, "tables/inventory/summary/models": {"and": [{"model": ["empty", False]}]}, @@ -40,7 +35,8 @@ class IpfabricsyncAdapter(DiffSyncMixin, Adapter): - type = "IPFabricsync" + # diffsync.Adapter declares `type: Optional[str]`; narrow to non-None here. + type: ClassVar[str] = "IPFabricsync" def __init__(self, target: str, adapter: SyncAdapter, config: SyncConfig, *args, **kwargs) -> None: super().__init__(*args, **kwargs) @@ -68,7 +64,7 @@ def _create_ipfabric_client(self, adapter: SyncAdapter) -> IPFClient: return IPFClient(**settings) - def model_loader(self, model_name: str, model: IpfabricsyncModel) -> None: + def model_loader(self, model_name: str, model: type[IpfabricsyncModel]) -> None: """ Load and process models using schema mapping filters and transformations. @@ -84,7 +80,8 @@ def model_loader(self, model_name: str, model: IpfabricsyncModel) -> None: table = self.client.fetch_all(element.mapping, filters=ipf_filters.get(element.mapping)) total = len(table) - if self.config.source.name.title() == self.type.title(): + # `self.type` is overridden as a non-None ClassVar above; ty sees the base Optional[str]. + if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=table, schema_mapping=element) logger.info("%s: Loading %d/%d %s", self.type, len(filtered_objs), total, element.mapping) @@ -99,7 +96,7 @@ def model_loader(self, model_name: str, model: IpfabricsyncModel) -> None: item = model(**data) self.update_or_add_model_instance(item) - def ipfabric_dict_to_diffsync(self, obj: dict, mapping: SchemaMappingModel, model: IpfabricsyncModel) -> dict: # pylint: disable=too-many-branches + def ipfabric_dict_to_diffsync(self, obj: dict, mapping: SchemaMappingModel, model: type[IpfabricsyncModel]) -> dict: # pylint: disable=too-many-branches data: dict[str, Any] = {"local_id": str(obj["id"])} for field in mapping.fields: # pylint: disable=too-many-nested-blocks @@ -163,8 +160,8 @@ class IpfabricsyncModel(DiffSyncModelMixin, DiffSyncModel): def create( cls, adapter: Adapter, - ids: Mapping[Any, Any], - attrs: Mapping[Any, Any], + ids: dict[Any, Any], + attrs: dict[Any, Any], ) -> Self | None: # TODO: To Implement return super().create(adapter=adapter, ids=ids, attrs=attrs) diff --git a/infrahub_sync/adapters/nautobot.py b/infrahub_sync/adapters/nautobot.py index 10d2b5d..bd8036e 100644 --- a/infrahub_sync/adapters/nautobot.py +++ b/infrahub_sync/adapters/nautobot.py @@ -3,16 +3,14 @@ # pylint: disable=R0801 import logging import os -from typing import TYPE_CHECKING, Any +from typing import Any -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -import pynautobot +import pynautobot # ty: ignore[unresolved-import] # optional dep, see pyproject extras from diffsync import Adapter, DiffSyncModel +# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. +from typing_extensions import Self + from infrahub_sync import ( DiffSyncMixin, DiffSyncModelMixin, @@ -25,9 +23,6 @@ logger = logging.getLogger(__name__) -if TYPE_CHECKING: - from collections.abc import Mapping - class NautobotAdapter(DiffSyncMixin, Adapter): type = "Nautobot" @@ -52,7 +47,7 @@ def _create_nautobot_client(self, adapter: SyncAdapter) -> pynautobot.api: client = pynautobot.api(url=url, token=token, threading=True, max_workers=5, retries=3, verify=verify_ssl) return client - def model_loader(self, model_name: str, model: NautobotModel) -> None: + def model_loader(self, model_name: str, model: type[NautobotModel]) -> None: """ Load and process models using schema mapping filters and transformations. @@ -82,7 +77,8 @@ def model_loader(self, model_name: str, model: NautobotModel) -> None: list_obj.append(dict(node)) total = len(list_obj) - if self.config.source.name.title() == self.type.title(): + # `self.type` is overridden as a non-None ClassVar; ty sees the base Optional[str]. + if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=list_obj, schema_mapping=element) logger.info("%s: Loading %d/%d %s", self.type, len(filtered_objs), total, resource_name) @@ -98,7 +94,9 @@ def model_loader(self, model_name: str, model: NautobotModel) -> None: item = model(**data) self.add(item) - def nautobot_obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingModel, model: NautobotModel) -> dict: + def nautobot_obj_to_diffsync( + self, obj: dict[str, Any], mapping: SchemaMappingModel, model: type[NautobotModel] + ) -> dict: obj_id = obj.get("id") data: dict[str, Any] = {"local_id": str(obj_id)} @@ -129,7 +127,7 @@ def nautobot_obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingMo matching_nodes = [] node_id = node.get("id", None) if node_id: - matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + matching_nodes = [item for item in nodes if item.local_id == str(node_id)] # ty: ignore[unresolved-attribute] if len(matching_nodes) == 0: # TODO: If the peer is a Node we are filtering, we could end up not finding it logger.warning("Unable to locate the node %s %s", field.name, node_id) @@ -139,7 +137,8 @@ def nautobot_obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingMo else: data[field.name] = [] - for node in get_value(obj, field.mapping): + # get_value returns Any | None; default to empty iterable when missing. + for node in get_value(obj, field.mapping) or []: if not node: continue node_id = node.get("id", None) @@ -147,7 +146,7 @@ def nautobot_obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingMo node_id = node[1] if node[0] == "id" else None if not node_id: continue - matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + matching_nodes = [item for item in nodes if item.local_id == str(node_id)] # ty: ignore[unresolved-attribute] if len(matching_nodes) == 0: # TODO: If the peer is a Node we are filtering, we could end up not finding it logger.warning("Unable to locate the node %s %s", field.name, node_id) @@ -163,8 +162,8 @@ class NautobotModel(DiffSyncModelMixin, DiffSyncModel): def create( cls, adapter: Adapter, - ids: Mapping[Any, Any], - attrs: Mapping[Any, Any], + ids: dict[Any, Any], + attrs: dict[Any, Any], ) -> Self | None: # TODO: To implement return super().create(adapter=adapter, ids=ids, attrs=attrs) diff --git a/infrahub_sync/adapters/netbox.py b/infrahub_sync/adapters/netbox.py index 5c078cc..0a4e325 100644 --- a/infrahub_sync/adapters/netbox.py +++ b/infrahub_sync/adapters/netbox.py @@ -3,16 +3,14 @@ # pylint: disable=R0801 import logging import os -from typing import TYPE_CHECKING, Any +from typing import Any +import pynetbox # ty: ignore[unresolved-import] # optional dep, see pyproject extras +from diffsync import Adapter, DiffSyncModel from requests import Session -try: - from typing import Self -except ImportError: - from typing_extensions import Self -import pynetbox -from diffsync import Adapter, DiffSyncModel +# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. +from typing_extensions import Self from infrahub_sync import ( DiffSyncMixin, @@ -26,9 +24,6 @@ logger = logging.getLogger(__name__) -if TYPE_CHECKING: - from collections.abc import Mapping - class NetboxAdapter(DiffSyncMixin, Adapter): type = "Netbox" @@ -57,7 +52,7 @@ def _create_netbox_client(self, adapter: SyncAdapter) -> pynetbox.api: client.http_session = session return client - def model_loader(self, model_name: str, model: NetboxModel) -> None: + def model_loader(self, model_name: str, model: type[NetboxModel]) -> None: """ Load and process models using schema mapping filters and transformations. @@ -86,7 +81,8 @@ def model_loader(self, model_name: str, model: NetboxModel) -> None: list_obj.append(dict(node)) total = len(list_obj) - if self.config.source.name.title() == self.type.title(): + # `self.type` is overridden as a non-None ClassVar; ty sees the base Optional[str]. + if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=list_obj, schema_mapping=element) logger.info("%s: Loading %d/%d %s", self.type, len(filtered_objs), total, resource_name) @@ -102,7 +98,9 @@ def model_loader(self, model_name: str, model: NetboxModel) -> None: item = model(**data) self.add(item) - def netbox_obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingModel, model: NetboxModel) -> dict: + def netbox_obj_to_diffsync( + self, obj: dict[str, Any], mapping: SchemaMappingModel, model: type[NetboxModel] + ) -> dict: obj_id = obj.get("id") data: dict[str, Any] = {"local_id": str(obj_id)} @@ -134,7 +132,7 @@ def netbox_obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingMode if isinstance(node, dict): matching_nodes = [] node_id = node.get("id", None) - matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + matching_nodes = [item for item in nodes if item.local_id == str(node_id)] # ty: ignore[unresolved-attribute] if len(matching_nodes) == 0: msg = f"Unable to locate the node {field.name} {node_id}" raise IndexError(msg) @@ -144,7 +142,8 @@ def netbox_obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingMode data[field.name] = node else: data[field.name] = [] - for node in get_value(obj, field.mapping): + # get_value returns Any | None; default to empty iterable when missing. + for node in get_value(obj, field.mapping) or []: if not node: continue node_id = node.get("id", None) @@ -152,7 +151,7 @@ def netbox_obj_to_diffsync(self, obj: dict[str, Any], mapping: SchemaMappingMode node_id = node[1] if node[0] == "id" else None if not node_id: continue - matching_nodes = [item for item in nodes if item.local_id == str(node_id)] + matching_nodes = [item for item in nodes if item.local_id == str(node_id)] # ty: ignore[unresolved-attribute] if len(matching_nodes) == 0: msg = f"Unable to locate the node {field.reference} {node_id}" raise IndexError(msg) @@ -167,8 +166,8 @@ class NetboxModel(DiffSyncModelMixin, DiffSyncModel): def create( cls, adapter: Adapter, - ids: Mapping[Any, Any], - attrs: Mapping[Any, Any], + ids: dict[Any, Any], + attrs: dict[Any, Any], ) -> Self | None: # TODO: To implement return super().create(adapter=adapter, ids=ids, attrs=attrs) diff --git a/infrahub_sync/adapters/peeringmanager.py b/infrahub_sync/adapters/peeringmanager.py index 189faf9..f93b1ec 100644 --- a/infrahub_sync/adapters/peeringmanager.py +++ b/infrahub_sync/adapters/peeringmanager.py @@ -2,18 +2,14 @@ from typing import TYPE_CHECKING, Any -try: - from typing import Self -except ImportError: - from typing_extensions import Self - import requests +# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. +from typing_extensions import Self + from infrahub_sync.adapters.genericrestapi import GenericrestapiAdapter, GenericrestapiModel if TYPE_CHECKING: - from collections.abc import Mapping - from diffsync import Adapter from infrahub_sync import ( @@ -54,8 +50,8 @@ class PeeringmanagerModel(GenericrestapiModel): def create( cls, adapter: Adapter, - ids: Mapping[Any, Any], - attrs: Mapping[Any, Any], + ids: dict[Any, Any], + attrs: dict[Any, Any], ) -> Self | None: # TODO: To implement return super().create(adapter=adapter, ids=ids, attrs=attrs) @@ -68,8 +64,13 @@ def update(self, attrs: dict) -> Self | None: based on the schema mapping configuration, and sends an update request to the API endpoint of the object. """ - # Determine the resource name using the schema mapping - resource_name = self.__class__.get_resource_name(schema_mapping=self.adapter.config.schema_mapping) + # `self.adapter` is `Adapter | None` on the diffsync base, but is always + # set when `update()` is called on a registered instance. + adapter = self.adapter + assert adapter is not None + # `config` / `client` are attached at runtime by the concrete sync adapter + # and are not declared on the diffsync.Adapter base. + resource_name = self.__class__.get_resource_name(schema_mapping=adapter.config.schema_mapping) # ty: ignore[unresolved-attribute] # Determine the unique identifier for the API request unique_identifier = self.local_id if hasattr(self, "local_id") else self.get_unique_id() @@ -77,7 +78,7 @@ def update(self, attrs: dict) -> Self | None: # Map incoming attributes to the target attributes based on schema mapping mapped_attrs: dict[str, Any] = {} - for field in self.adapter.config.schema_mapping: + for field in adapter.config.schema_mapping: # ty: ignore[unresolved-attribute] if field.name == self.__class__.get_type(): for field_mapping in field.fields: # Map source field name to target field name @@ -87,14 +88,15 @@ def update(self, attrs: dict) -> Self | None: # Check if the field is a relationship if field_mapping.reference: - all_nodes_for_reference = self.adapter.store.get_all(model=field_mapping.reference) + all_nodes_for_reference = adapter.store.get_all(model=field_mapping.reference) if isinstance(value, list): # For lists, filter nodes to match the unique IDs in the attribute value filtered_nodes = [ node for node in all_nodes_for_reference if node.get_unique_id() in value ] - mapped_attrs[target_field_name] = [node.local_id for node in filtered_nodes] + # `local_id` is declared on generated subclasses (DiffSyncModelMixin). + mapped_attrs[target_field_name] = [node.local_id for node in filtered_nodes] # ty: ignore[unresolved-attribute] else: # For single references, find the matching node filtered_node = next( @@ -102,13 +104,13 @@ def update(self, attrs: dict) -> Self | None: None, ) if filtered_node: - mapped_attrs[target_field_name] = filtered_node.local_id + mapped_attrs[target_field_name] = filtered_node.local_id # ty: ignore[unresolved-attribute] else: mapped_attrs[target_field_name] = value # Attempt to send the update request to the API try: - self.adapter.client.patch(endpoint, data=mapped_attrs) + adapter.client.patch(endpoint, data=mapped_attrs) # ty: ignore[unresolved-attribute] return super().update(attrs) except (requests.exceptions.HTTPError, ConnectionError) as exc: msg = f"Error during update: {exc!s}" diff --git a/infrahub_sync/adapters/prometheus.py b/infrahub_sync/adapters/prometheus.py index fdcae8c..b95ff3a 100644 --- a/infrahub_sync/adapters/prometheus.py +++ b/infrahub_sync/adapters/prometheus.py @@ -3,17 +3,16 @@ import logging import os import re -from typing import TYPE_CHECKING, Any - -from prometheus_client.parser import text_string_to_metric_families - -try: - from typing import Self -except ImportError: - from typing_extensions import Self +from typing import Any import requests from diffsync import Adapter, DiffSyncModel +from prometheus_client.parser import ( # ty: ignore[unresolved-import] # optional dep, see pyproject extras + text_string_to_metric_families, +) + +# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. +from typing_extensions import Self from infrahub_sync import ( DiffSyncMixin, @@ -47,8 +46,6 @@ def _derive_identifier_key(obj: dict) -> str: return f"{name}|{key}" if key else name -if TYPE_CHECKING: - from collections.abc import Mapping # ----------------------------------------------------------------------------------------------------------- @@ -434,10 +431,11 @@ def __init__(self, target: str, adapter: SyncAdapter, config: SyncConfig, *args, self._lookup: LookupResolver | None = None def _ensure_samples(self) -> dict[str, list[dict[str, Any]]]: - if self._samples_by_metric is not None: + cached = self._samples_by_metric + if cached is not None: if self._lookup is None: - self._lookup = LookupResolver(samples_by_metric=self._samples_by_metric) - return self._samples_by_metric + self._lookup = LookupResolver(samples_by_metric=cached) + return cached if isinstance(self.client, PrometheusScrapeClient): self._samples_by_metric = self.client.get_metrics(params=self.params) @@ -461,8 +459,10 @@ def _ensure_samples(self) -> dict[str, list[dict[str, Any]]]: self._samples_by_metric = store # init lookup resolver - self._lookup = LookupResolver(samples_by_metric=self._samples_by_metric) - return self._samples_by_metric + assert self._samples_by_metric is not None + samples = self._samples_by_metric + self._lookup = LookupResolver(samples_by_metric=samples) + return samples # ---- DiffSync hooks ---- @@ -483,17 +483,19 @@ def model_loader(self, model_name: str, model) -> None: # Inject a callable 'lookup' into each record so Jinja transforms can use it. # NOTE: must be done BEFORE transforms. - if self._lookup: + lookup = self._lookup + if lookup is not None: for obj in objs: # bind current obj into the callable - def _mk_lookup(current: dict[str, Any]): - return lambda metric, key_or_path, value_path, default=None: self._lookup.resolve_fn( + def _mk_lookup(current: dict[str, Any], _lookup: LookupResolver = lookup): + return lambda metric, key_or_path, value_path, default=None: _lookup.resolve_fn( current, metric, key_or_path, value_path, default ) obj["lookup"] = _mk_lookup(obj) - if self.config.source.name.title() == self.type.title(): + # `self.type` is overridden as a non-None ClassVar; ty sees the base Optional[str]. + if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] filtered_objs = model.filter_records(records=objs, schema_mapping=element) transformed_objs = model.transform_records(records=filtered_objs, schema_mapping=element) logger.info( @@ -556,8 +558,8 @@ class PrometheusModel(DiffSyncModelMixin, DiffSyncModel): def create( cls, adapter: Adapter, - ids: Mapping[Any, Any], - attrs: Mapping[Any, Any], + ids: dict[Any, Any], + attrs: dict[Any, Any], ) -> Self | None: # TODO: To implement return super().create(adapter=adapter, ids=ids, attrs=attrs) diff --git a/infrahub_sync/adapters/slurpitsync.py b/infrahub_sync/adapters/slurpitsync.py index 063ef09..ddb0d76 100644 --- a/infrahub_sync/adapters/slurpitsync.py +++ b/infrahub_sync/adapters/slurpitsync.py @@ -3,16 +3,14 @@ import asyncio import ipaddress import logging -from typing import TYPE_CHECKING, Any +from typing import Any -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -import slurpit +import slurpit # ty: ignore[unresolved-import] # optional dep, see pyproject extras from diffsync import Adapter, DiffSyncModel +# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. +from typing_extensions import Self + from infrahub_sync import ( DiffSyncMixin, DiffSyncModelMixin, @@ -24,9 +22,6 @@ logger = logging.getLogger(__name__) -if TYPE_CHECKING: - from collections.abc import Mapping - # Create a new event loop for running async functions synchronously loop = asyncio.new_event_loop() @@ -171,7 +166,7 @@ def planning_results(self, planning_name): results = self.run_async(self.client.planning.search_plannings(search_data, limit=30000)) return results or [] - def model_loader(self, model_name: str, model: SlurpitsyncModel) -> None: + def model_loader(self, model_name: str, model: type[SlurpitsyncModel]) -> None: for element in self.config.schema_mapping: if element.name != model_name: continue @@ -203,7 +198,8 @@ def model_loader(self, model_name: str, model: SlurpitsyncModel) -> None: list_obj.append(node) total = len(list_obj) - if self.config.source.name.title() == self.type.title(): + # `self.type` is overridden as a non-None ClassVar; ty sees the base Optional[str]. + if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=list_obj, schema_mapping=element) logger.info("%s: Loading %d/%d %s", self.type, len(filtered_objs), total, element.mapping) @@ -225,8 +221,8 @@ def model_loader(self, model_name: str, model: SlurpitsyncModel) -> None: logger.info("%s: skipped syncing %d models", self.type, len(self.skipped)) def slurpit_obj_to_diffsync( - self, obj: dict[str, Any], mapping: SchemaMappingModel, model: SlurpitsyncModel - ) -> dict: + self, obj: dict[str, Any], mapping: SchemaMappingModel, model: type[SlurpitsyncModel] + ) -> dict | None: obj_id = obj.get("id") data: dict[str, Any] = {"local_id": str(obj_id)} @@ -287,8 +283,8 @@ class SlurpitsyncModel(DiffSyncModelMixin, DiffSyncModel): def create( cls, adapter: Adapter, - ids: Mapping[Any, Any], - attrs: Mapping[Any, Any], + ids: dict[Any, Any], + attrs: dict[Any, Any], ) -> Self | None: # TODO: To implement return super().create(adapter=adapter, ids=ids, attrs=attrs) diff --git a/infrahub_sync/adapters/utils.py b/infrahub_sync/adapters/utils.py index 6aefdbd..04ec179 100644 --- a/infrahub_sync/adapters/utils.py +++ b/infrahub_sync/adapters/utils.py @@ -12,8 +12,9 @@ def build_mapping(adapter: Adapter, reference: str, obj, field) -> str: object_class, modelname = adapter.store._get_object_class_and_model(model=reference) # Find the schema element matching the model name + # `config` is attached at runtime by SyncAdapter subclasses; not part of diffsync.Adapter. schema_element = next( - (element for element in adapter.config.schema_mapping if element.name == modelname), + (element for element in adapter.config.schema_mapping if element.name == modelname), # ty: ignore[unresolved-attribute] None, ) if not schema_element: @@ -30,7 +31,8 @@ def build_mapping(adapter: Adapter, reference: str, obj, field) -> str: field_dict = {field.name: field.mapping for field in schema_element.fields} # Loop through object_class._identifiers to find corresponding field mappings - for identifier in object_class._identifiers: + # `_identifiers` is a private ClassVar on DiffSyncModel subclasses, not exposed on the base. + for identifier in object_class._identifiers: # ty: ignore[unresolved-attribute] if identifier in field_dict: new_identifiers.append(field_dict[identifier]) diff --git a/pyproject.toml b/pyproject.toml index 1102f2f..735d8f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -310,21 +310,3 @@ exclude = ["examples/**"] [tool.ty.environment] python-version = "3.10" -[[tool.ty.overrides]] -include = ["infrahub_sync/adapters/**"] - -[tool.ty.overrides.rules] -################################################################################################## -# The ignored rules below should be removed once the code has been updated, they are included # -# like this so that we can reactivate them one by one. # -################################################################################################## -call-non-callable = "ignore" -invalid-argument-type = "ignore" -invalid-assignment = "ignore" -invalid-method-override = "ignore" -invalid-return-type = "ignore" -no-matching-overload = "ignore" -not-iterable = "ignore" -unresolved-attribute = "ignore" -unresolved-import = "ignore" - From 603d31d537e6873cf20398d3674facf2903bd0e1 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 15:06:08 +0200 Subject: [PATCH 14/20] ci(linter): add ty check as a blocking step in python-lint Codebase is clean under ty across 3.10/3.11/3.12/3.13 after T6's per-module fix loop. Promote `uv run ty check .` from local-only to a required CI step. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/workflow-linter.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml index ac95d25..f3c6245 100644 --- a/.github/workflows/workflow-linter.yml +++ b/.github/workflows/workflow-linter.yml @@ -84,6 +84,9 @@ jobs: - name: "Linting: ruff format" run: "uv run ruff format --check --diff ." + - name: "Linting: ty check" + run: "uv run ty check ." + # TODO: Need to cleanup code # - name: "Pylint Tests" # run: "uv run pylint infrahub_sync/**/*.py" From 2e8c3825c5714130dd37f9dc60c441b11a19d73f Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 15:11:25 +0200 Subject: [PATCH 15/20] chore(ty): remove mypy now that ty is the sole type checker Drop [tool.mypy], the mypy>=1.15 dev dep, the duplicate types-pyyaml stub (keeping canonical types-PyYAML>=6.0.12), and the 13 remaining # type: ignore[...] directives (deleted as obsolete or converted to # ty: ignore[] where ty still flags the line). Migration scratch file docs/superpowers/notes/ty-baseline.txt is also removed. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/superpowers/notes/ty-baseline.txt | 3087 ------------------------ infrahub_sync/adapters/aci.py | 25 +- infrahub_sync/adapters/prometheus.py | 2 +- infrahub_sync/generator/__init__.py | 2 +- pyproject.toml | 8 - tests/__init__.py | 2 +- uv.lock | 102 - 7 files changed, 14 insertions(+), 3214 deletions(-) delete mode 100644 docs/superpowers/notes/ty-baseline.txt diff --git a/docs/superpowers/notes/ty-baseline.txt b/docs/superpowers/notes/ty-baseline.txt deleted file mode 100644 index 7d5663e..0000000 --- a/docs/superpowers/notes/ty-baseline.txt +++ /dev/null @@ -1,3087 +0,0 @@ -warning[unsupported-base]: Unsupported class base - --> examples/aci_to_infrahub/aci/sync_models.py:26:26 - | -26 | class DcimPhysicalDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `DcimPhysicalDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/aci_to_infrahub/aci/sync_models.py:41:29 - | -41 | class DcimPhysicalInterface(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `DcimPhysicalInterface` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/aci_to_infrahub/aci/sync_models.py:53:24 - | -53 | class LocationBuilding(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationBuilding` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/aci_to_infrahub/aci/sync_models.py:65:21 - | -65 | class LocationMetro(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationMetro` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/aci_to_infrahub/aci/sync_models.py:76:28 - | -76 | class OrganizationCustomer(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationCustomer` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/aci_to_infrahub/infrahub/sync_models.py:26:26 - | -26 | class DcimPhysicalDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `DcimPhysicalDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/aci_to_infrahub/infrahub/sync_models.py:41:29 - | -41 | class DcimPhysicalInterface(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `DcimPhysicalInterface` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/aci_to_infrahub/infrahub/sync_models.py:53:24 - | -53 | class LocationBuilding(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationBuilding` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/aci_to_infrahub/infrahub/sync_models.py:65:21 - | -65 | class LocationMetro(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationMetro` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/aci_to_infrahub/infrahub/sync_models.py:76:28 - | -76 | class OrganizationCustomer(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationCustomer` due to this base -info: Only class objects or `Any` are supported as class bases - -error[unresolved-import]: Module `typing` has no member `Self` - --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:9:24 - | -9 | from typing import Self - | ^^^^ - | -info: The member may be available on other Python versions or platforms -info: Python 3.10 was assumed when resolving imports - --> pyproject.toml:308:18 - | -308 | python-version = "3.10" - | ^^^^^^ Python version configuration - | - -error[invalid-argument-type]: Argument to bound method `MockDBClient.get_all_nodes` is incorrect - --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:114:51 - | -114 | nodes = self.client.get_all_nodes(resource_name) - | ^^^^^^^^^^^^^ Expected `str`, found `str | None` - | -info: element `None` of union `str | None` is not assignable to `str` -info: Method defined here - --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:52:9 - | -52 | def get_all_nodes(self, model: str) -> list[dict[str, Any]]: - | ^^^^^^^^^^^^^ ---------- Parameter declared here - | - -error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` - --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:118:55 - | -118 | if self.config.source.name.title() == self.type.title(): - | ^^^^^^^^^^^^^^^ - | - -error[call-non-callable]: Object of type `MockdbModel` is not callable - --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:132:30 - | -132 | self.add(model(**data)) - | ^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` - --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:172:67 - | -172 | … matched = [ref for ref in all_refs if ref.local_id == str(ref_id)] - | ^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` - --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:180:67 - | -180 | … matched = [ref for ref in all_refs if ref.local_id == str(ref_id)] - | ^^^^^^^^^^^^ - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:198:48 - | -198 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ --------- Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> examples/custom_adapter/custom_adapter_src/custom_adapter.py:198:57 - | -198 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ ----------- Parameter declared here - | - -warning[unsupported-base]: Unsupported class base - --> examples/custom_adapter/infrahub/sync_models.py:26:19 - | -26 | class InfraDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/custom_adapter/mockdb/sync_models.py:26:19 - | -26 | class InfraDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/device42_to_infrahub/genericrestapi/sync_models.py:26:18 - | -26 | class BuiltinTag(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/device42_to_infrahub/genericrestapi/sync_models.py:36:20 - | -36 | class LocationSite(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationSite` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/device42_to_infrahub/genericrestapi/sync_models.py:47:26 - | -47 | class OrganizationTenant(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationTenant` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/device42_to_infrahub/infrahub/sync_models.py:26:18 - | -26 | class BuiltinTag(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/device42_to_infrahub/infrahub/sync_models.py:36:20 - | -36 | class LocationSite(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationSite` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/device42_to_infrahub/infrahub/sync_models.py:47:26 - | -47 | class OrganizationTenant(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationTenant` due to this base -info: Only class objects or `Any` are supported as class bases - -error[unresolved-import]: Cannot resolve imported module `.sync_models` - --> examples/infrahub_to_peering-manager/infrahub/sync_adapter.py:5:7 - | -5 | from .sync_models import ( - | ^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:26:29 - | -26 | class InfraAutonomousSystem(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:42:25 - | -42 | class InfraBGPPeerGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPPeerGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:57:25 - | -57 | class InfraBGPCommunity(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPCommunity` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:71:29 - | -71 | class InfraBGPRoutingPolicy(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPRoutingPolicy` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:87:16 - | -87 | class InfraIXP(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXP` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/infrahub/sync_models.py:102:26 - | -102 | class InfraIXPConnection(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXPConnection` due to this base -info: Only class objects or `Any` are supported as class bases - -error[unresolved-import]: Cannot resolve imported module `.sync_models` - --> examples/infrahub_to_peering-manager/peeringmanager/sync_adapter.py:5:7 - | -5 | from .sync_models import ( - | ^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:26:29 - | -26 | class InfraAutonomousSystem(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:42:25 - | -42 | class InfraBGPPeerGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPPeerGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:57:25 - | -57 | class InfraBGPCommunity(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPCommunity` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:71:29 - | -71 | class InfraBGPRoutingPolicy(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPRoutingPolicy` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:87:16 - | -87 | class InfraIXP(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXP` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/infrahub_to_peering-manager/peeringmanager/sync_models.py:102:26 - | -102 | class InfraIXPConnection(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXPConnection` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/librenms_to_infrahub/genericrestapi/sync_models.py:26:25 - | -26 | class CoreStandardGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/librenms_to_infrahub/genericrestapi/sync_models.py:37:19 - | -37 | class InfraDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/librenms_to_infrahub/genericrestapi/sync_models.py:49:21 - | -49 | class IpamIPAddress(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/librenms_to_infrahub/genericrestapi/sync_models.py:60:20 - | -60 | class LocationSite(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationSite` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/librenms_to_infrahub/infrahub/sync_models.py:26:25 - | -26 | class CoreStandardGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/librenms_to_infrahub/infrahub/sync_models.py:37:19 - | -37 | class InfraDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/librenms_to_infrahub/infrahub/sync_models.py:49:21 - | -49 | class IpamIPAddress(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/librenms_to_infrahub/infrahub/sync_models.py:60:20 - | -60 | class LocationSite(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationSite` due to this base -info: Only class objects or `Any` are supported as class bases - -error[unresolved-import]: Cannot resolve imported module `infrahub_sync.adapters.librenms` - --> examples/librenms_to_infrahub/librenms/sync_adapter.py:1:6 - | -1 | from infrahub_sync.adapters.librenms import LibrenmsAdapter - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-import]: Cannot resolve imported module `infrahub_sync.adapters.librenms` - --> examples/librenms_to_infrahub/librenms/sync_models.py:5:6 - | -5 | from infrahub_sync.adapters.librenms import LibrenmsModel - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-import]: Cannot resolve imported module `.sync_models` - --> examples/nautobot-v1_to_infrahub/infrahub/sync_adapter.py:3:7 - | -3 | from .sync_models import ( - | ^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-import]: Cannot resolve imported module `.sync_models` - --> examples/nautobot-v1_to_infrahub/nautobot/sync_adapter.py:3:7 - | -3 | from .sync_models import ( - | ^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-import]: Cannot resolve imported module `.sync_models` - --> examples/nautobot-v2_to_infrahub/infrahub/sync_adapter.py:5:7 - | -5 | from .sync_models import ( - | ^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:26:25 - | -26 | class CoreStandardGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:37:18 - | -37 | class BuiltinTag(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:48:29 - | -48 | class InfraAutonomousSystem(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:61:20 - | -61 | class InfraCircuit(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraCircuit` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:77:25 - | -77 | class ChoiceCircuitType(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceCircuitType` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:88:19 - | -88 | class InfraDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:108:24 - | -108 | class ChoiceDeviceType(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceDeviceType` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:123:22 - | -123 | class InfraFrontPort(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraFrontPort` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:137:26 - | -137 | class InfraInterfaceL2L3(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraInterfaceL2L3` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:166:22 - | -166 | class InfraIPAddress(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIPAddress` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:182:26 - | -182 | class ChoiceLocationType(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceLocationType` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:193:25 - | -193 | class NautobotNamespace(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `NautobotNamespace` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:204:21 - | -204 | class InfraPlatform(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPlatform` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:217:28 - | -217 | class InfraProviderNetwork(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraProviderNetwork` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:232:19 - | -232 | class InfraPrefix(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPrefix` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:249:17 - | -249 | class InfraRack(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRack` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:266:21 - | -266 | class InfraRearPort(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRearPort` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:279:24 - | -279 | class InfraRouteTarget(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRouteTarget` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:291:17 - | -291 | class InfraVLAN(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVLAN` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:308:16 - | -308 | class InfraVRF(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVRF` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:324:27 - | -324 | class OrganizationGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:337:21 - | -337 | class StatusGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `StatusGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:349:19 - | -349 | class RoleGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `RoleGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/infrahub/sync_models.py:361:23 - | -361 | class LocationGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -error[unresolved-import]: Cannot resolve imported module `.sync_models` - --> examples/nautobot-v2_to_infrahub/nautobot/sync_adapter.py:5:7 - | -5 | from .sync_models import ( - | ^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:26:25 - | -26 | class CoreStandardGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:37:18 - | -37 | class BuiltinTag(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:48:29 - | -48 | class InfraAutonomousSystem(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:61:20 - | -61 | class InfraCircuit(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraCircuit` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:77:25 - | -77 | class ChoiceCircuitType(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceCircuitType` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:88:19 - | -88 | class InfraDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:108:24 - | -108 | class ChoiceDeviceType(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceDeviceType` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:123:22 - | -123 | class InfraFrontPort(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraFrontPort` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:137:26 - | -137 | class InfraInterfaceL2L3(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraInterfaceL2L3` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:166:22 - | -166 | class InfraIPAddress(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIPAddress` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:182:26 - | -182 | class ChoiceLocationType(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceLocationType` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:193:25 - | -193 | class NautobotNamespace(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `NautobotNamespace` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:204:21 - | -204 | class InfraPlatform(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPlatform` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:217:28 - | -217 | class InfraProviderNetwork(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraProviderNetwork` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:232:19 - | -232 | class InfraPrefix(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPrefix` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:249:17 - | -249 | class InfraRack(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRack` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:266:21 - | -266 | class InfraRearPort(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRearPort` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:279:24 - | -279 | class InfraRouteTarget(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRouteTarget` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:291:17 - | -291 | class InfraVLAN(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVLAN` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:308:16 - | -308 | class InfraVRF(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVRF` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:324:27 - | -324 | class OrganizationGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:337:21 - | -337 | class StatusGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `StatusGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:349:19 - | -349 | class RoleGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `RoleGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/nautobot-v2_to_infrahub/nautobot/sync_models.py:361:23 - | -361 | class LocationGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:26:25 - | -26 | class CoreStandardGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:37:18 - | -37 | class BuiltinTag(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:48:25 - | -48 | class ChoiceCircuitType(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceCircuitType` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:60:24 - | -60 | class ChoiceDeviceType(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceDeviceType` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:75:20 - | -75 | class InfraCircuit(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraCircuit` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:90:19 - | -90 | class InfraDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:109:22 - | -109 | class InfraIPAddress(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIPAddress` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:122:26 - | -122 | class InfraInterfaceL2L3(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraInterfaceL2L3` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:141:19 - | -141 | class InfraPrefix(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPrefix` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:156:28 - | -156 | class InfraProviderNetwork(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraProviderNetwork` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:170:17 - | -170 | class InfraRack(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRack` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:187:24 - | -187 | class InfraRouteTarget(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRouteTarget` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:199:17 - | -199 | class InfraVLAN(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVLAN` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:214:16 - | -214 | class InfraVRF(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVRF` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:229:23 - | -229 | class LocationGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:244:27 - | -244 | class OrganizationGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/infrahub/sync_models.py:256:19 - | -256 | class RoleGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `RoleGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:26:25 - | -26 | class CoreStandardGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:37:18 - | -37 | class BuiltinTag(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `BuiltinTag` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:48:25 - | -48 | class ChoiceCircuitType(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceCircuitType` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:60:24 - | -60 | class ChoiceDeviceType(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `ChoiceDeviceType` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:75:20 - | -75 | class InfraCircuit(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraCircuit` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:90:19 - | -90 | class InfraDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:109:22 - | -109 | class InfraIPAddress(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIPAddress` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:122:26 - | -122 | class InfraInterfaceL2L3(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraInterfaceL2L3` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:141:19 - | -141 | class InfraPrefix(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraPrefix` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:156:28 - | -156 | class InfraProviderNetwork(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraProviderNetwork` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:170:17 - | -170 | class InfraRack(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRack` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:187:24 - | -187 | class InfraRouteTarget(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraRouteTarget` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:199:17 - | -199 | class InfraVLAN(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVLAN` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:214:16 - | -214 | class InfraVRF(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraVRF` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:229:23 - | -229 | class LocationGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `LocationGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:244:27 - | -244 | class OrganizationGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/netbox_to_infrahub/netbox/sync_models.py:256:19 - | -256 | class RoleGeneric(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `RoleGeneric` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/observium_to_infrahub/genericrestapi/sync_models.py:26:25 - | -26 | class CoreStandardGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/observium_to_infrahub/genericrestapi/sync_models.py:37:19 - | -37 | class InfraDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/observium_to_infrahub/genericrestapi/sync_models.py:51:21 - | -51 | class IpamIPAddress(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/observium_to_infrahub/infrahub/sync_models.py:26:25 - | -26 | class CoreStandardGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `CoreStandardGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/observium_to_infrahub/infrahub/sync_models.py:37:19 - | -37 | class InfraDevice(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraDevice` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/observium_to_infrahub/infrahub/sync_models.py:51:21 - | -51 | class IpamIPAddress(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base -info: Only class objects or `Any` are supported as class bases - -error[unresolved-import]: Cannot resolve imported module `infrahub_sync.adapters.observium` - --> examples/observium_to_infrahub/observium/sync_adapter.py:1:6 - | -1 | from infrahub_sync.adapters.observium import ObserviumAdapter - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-import]: Cannot resolve imported module `infrahub_sync.adapters.observium` - --> examples/observium_to_infrahub/observium/sync_models.py:5:6 - | -5 | from infrahub_sync.adapters.observium import ObserviumModel - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-import]: Cannot resolve imported module `.sync_models` - --> examples/peering-manager_to_infrahub/infrahub/sync_adapter.py:5:7 - | -5 | from .sync_models import ( - | ^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:26:21 - | -26 | class IpamIPAddress(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:37:28 - | -37 | class OrganizationProvider(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationProvider` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:47:29 - | -47 | class InfraAutonomousSystem(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:72:25 - | -72 | class InfraBGPPeerGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPPeerGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:87:25 - | -87 | class InfraBGPCommunity(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPCommunity` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:101:29 - | -101 | class InfraBGPRoutingPolicy(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPRoutingPolicy` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:117:16 - | -117 | class InfraIXP(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXP` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/infrahub/sync_models.py:132:26 - | -132 | class InfraIXPConnection(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXPConnection` due to this base -info: Only class objects or `Any` are supported as class bases - -error[unresolved-import]: Cannot resolve imported module `.sync_models` - --> examples/peering-manager_to_infrahub/peeringmanager/sync_adapter.py:5:7 - | -5 | from .sync_models import ( - | ^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:26:21 - | -26 | class IpamIPAddress(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `IpamIPAddress` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:37:28 - | -37 | class OrganizationProvider(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `OrganizationProvider` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:47:29 - | -47 | class InfraAutonomousSystem(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:72:25 - | -72 | class InfraBGPPeerGroup(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPPeerGroup` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:87:25 - | -87 | class InfraBGPCommunity(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPCommunity` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:101:29 - | -101 | class InfraBGPRoutingPolicy(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraBGPRoutingPolicy` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:117:16 - | -117 | class InfraIXP(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXP` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peering-manager_to_infrahub/peeringmanager/sync_models.py:132:26 - | -132 | class InfraIXPConnection(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraIXPConnection` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peeringdb_to_infrahub/genericrestapi/sync_models.py:26:29 - | -26 | class InfraAutonomousSystem(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base -info: Only class objects or `Any` are supported as class bases - -warning[unsupported-base]: Unsupported class base - --> examples/peeringdb_to_infrahub/infrahub/sync_models.py:26:29 - | -26 | class InfraAutonomousSystem(_ModelBaseClass): - | ^^^^^^^^^^^^^^^ Has type `type[Any] | ` - | -info: ty cannot resolve a consistent method resolution order (MRO) for class `InfraAutonomousSystem` due to this base -info: Only class objects or `Any` are supported as class bases - -error[unresolved-import]: Cannot resolve imported module `.sync_models` - --> examples/prometheus_to_infrahub (node_exporter)/infrahub/sync_adapter.py:3:7 - | -3 | from .sync_models import ( - | ^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-import]: Cannot resolve imported module `.sync_models` - --> examples/prometheus_to_infrahub (node_exporter)/prometheus/sync_adapter.py:3:7 - | -3 | from .sync_models import ( - | ^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -warning[deprecated]: The function `validator` is deprecated - --> infrahub_sync/__init__.py:26:26 - | -26 | from pydantic import validator as validator_decorator - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details - | - -error[no-matching-overload]: No overload of function `field_validator` matches arguments - --> infrahub_sync/__init__.py:79:6 - | -79 | @validator_decorator("diffsync_flags", **validator_kwargs) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: First overload defined here - --> .venv/lib/python3.11/site-packages/pydantic/functional_validators.py:379:5 - | -379 | def field_validator( - | _____^ -380 | | field: str, -381 | | /, -382 | | *fields: str, -383 | | mode: Literal['wrap'], -384 | | check_fields: bool | None = ..., -385 | | json_schema_input_type: Any = ..., -386 | | ) -> Callable[[_V2WrapValidatorType], _V2WrapValidatorType]: ... - | |___________________________________________________________^ - | -info: Possible overloads for function `field_validator`: -info: (field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return) -info: (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return) -info: (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return) -info: Overload implementation defined here - --> .venv/lib/python3.11/site-packages/pydantic/functional_validators.py:410:5 - | -410 | def field_validator( - | _____^ -411 | | field: str, -412 | | /, -413 | | *fields: str, -414 | | mode: FieldValidatorModes = 'after', -415 | | check_fields: bool | None = None, -416 | | json_schema_input_type: Any = PydanticUndefined, -417 | | ) -> Callable[[Any], Any]: - | |_________________________^ - | -info: Union variant `Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]` is incompatible with this call site -info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` - -error[invalid-argument-type]: Argument to function `validator` is incorrect - --> infrahub_sync/__init__.py:79:44 - | -79 | @validator_decorator("diffsync_flags", **validator_kwargs) - | ^^^^^^^^^^^^^^^^^^ Expected `bool`, found `str | bool` - | -info: element `str` of union `str | bool` is not assignable to `bool` -info: Function defined here - --> .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:82:5 - | -82 | def validator( - | ^^^^^^^^^ -83 | __field: str, -84 | *fields: str, -85 | pre: bool = False, - | ----------------- Parameter declared here - | -info: Union variant `def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return)` is incompatible with this call site -info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` - -error[invalid-argument-type]: Argument to function `validator` is incorrect - --> infrahub_sync/__init__.py:79:44 - | -79 | @validator_decorator("diffsync_flags", **validator_kwargs) - | ^^^^^^^^^^^^^^^^^^ Expected `bool`, found `str | bool` - | -info: element `str` of union `str | bool` is not assignable to `bool` -info: Function defined here - --> .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:82:5 - | -82 | def validator( - | ^^^^^^^^^ -83 | __field: str, -84 | *fields: str, -85 | pre: bool = False, -86 | each_item: bool = False, - | ----------------------- Parameter declared here - | -info: Union variant `def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return)` is incompatible with this call site -info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` - -error[invalid-argument-type]: Argument to function `validator` is incorrect - --> infrahub_sync/__init__.py:79:44 - | -79 | @validator_decorator("diffsync_flags", **validator_kwargs) - | ^^^^^^^^^^^^^^^^^^ Expected `bool`, found `str | bool` - | -info: element `str` of union `str | bool` is not assignable to `bool` -info: Function defined here - --> .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:82:5 - | -82 | def validator( - | ^^^^^^^^^ -83 | __field: str, -84 | *fields: str, -85 | pre: bool = False, -86 | each_item: bool = False, -87 | always: bool = False, - | -------------------- Parameter declared here - | -info: Union variant `def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return)` is incompatible with this call site -info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` - -error[invalid-argument-type]: Argument to function `validator` is incorrect - --> infrahub_sync/__init__.py:79:44 - | -79 | @validator_decorator("diffsync_flags", **validator_kwargs) - | ^^^^^^^^^^^^^^^^^^ Expected `bool | None`, found `str | bool` - | -info: element `str` of union `str | bool` is not assignable to `bool | None` -info: Function defined here - --> .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:82:5 - | -82 | def validator( - | ^^^^^^^^^ - | - ::: .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:88:5 - | -88 | check_fields: bool | None = None, - | -------------------------------- Parameter declared here - | -info: Union variant `def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return)` is incompatible with this call site -info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` - -error[invalid-argument-type]: Argument to function `validator` is incorrect - --> infrahub_sync/__init__.py:79:44 - | -79 | @validator_decorator("diffsync_flags", **validator_kwargs) - | ^^^^^^^^^^^^^^^^^^ Expected `bool`, found `str | bool` - | -info: element `str` of union `str | bool` is not assignable to `bool` -info: Function defined here - --> .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:82:5 - | -82 | def validator( - | ^^^^^^^^^ - | - ::: .venv/lib/python3.11/site-packages/pydantic/deprecated/class_validators.py:89:5 - | -89 | allow_reuse: bool = False, - | ------------------------- Parameter declared here - | -info: Union variant `def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return)` is incompatible with this call site -info: Attempted to call union type `(Overload[(field: str, /, *fields: str, *, mode: Literal["wrap"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2WrapValidatorType'return](_V2WrapValidatorType'return, /) -> _V2WrapValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["before", "plain"], check_fields: bool | None = ..., json_schema_input_type: Any = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return), (field: str, /, *fields: str, *, mode: Literal["after"] = ..., check_fields: bool | None = ...) -> ([_V2BeforeAfterOrPlainValidatorType'return](_V2BeforeAfterOrPlainValidatorType'return, /) -> _V2BeforeAfterOrPlainValidatorType'return)]) | (def validator(__field: str, /, *fields: str, *, pre: bool = False, each_item: bool = False, always: bool = False, check_fields: bool | None = None, allow_reuse: bool = False) -> ((_V1ValidatorType'return, /) -> _V1ValidatorType'return))` - -error[unresolved-attribute]: Object of type `Self@load` has no attribute `top_level` - --> infrahub_sync/__init__.py:136:21 - | -136 | for item in self.top_level: - | ^^^^^^^^^^^^^^ - | - -error[missing-argument]: No argument provided for required parameter `b` - --> infrahub_sync/__init__.py:159:20 - | -159 | return operation_func(field_value) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: Union variant `(a: object, b: object, /) -> Any` is incompatible with this call site -info: Attempted to call union type `((a: object, b: object, /) -> Any) | ((field, value) -> Unknown | bool) | ((field) -> bool | Unknown) | ((field, pattern) -> bool)` - -error[missing-argument]: No argument provided for required parameter `value` - --> infrahub_sync/__init__.py:159:20 - | -159 | return operation_func(field_value) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: Union variant `(field, value) -> Unknown | bool` is incompatible with this call site -info: Attempted to call union type `((a: object, b: object, /) -> Any) | ((field, value) -> Unknown | bool) | ((field) -> bool | Unknown) | ((field, pattern) -> bool)` - -error[missing-argument]: No argument provided for required parameter `pattern` - --> infrahub_sync/__init__.py:159:20 - | -159 | return operation_func(field_value) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: Union variant `(field, pattern) -> bool` is incompatible with this call site -info: Attempted to call union type `((a: object, b: object, /) -> Any) | ((field, value) -> Unknown | bool) | ((field) -> bool | Unknown) | ((field, pattern) -> bool)` - -error[too-many-positional-arguments]: Too many positional arguments: expected 1, got 2 - --> infrahub_sync/__init__.py:161:44 - | -161 | return operation_func(field_value, value) - | ^^^^^ - | -info: Union variant `(field) -> bool | Unknown` is incompatible with this call site -info: Attempted to call union type `((a: object, b: object, /) -> Any) | ((field, value) -> Unknown | bool) | ((field) -> bool | Unknown) | ((field, pattern) -> bool)` - -error[call-non-callable]: Object of type `object` is not callable - --> infrahub_sync/__init__.py:194:17 - | -194 | cls._add_custom_filters(native_env, item) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[invalid-return-type]: Return type does not match returned value - --> infrahub_sync/__init__.py:249:77 - | -249 | def get_resource_name(cls, schema_mapping: list[SchemaMappingModel]) -> str: - | --- Expected `str` because of return type -250 | """Get the resource name from the schema mapping.""" -251 | for element in schema_mapping: -252 | if element.name == cls.__name__: -253 | return element.mapping - | ^^^^^^^^^^^^^^^ expected `str`, found `str | None` - | - -error[unresolved-attribute]: Object of type `type[Self@is_list]` has no attribute `__fields__` - --> infrahub_sync/__init__.py:259:17 - | -259 | field = cls.__fields__.get(name) - | ^^^^^^^^^^^^^^ - | - -error[unresolved-import]: Module `typing` has no member `Self` - --> infrahub_sync/adapters/genericrestapi.py:7:24 - | -7 | from typing import Self - | ^^^^ - | -info: The member may be available on other Python versions or platforms -info: Python 3.10 was assumed when resolving imports - --> pyproject.toml:308:18 - | -308 | python-version = "3.10" - | ^^^^^^ Python version configuration - | - -error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` - --> infrahub_sync/adapters/genericrestapi.py:168:51 - | -168 | if self.config.source.name.title() == self.type.title(): - | ^^^^^^^^^^^^^^^ - | - -error[call-non-callable]: Object of type `GenericrestapiModel` is not callable - --> infrahub_sync/adapters/genericrestapi.py:181:24 - | -181 | item = model(**data) - | ^^^^^^^^^^^^^ - | - -error[invalid-return-type]: Return type does not match returned value - --> infrahub_sync/adapters/genericrestapi.py:217:16 - | -217 | return objs - | ^^^^ expected `list[dict[str, Any]]`, found `(Unknown & Top[list[Unknown]]) | list[object] | list[Unknown]` - | - ::: infrahub_sync/adapters/genericrestapi.py:189:10 - | -189 | ) -> list[dict[str, Any]]: - | -------------------- Expected `list[dict[str, Any]]` because of return type - | - -error[unresolved-attribute]: Object of type `GenericrestapiModel` has no attribute `__name__` - --> infrahub_sync/adapters/genericrestapi.py:230:68 - | -230 | msg = f"No fields defined in schema mapping for model {model.__name__}" - | ^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` - --> infrahub_sync/adapters/genericrestapi.py:260:73 - | -260 | … matching_nodes = [item for item in nodes if item.local_id == str(node_id)] - | ^^^^^^^^^^^^^ - | - -error[not-iterable]: Object of type `Any | None` may not be iterable - --> infrahub_sync/adapters/genericrestapi.py:272:33 - | -272 | for node in get_value(obj, field.mapping): - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: It may not have an `__iter__` method or a `__getitem__` method - -error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` - --> infrahub_sync/adapters/genericrestapi.py:280:69 - | -280 | matching_nodes = [item for item in nodes if item.local_id == str(node_id)] - | ^^^^^^^^^^^^^ - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/genericrestapi.py:303:48 - | -303 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ --------- Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/genericrestapi.py:303:57 - | -303 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ ----------- Parameter declared here - | - -error[unresolved-import]: Module `typing` has no member `Self` - --> infrahub_sync/adapters/infrahub.py:12:24 - | -12 | from typing import Self - | ^^^^ - | -info: The member may be available on other Python versions or platforms -info: Python 3.10 was assumed when resolving imports - --> pyproject.toml:308:18 - | -308 | python-version = "3.10" - | ^^^^^^ Python version configuration - | - -error[unresolved-attribute]: Attribute `get` is not defined on `None` in union `InfrahubClientSync | None` - --> infrahub_sync/adapters/infrahub.py:89:21 - | -89 | peer_node = client.get(id=key, kind=rel_schema.peer, populate_store=True) - | ^^^^^^^^^^ - | - -error[invalid-assignment]: Object of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` - --> infrahub_sync/adapters/infrahub.py:125:30 - | -125 | peer_schema: MainSchemaTypesAPI = schemas.get(rel_schema.peer) - | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible value of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` - | | - | Declared type - | -info: element `None` of union `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` - -error[unresolved-attribute]: Object of type `NodeSchema` has no attribute `relationship_names` - --> infrahub_sync/adapters/infrahub.py:194:19 - | -194 | if key in node_schema.relationship_names: - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[invalid-assignment]: Object of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` - --> infrahub_sync/adapters/infrahub.py:196:30 - | -196 | peer_schema: MainSchemaTypesAPI = schemas.get(rel_schema.peer) - | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible value of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` - | | - | Declared type - | -info: element `None` of union `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` - -error[invalid-argument-type]: Argument to function `resolve_peer_node` is incorrect - --> infrahub_sync/adapters/infrahub.py:206:25 - | -206 | rel_schema=rel_schema, - | ^^^^^^^^^^^^^^^^^^^^^ Expected `RelationshipSchemaAPI`, found `RelationshipSchema` - | -info: Function defined here - --> infrahub_sync/adapters/infrahub.py:55:5 - | -55 | def resolve_peer_node( - | ^^^^^^^^^^^^^^^^^ -56 | key: str, -57 | rel_schema: RelationshipSchemaAPI, - | --------------------------------- Parameter declared here - | - -error[invalid-argument-type]: Argument to function `resolve_peer_node` is incorrect - --> infrahub_sync/adapters/infrahub.py:223:29 - | -223 | … rel_schema=rel_schema, - | ^^^^^^^^^^^^^^^^^^^^^ Expected `RelationshipSchemaAPI`, found `RelationshipSchema` - | -info: Function defined here - --> infrahub_sync/adapters/infrahub.py:55:5 - | -55 | def resolve_peer_node( - | ^^^^^^^^^^^^^^^^^ -56 | key: str, -57 | rel_schema: RelationshipSchemaAPI, - | --------------------------------- Parameter declared here - | - -error[no-matching-overload]: No overload of bound method `InfrahubClientSync.all` matches arguments - --> infrahub_sync/adapters/infrahub.py:313:21 - | -313 | nodes = self.client.all(kind=model_name, include=model._attributes, populate_store=True) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: First overload defined here - --> .venv/lib/python3.11/site-packages/infrahub_sdk/client.py:1962:9 - | -1962 | def all( - | _________^ -1963 | | self, -1964 | | kind: type[SchemaTypeSync], -1965 | | at: Timestamp | None = ..., -1966 | | branch: str | None = ..., -1967 | | timeout: int | None = ..., -1968 | | populate_store: bool = ..., -1969 | | offset: int | None = ..., -1970 | | limit: int | None = ..., -1971 | | include: list[str] | None = ..., -1972 | | exclude: list[str] | None = ..., -1973 | | fragment: bool = ..., -1974 | | prefetch_relationships: bool = ..., -1975 | | property: bool = ..., -1976 | | parallel: bool = ..., -1977 | | order: Order | None = ..., -1978 | | include_metadata: bool = ..., -1979 | | ) -> list[SchemaTypeSync]: ... - | |_____________________________^ - | -info: Possible overloads for bound method `all`: -info: [SchemaTypeSync](self, kind: type[SchemaTypeSync], at: Timestamp | None = ..., branch: str | None = ..., timeout: int | None = ..., populate_store: bool = ..., offset: int | None = ..., limit: int | None = ..., include: list[str] | None = ..., exclude: list[str] | None = ..., fragment: bool = ..., prefetch_relationships: bool = ..., property: bool = ..., parallel: bool = ..., order: Order | None = ..., include_metadata: bool = ...) -> list[SchemaTypeSync] -info: (self, kind: str, at: Timestamp | None = ..., branch: str | None = ..., timeout: int | None = ..., populate_store: bool = ..., offset: int | None = ..., limit: int | None = ..., include: list[str] | None = ..., exclude: list[str] | None = ..., fragment: bool = ..., prefetch_relationships: bool = ..., property: bool = ..., parallel: bool = ..., order: Order | None = ..., include_metadata: bool = ...) -> list[InfrahubNodeSync] -info: Overload implementation defined here - --> .venv/lib/python3.11/site-packages/infrahub_sdk/client.py:2001:9 - | -2001 | def all( - | _________^ -2002 | | self, -2003 | | kind: str | type[SchemaTypeSync], -2004 | | at: Timestamp | None = None, -2005 | | branch: str | None = None, -2006 | | timeout: int | None = None, -2007 | | populate_store: bool = True, -2008 | | offset: int | None = None, -2009 | | limit: int | None = None, -2010 | | include: list[str] | None = None, -2011 | | exclude: list[str] | None = None, -2012 | | fragment: bool = False, -2013 | | prefetch_relationships: bool = False, -2014 | | property: bool = False, -2015 | | parallel: bool = False, -2016 | | order: Order | None = None, -2017 | | include_metadata: bool = False, -2018 | | ) -> list[InfrahubNodeSync] | list[SchemaTypeSync]: - | |______________________________________________________^ - | - -error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` - --> infrahub_sync/adapters/infrahub.py:322:51 - | -322 | if self.config.source.name.title() == self.type.title(): - | ^^^^^^^^^^^^^^^ - | - -error[call-non-callable]: Object of type `InfrahubModel` is not callable - --> infrahub_sync/adapters/infrahub.py:335:24 - | -335 | item = model(**transformed_obj) - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[invalid-assignment]: Object of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` - --> infrahub_sync/adapters/infrahub.py:364:26 - | -364 | peer_schema: MainSchemaTypesAPI = self.schema.get(rel_schema.peer) - | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible value of type `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` - | | - | Declared type - | -info: element `None` of union `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI | None` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` - -error[invalid-method-override]: Invalid override of method `create` - --> infrahub_sync/adapters/infrahub.py:450:9 - | -450 | def create( - | _________^ -451 | | cls, -452 | | adapter: InfrahubAdapter, -453 | | ids: Mapping[Any, Any], -454 | | attrs: Mapping[Any, Any], -455 | | ) -> Self | None: - | |____________________^ Definition is incompatible with `DiffSyncModel.create` - | - ::: .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ------------------------------------------------------------------------- `DiffSyncModel.create` defined here - | -info: parameter `adapter` has an incompatible type: `Adapter` is not assignable to `InfrahubAdapter` -info: This violates the Liskov Substitution Principle - -error[invalid-argument-type]: Argument to function `diffsync_to_infrahub` is incorrect - --> infrahub_sync/adapters/infrahub.py:458:35 - | -458 | ids=ids, attrs=attrs, node_schema=node_schema, store=adapter.client.store, schemas=adapter.schema - | ^^^^^^^^^^^^^^^^^^^^^^^ Expected `NodeSchema`, found `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` - | -info: element `NodeSchemaAPI` of union `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` is not assignable to `NodeSchema` -info: Function defined here - --> infrahub_sync/adapters/infrahub.py:178:5 - | -178 | def diffsync_to_infrahub( - | ^^^^^^^^^^^^^^^^^^^^ -179 | ids: Mapping[Any, Any], -180 | attrs: Mapping[Any, Any], -181 | store: NodeStoreSync, -182 | node_schema: NodeSchema, - | ----------------------- Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/infrahub.py:470:48 - | -470 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ --------- Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/infrahub.py:470:57 - | -470 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ ----------- Parameter declared here - | - -error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `client` - --> infrahub_sync/adapters/infrahub.py:473:16 - | -473 | node = self.adapter.client.get(id=self.local_id, kind=self.__class__.__name__) - | ^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `Self@update` has no attribute `local_id` - --> infrahub_sync/adapters/infrahub.py:473:43 - | -473 | node = self.adapter.client.get(id=self.local_id, kind=self.__class__.__name__) - | ^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `source_node` - --> infrahub_sync/adapters/infrahub.py:474:21 - | -474 | source_id = self.adapter.source_node.id if self.adapter.source_node else None - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `source_node` - --> infrahub_sync/adapters/infrahub.py:474:52 - | -474 | source_id = self.adapter.source_node.id if self.adapter.source_node else None - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `owner_node` - --> infrahub_sync/adapters/infrahub.py:475:20 - | -475 | owner_id = self.adapter.owner_node.id if self.adapter.owner_node else None - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `owner_node` - --> infrahub_sync/adapters/infrahub.py:475:50 - | -475 | owner_id = self.adapter.owner_node.id if self.adapter.owner_node else None - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-import]: Module `typing` has no member `Self` - --> infrahub_sync/adapters/ipfabricsync.py:9:24 - | -9 | from typing import Self - | ^^^^ - | -info: The member may be available on other Python versions or platforms -info: Python 3.10 was assumed when resolving imports - --> pyproject.toml:308:18 - | -308 | python-version = "3.10" - | ^^^^^^ Python version configuration - | - -error[unresolved-import]: Cannot resolve imported module `ipfabric` - --> infrahub_sync/adapters/ipfabricsync.py:27:10 - | -27 | from ipfabric import IPFClient - | ^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` - --> infrahub_sync/adapters/ipfabricsync.py:87:51 - | -87 | if self.config.source.name.title() == self.type.title(): - | ^^^^^^^^^^^^^^^ - | - -error[call-non-callable]: Object of type `IpfabricsyncModel` is not callable - --> infrahub_sync/adapters/ipfabricsync.py:99:24 - | -99 | item = model(**data) - | ^^^^^^^^^^^^^ - | - -error[not-iterable]: Object of type `list[SchemaMappingField] | None` may not be iterable - --> infrahub_sync/adapters/ipfabricsync.py:105:22 - | -105 | for field in mapping.fields: # pylint: disable=too-many-nested-blocks - | ^^^^^^^^^^^^^^ - | -info: It may not have an `__iter__` method or a `__getitem__` method - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/ipfabricsync.py:170:48 - | -170 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ --------- Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/ipfabricsync.py:170:57 - | -170 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ ----------- Parameter declared here - | - -error[unresolved-import]: Module `typing` has no member `Self` - --> infrahub_sync/adapters/nautobot.py:9:24 - | -9 | from typing import Self - | ^^^^ - | -info: The member may be available on other Python versions or platforms -info: Python 3.10 was assumed when resolving imports - --> pyproject.toml:308:18 - | -308 | python-version = "3.10" - | ^^^^^^ Python version configuration - | - -error[unresolved-import]: Cannot resolve imported module `pynautobot` - --> infrahub_sync/adapters/nautobot.py:13:8 - | -13 | import pynautobot - | ^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` - --> infrahub_sync/adapters/nautobot.py:85:51 - | -85 | if self.config.source.name.title() == self.type.title(): - | ^^^^^^^^^^^^^^^ - | - -error[call-non-callable]: Object of type `NautobotModel` is not callable - --> infrahub_sync/adapters/nautobot.py:98:24 - | -98 | item = model(**data) - | ^^^^^^^^^^^^^ - | - -error[not-iterable]: Object of type `list[SchemaMappingField] | None` may not be iterable - --> infrahub_sync/adapters/nautobot.py:105:22 - | -105 | for field in mapping.fields: # pylint: disable=too-many-nested-blocks - | ^^^^^^^^^^^^^^ - | -info: It may not have an `__iter__` method or a `__getitem__` method - -error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` - --> infrahub_sync/adapters/nautobot.py:132:73 - | -132 | … matching_nodes = [item for item in nodes if item.local_id == str(node_id)] - | ^^^^^^^^^^^^^ - | - -error[not-iterable]: Object of type `Any | None` may not be iterable - --> infrahub_sync/adapters/nautobot.py:142:33 - | -142 | for node in get_value(obj, field.mapping): - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: It may not have an `__iter__` method or a `__getitem__` method - -error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` - --> infrahub_sync/adapters/nautobot.py:150:69 - | -150 | matching_nodes = [item for item in nodes if item.local_id == str(node_id)] - | ^^^^^^^^^^^^^ - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/nautobot.py:170:48 - | -170 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ --------- Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/nautobot.py:170:57 - | -170 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ ----------- Parameter declared here - | - -error[unresolved-import]: Module `typing` has no member `Self` - --> infrahub_sync/adapters/netbox.py:11:24 - | -11 | from typing import Self - | ^^^^ - | -info: The member may be available on other Python versions or platforms -info: Python 3.10 was assumed when resolving imports - --> pyproject.toml:308:18 - | -308 | python-version = "3.10" - | ^^^^^^ Python version configuration - | - -error[unresolved-import]: Cannot resolve imported module `pynetbox` - --> infrahub_sync/adapters/netbox.py:14:8 - | -14 | import pynetbox - | ^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` - --> infrahub_sync/adapters/netbox.py:89:51 - | -89 | if self.config.source.name.title() == self.type.title(): - | ^^^^^^^^^^^^^^^ - | - -error[call-non-callable]: Object of type `NetboxModel` is not callable - --> infrahub_sync/adapters/netbox.py:102:24 - | -102 | item = model(**data) - | ^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` - --> infrahub_sync/adapters/netbox.py:137:73 - | -137 | … matching_nodes = [item for item in nodes if item.local_id == str(node_id)] - | ^^^^^^^^^^^^^ - | - -error[not-iterable]: Object of type `Any | None` may not be iterable - --> infrahub_sync/adapters/netbox.py:147:33 - | -147 | for node in get_value(obj, field.mapping): - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: It may not have an `__iter__` method or a `__getitem__` method - -error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` - --> infrahub_sync/adapters/netbox.py:155:69 - | -155 | matching_nodes = [item for item in nodes if item.local_id == str(node_id)] - | ^^^^^^^^^^^^^ - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/netbox.py:174:48 - | -174 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ --------- Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/netbox.py:174:57 - | -174 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ ----------- Parameter declared here - | - -error[unresolved-import]: Module `typing` has no member `Self` - --> infrahub_sync/adapters/peeringmanager.py:6:24 - | -6 | from typing import Self - | ^^^^ - | -info: The member may be available on other Python versions or platforms -info: Python 3.10 was assumed when resolving imports - --> pyproject.toml:308:18 - | -308 | python-version = "3.10" - | ^^^^^^ Python version configuration - | - -error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `config` - --> infrahub_sync/adapters/peeringmanager.py:72:73 - | -72 | resource_name = self.__class__.get_resource_name(schema_mapping=self.adapter.config.schema_mapping) - | ^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `config` - --> infrahub_sync/adapters/peeringmanager.py:80:22 - | -80 | for field in self.adapter.config.schema_mapping: - | ^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `store` is not defined on `None` in union `Adapter | None` - --> infrahub_sync/adapters/peeringmanager.py:90:55 - | -90 | … all_nodes_for_reference = self.adapter.store.get_all(model=field_mapping.reference) - | ^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `DiffSyncModel` has no attribute `local_id` - --> infrahub_sync/adapters/peeringmanager.py:97:68 - | -97 | … mapped_attrs[target_field_name] = [node.local_id for node in filtered_nodes] - | ^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `DiffSyncModel & ~AlwaysFalsy` has no attribute `local_id` - --> infrahub_sync/adapters/peeringmanager.py:105:71 - | -105 | … mapped_attrs[target_field_name] = filtered_node.local_id - | ^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Object of type `Adapter | None` has no attribute `client` - --> infrahub_sync/adapters/peeringmanager.py:111:13 - | -111 | self.adapter.client.patch(endpoint, data=mapped_attrs) - | ^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-import]: Cannot resolve imported module `prometheus_client.parser` - --> infrahub_sync/adapters/prometheus.py:8:6 - | -8 | from prometheus_client.parser import text_string_to_metric_families - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-import]: Module `typing` has no member `Self` - --> infrahub_sync/adapters/prometheus.py:11:24 - | -11 | from typing import Self - | ^^^^ - | -info: The member may be available on other Python versions or platforms -info: Python 3.10 was assumed when resolving imports - --> pyproject.toml:308:18 - | -308 | python-version = "3.10" - | ^^^^^^ Python version configuration - | - -error[invalid-argument-type]: Argument to `LookupResolver.__init__` is incorrect - --> infrahub_sync/adapters/prometheus.py:464:39 - | -464 | self._lookup = LookupResolver(samples_by_metric=self._samples_by_metric) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `dict[str, list[dict[str, Any]]]`, found `dict[str, list[dict[Unknown, Unknown]]] | None | dict[str, list[dict[str, Any]]]` - | -info: element `None` of union `dict[str, list[dict[Unknown, Unknown]]] | None | dict[str, list[dict[str, Any]]]` is not assignable to `dict[str, list[dict[str, Any]]]` -info: Method defined here - --> infrahub_sync/adapters/prometheus.py:264:9 - | -264 | def __init__(self, samples_by_metric: dict[str, list[dict[str, Any]]]) -> None: - | ^^^^^^^^ -------------------------------------------------- Parameter declared here - | - -error[invalid-return-type]: Return type does not match returned value - --> infrahub_sync/adapters/prometheus.py:465:16 - | -465 | return self._samples_by_metric - | ^^^^^^^^^^^^^^^^^^^^^^^ expected `dict[str, list[dict[str, Any]]]`, found `dict[str, list[dict[Unknown, Unknown]]] | None | dict[str, list[dict[str, Any]]]` - | - ::: infrahub_sync/adapters/prometheus.py:436:34 - | -436 | def _ensure_samples(self) -> dict[str, list[dict[str, Any]]]: - | ------------------------------- Expected `dict[str, list[dict[str, Any]]]` because of return type - | - -error[unresolved-attribute]: Attribute `resolve_fn` is not defined on `None` in union `LookupResolver | None` - --> infrahub_sync/adapters/prometheus.py:490:86 - | -490 | return lambda metric, key_or_path, value_path, default=None: self._lookup.resolve_fn( - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` - --> infrahub_sync/adapters/prometheus.py:496:51 - | -496 | if self.config.source.name.title() == self.type.title(): - | ^^^^^^^^^^^^^^^ - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/prometheus.py:563:48 - | -563 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ --------- Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/prometheus.py:563:57 - | -563 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ ----------- Parameter declared here - | - -error[unresolved-import]: Module `typing` has no member `Self` - --> infrahub_sync/adapters/slurpitsync.py:9:24 - | -9 | from typing import Self - | ^^^^ - | -info: The member may be available on other Python versions or platforms -info: Python 3.10 was assumed when resolving imports - --> pyproject.toml:308:18 - | -308 | python-version = "3.10" - | ^^^^^^ Python version configuration - | - -error[unresolved-import]: Cannot resolve imported module `slurpit` - --> infrahub_sync/adapters/slurpitsync.py:13:8 - | -13 | import slurpit - | ^^^^^^^ - | -info: Searched in the following paths during module resolution: -info: 1. /Users/bkohler/automation/opsmill/infrahub-sync (first-party code) -info: 2. vendored://stdlib (stdlib typeshed stubs vendored by ty) -info: 3. /Users/bkohler/automation/opsmill/infrahub-sync/.venv/lib/python3.11/site-packages (site-packages) -info: make sure your Python environment is properly configured: https://docs.astral.sh/ty/modules/#python-environment - -error[unresolved-attribute]: Attribute `title` is not defined on `None` in union `str | None` - --> infrahub_sync/adapters/slurpitsync.py:206:51 - | -206 | if self.config.source.name.title() == self.type.title(): - | ^^^^^^^^^^^^^^^ - | - -error[call-non-callable]: Object of type `SlurpitsyncModel` is not callable - --> infrahub_sync/adapters/slurpitsync.py:218:28 - | -218 | item = model(**data) - | ^^^^^^^^^^^^^ - | - -error[not-iterable]: Object of type `list[SchemaMappingField] | None` may not be iterable - --> infrahub_sync/adapters/slurpitsync.py:233:22 - | -233 | for field in mapping.fields: - | ^^^^^^^^^^^^^^ - | -info: It may not have an `__iter__` method or a `__getitem__` method - -error[invalid-return-type]: Return type does not match returned value - --> infrahub_sync/adapters/slurpitsync.py:265:36 - | -265 | … return None - | ^^^^ expected `dict[Unknown, Unknown]`, found `None` - | - ::: infrahub_sync/adapters/slurpitsync.py:229:10 - | -229 | ) -> dict: - | ---- Expected `dict[Unknown, Unknown]` because of return type - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/slurpitsync.py:294:48 - | -294 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ --------- Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `DiffSyncModel.create` is incorrect - --> infrahub_sync/adapters/slurpitsync.py:294:57 - | -294 | return super().create(adapter=adapter, ids=ids, attrs=attrs) - | ^^^^^^^^^^^ Expected `dict[Unknown, Unknown]`, found `Mapping[Any, Any]` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/diffsync/__init__.py:227:9 - | -227 | def create(cls, adapter: "Adapter", ids: Dict, attrs: Dict) -> Optional[Self]: - | ^^^^^^ ----------- Parameter declared here - | - -error[unresolved-attribute]: Object of type `Adapter` has no attribute `config` - --> infrahub_sync/adapters/utils.py:16:33 - | -16 | (element for element in adapter.config.schema_mapping if element.name == modelname), - | ^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `_identifiers` is not defined on `None` in union `DiffSyncModel | type[DiffSyncModel] | None` - --> infrahub_sync/adapters/utils.py:33:23 - | -33 | for identifier in object_class._identifiers: - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:98:12 - | -98 | if sync_instance.adapters_path: - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:99:13 - | -99 | sync_instance.adapters_path.extend(adapter_path) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[invalid-assignment]: Object of type `list[str]` is not assignable to attribute `adapters_path` on type `SyncInstance | None` - --> infrahub_sync/cli.py:101:13 - | -101 | sync_instance.adapters_path = adapter_path - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[invalid-argument-type]: Argument to function `get_potenda_from_instance` is incorrect - --> infrahub_sync/cli.py:106:13 - | -106 | sync_instance=sync_instance, branch=branch, show_progress=show_progress, verbosity=verbosity_level - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `SyncInstance`, found `SyncInstance | None` - | -info: element `None` of union `SyncInstance | None` is not assignable to `SyncInstance` -info: Function defined here - --> infrahub_sync/utils.py:170:5 - | -170 | def get_potenda_from_instance( - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -171 | sync_instance: SyncInstance, - | --------------------------- Parameter declared here - | - -error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:148:12 - | -148 | if sync_instance.adapters_path: - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:149:13 - | -149 | sync_instance.adapters_path.extend(adapter_path) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[invalid-assignment]: Object of type `list[str]` is not assignable to attribute `adapters_path` on type `SyncInstance | None` - --> infrahub_sync/cli.py:151:13 - | -151 | sync_instance.adapters_path = adapter_path - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[invalid-argument-type]: Argument to function `get_potenda_from_instance` is incorrect - --> infrahub_sync/cli.py:156:13 - | -156 | sync_instance=sync_instance, branch=branch, show_progress=show_progress, verbosity=verbosity_level - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `SyncInstance`, found `SyncInstance | None` - | -info: element `None` of union `SyncInstance | None` is not assignable to `SyncInstance` -info: Function defined here - --> infrahub_sync/utils.py:170:5 - | -170 | def get_potenda_from_instance( - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -171 | sync_instance: SyncInstance, - | --------------------------- Parameter declared here - | - -error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:201:12 - | -201 | if sync_instance.adapters_path: - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `adapters_path` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:202:13 - | -202 | sync_instance.adapters_path.extend(adapter_path) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[invalid-assignment]: Object of type `list[str] & ~AlwaysFalsy` is not assignable to attribute `adapters_path` on type `SyncInstance | None` - --> infrahub_sync/cli.py:204:13 - | -204 | sync_instance.adapters_path = adapter_path - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `destination` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:211:8 - | -211 | if sync_instance.destination.name == "infrahub" and sync_instance.destination.settings: - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `destination` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:211:57 - | -211 | if sync_instance.destination.name == "infrahub" and sync_instance.destination.settings: - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `destination` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:212:28 - | -212 | infrahub_address = sync_instance.destination.settings.get("url") or "" - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `destination` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:213:51 - | -213 | sdk_config = get_infrahub_config(settings=sync_instance.destination.settings, branch=branch) - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `source` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:214:10 - | -214 | elif sync_instance.source.name == "infrahub" and sync_instance.source.settings: - | ^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `source` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:214:54 - | -214 | elif sync_instance.source.name == "infrahub" and sync_instance.source.settings: - | ^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `source` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:215:28 - | -215 | infrahub_address = sync_instance.source.settings.get("url") or "" - | ^^^^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `source` is not defined on `None` in union `SyncInstance | None` - --> infrahub_sync/cli.py:216:51 - | -216 | sdk_config = get_infrahub_config(settings=sync_instance.source.settings, branch=branch) - | ^^^^^^^^^^^^^^^^^^^^ - | - -error[invalid-argument-type]: Argument to function `find_missing_schema_model` is incorrect - --> infrahub_sync/cli.py:226:55 - | -226 | missing_schema_models = find_missing_schema_model(sync_instance=sync_instance, schema=schema) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `SyncInstance`, found `SyncInstance | None` - | -info: element `None` of union `SyncInstance | None` is not assignable to `SyncInstance` -info: Function defined here - --> infrahub_sync/utils.py:27:5 - | -27 | def find_missing_schema_model( - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -28 | sync_instance: SyncInstance, - | --------------------------- Parameter declared here - | - -error[invalid-argument-type]: Argument to function `find_missing_schema_model` is incorrect - --> infrahub_sync/cli.py:226:84 - | -226 | missing_schema_models = find_missing_schema_model(sync_instance=sync_instance, schema=schema) - | ^^^^^^^^^^^^^ Expected `MutableMapping[str, NodeSchema | GenericSchema]`, found `MutableMapping[str, NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI]` - | -info: element `NodeSchema` of union `NodeSchema | GenericSchema` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` -info: Function defined here - --> infrahub_sync/utils.py:27:5 - | -27 | def find_missing_schema_model( - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -28 | sync_instance: SyncInstance, -29 | schema: MutableMapping[str, Union[NodeSchema, GenericSchema]], - | ------------------------------------------------------------- Parameter declared here - | - -error[invalid-argument-type]: Argument to function `render_adapter` is incorrect - --> infrahub_sync/cli.py:230:37 - | -230 | rendered_files = render_adapter(sync_instance=sync_instance, schema=schema) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected `SyncInstance`, found `SyncInstance | None` - | -info: element `None` of union `SyncInstance | None` is not assignable to `SyncInstance` -info: Function defined here - --> infrahub_sync/utils.py:41:5 - | -41 | def render_adapter( - | ^^^^^^^^^^^^^^ -42 | sync_instance: SyncInstance, - | --------------------------- Parameter declared here - | - -error[invalid-argument-type]: Argument to function `render_adapter` is incorrect - --> infrahub_sync/cli.py:230:66 - | -230 | rendered_files = render_adapter(sync_instance=sync_instance, schema=schema) - | ^^^^^^^^^^^^^ Expected `MutableMapping[str, NodeSchema | GenericSchema]`, found `MutableMapping[str, NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI]` - | -info: element `NodeSchema` of union `NodeSchema | GenericSchema` is not assignable to `NodeSchemaAPI | GenericSchemaAPI | ProfileSchemaAPI | TemplateSchemaAPI` -info: Function defined here - --> infrahub_sync/utils.py:41:5 - | -41 | def render_adapter( - | ^^^^^^^^^^^^^^ -42 | sync_instance: SyncInstance, -43 | schema: MutableMapping[str, Union[NodeSchema, GenericSchema]], - | ------------------------------------------------------------- Parameter declared here - | - -error[not-iterable]: Object of type `list[SchemaMappingField] | None` may not be iterable - --> infrahub_sync/generator/__init__.py:56:28 - | -56 | for subitem in item.fields: - | ^^^^^^^^^^^ - | -info: It may not have an `__iter__` method or a `__getitem__` method - -error[invalid-attribute-access]: Cannot assign to ClassVar `top_level` from an instance of type `Adapter` - --> infrahub_sync/potenda/__init__.py:37:9 - | -37 | self.source.top_level = top_level - | ^^^^^^^^^^^^^^^^^^^^^ - | - -error[invalid-attribute-access]: Cannot assign to ClassVar `top_level` from an instance of type `Adapter` - --> infrahub_sync/potenda/__init__.py:38:9 - | -38 | self.destination.top_level = top_level - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - -error[not-iterable]: Object of type `list[str | DiffSyncFlags] | None` may not be iterable - --> infrahub_sync/potenda/__init__.py:49:21 - | -49 | for flag in self.config.diffsync_flags: - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -info: It may not have an `__iter__` method or a `__getitem__` method - -error[unsupported-operator]: Unsupported `|=` operation - --> infrahub_sync/potenda/__init__.py:50:13 - | -50 | self.flags |= flag - | ----------^^^^---- - | | | - | | Has type `str | DiffSyncFlags` - | Has type `Literal[DiffSyncFlags.NONE]` - | - -error[invalid-argument-type]: Argument to function `render_template` is incorrect - --> infrahub_sync/utils.py:61:17 - | -61 | template_file=item[0], - | ^^^^^^^^^^^^^^^^^^^^^ Expected `Path`, found `Literal["diffsync_models.j2", "diffsync_adapter.j2"]` - | -info: element `Literal["diffsync_models.j2"]` of union `Literal["diffsync_models.j2", "diffsync_adapter.j2"]` is not assignable to `Path` -info: Function defined here - --> infrahub_sync/generator/__init__.py:154:5 - | -154 | def render_template(template_file: Path, output_dir: Path, output_file: Path, context: dict[str, Any]) -> None: - | ^^^^^^^^^^^^^^^ ------------------- Parameter declared here - | - -error[invalid-argument-type]: Argument to function `render_template` is incorrect - --> infrahub_sync/utils.py:63:17 - | -63 | output_file=item[1], - | ^^^^^^^^^^^^^^^^^^^ Expected `Path`, found `Literal["sync_models.py", "sync_adapter.py"]` - | -info: element `Literal["sync_models.py"]` of union `Literal["sync_models.py", "sync_adapter.py"]` is not assignable to `Path` -info: Function defined here - --> infrahub_sync/generator/__init__.py:154:5 - | -154 | def render_template(template_file: Path, output_dir: Path, output_file: Path, context: dict[str, Any]) -> None: - | ^^^^^^^^^^^^^^^ ----------------- Parameter declared here - | - -error[invalid-argument-type]: Argument to constructor `Path.__new__` is incorrect - --> infrahub_sync/utils.py:152:17 - | -152 | if Path(config_file).is_absolute() or directory is None: - | ^^^^^^^^^^^ Expected `str | PathLike[str]`, found `str | None` - | -info: element `None` of union `str | None` is not assignable to `str | PathLike[str]` -info: └── type `None` is not assignable to any element of the union `str | PathLike[str]` -info: ├── type `None` is not assignable to protocol `PathLike[str]` -info: │ └── protocol member `__fspath__` is not defined on type `None` -info: └── ... omitted 1 union element without additional context -info: Function defined here - --> stdlib/pathlib/__init__.pyi:310:13 - | -310 | def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... - | ^^^^^^^ -------------- Parameter declared here - | - -error[invalid-argument-type]: Argument to constructor `Path.__new__` is incorrect - --> infrahub_sync/utils.py:153:37 - | -153 | config_file_path = Path(config_file) - | ^^^^^^^^^^^ Expected `str | PathLike[str]`, found `str | None` - | -info: element `None` of union `str | None` is not assignable to `str | PathLike[str]` -info: └── type `None` is not assignable to any element of the union `str | PathLike[str]` -info: ├── type `None` is not assignable to protocol `PathLike[str]` -info: │ └── protocol member `__fspath__` is not defined on type `None` -info: └── ... omitted 1 union element without additional context -info: Function defined here - --> stdlib/pathlib/__init__.pyi:310:13 - | -310 | def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... - | ^^^^^^^ -------------- Parameter declared here - | - -error[invalid-argument-type]: Argument to constructor `Path.__new__` is incorrect - --> infrahub_sync/utils.py:155:48 - | -155 | config_file_path = Path(directory, config_file) - | ^^^^^^^^^^^ Expected `str | PathLike[str]`, found `str | None` - | -info: element `None` of union `str | None` is not assignable to `str | PathLike[str]` -info: └── type `None` is not assignable to any element of the union `str | PathLike[str]` -info: ├── type `None` is not assignable to protocol `PathLike[str]` -info: │ └── protocol member `__fspath__` is not defined on type `None` -info: └── ... omitted 1 union element without additional context -info: Function defined here - --> stdlib/pathlib/__init__.pyi:310:13 - | -310 | def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... - | ^^^^^^^ -------------- Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `Collection.add_collection` is incorrect - --> tasks/__init__.py:17:19 - | -17 | ns.add_collection(linter) - | ^^^^^^ Expected `Collection`, found `` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/invoke/collection.py:285:9 - | -285 | def add_collection( - | ^^^^^^^^^^^^^^ -286 | self, -287 | coll: "Collection", - | ------------------ Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `Collection.add_collection` is incorrect - --> tasks/__init__.py:18:19 - | -18 | ns.add_collection(docs) - | ^^^^ Expected `Collection`, found `` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/invoke/collection.py:285:9 - | -285 | def add_collection( - | ^^^^^^^^^^^^^^ -286 | self, -287 | coll: "Collection", - | ------------------ Parameter declared here - | - -error[invalid-argument-type]: Argument to bound method `Collection.add_collection` is incorrect - --> tasks/__init__.py:19:19 - | -19 | ns.add_collection(tests) - | ^^^^^ Expected `Collection`, found `` - | -info: Method defined here - --> .venv/lib/python3.11/site-packages/invoke/collection.py:285:9 - | -285 | def add_collection( - | ^^^^^^^^^^^^^^ -286 | self, -287 | coll: "Collection", - | ------------------ Parameter declared here - | - -error[unresolved-attribute]: Module `tasks.docs` has no member `generate_doc` - --> tasks/__init__.py:52:5 - | -52 | docs.generate_doc(context) - | ^^^^^^^^^^^^^^^^^ - | - -error[unresolved-attribute]: Attribute `exited` is not defined on `None` in union `Result | None` - --> tasks/docs.py:72:8 - | -72 | if output.exited != 0: - | ^^^^^^^^^^^^^ - | - -error[invalid-argument-type]: Argument to bound method `_PrintCallVisitor.visit_FunctionDef` is incorrect - --> tests/test_logging.py:39:32 - | -39 | self.visit_FunctionDef(node) # type: ignore[arg-type] - | ^^^^ Expected `FunctionDef`, found `AsyncFunctionDef` - | -info: Method defined here - --> tests/test_logging.py:32:9 - | -32 | def visit_FunctionDef(self, node: ast.FunctionDef) -> None: - | ^^^^^^^^^^^^^^^^^ --------------------- Parameter declared here - | - -Found 302 diagnostics - -=== Rule distribution === - 144 warning[unsupported-base] - 52 error[unresolved-attribute] - 41 error[invalid-argument-type] - 28 error[unresolved-import] - 8 error[not-iterable] - 8 error[call-non-callable] - 6 error[invalid-assignment] - 4 error[invalid-return-type] - 3 error[missing-argument] - 2 error[no-matching-overload] - 2 error[invalid-attribute-access] - 1 warning[deprecated] - 1 error[unsupported-operator] - 1 error[too-many-positional-arguments] - 1 error[invalid-method-override] - -=== Per-module diagnostic counts === ---- top-level modules (one diagnostic = one primary location) --- - 166 examples - 82 infrahub_sync/adapters - 23 infrahub_sync/cli - 15 infrahub_sync/__init__ - 5 tasks - 5 infrahub_sync/utils - 4 infrahub_sync/potenda - 1 tests - 1 infrahub_sync/generator - ---- top-level .py files in infrahub_sync/ --- - 23 infrahub_sync/cli.py - 15 infrahub_sync/__init__.py - 5 infrahub_sync/utils.py diff --git a/infrahub_sync/adapters/aci.py b/infrahub_sync/adapters/aci.py index a91e3f2..e167bd2 100644 --- a/infrahub_sync/adapters/aci.py +++ b/infrahub_sync/adapters/aci.py @@ -6,15 +6,15 @@ import logging import os from datetime import datetime, timedelta, timezone -from typing import TYPE_CHECKING, Any, ClassVar +from typing import Any, ClassVar -import requests # type: ignore[import] +import requests import urllib3 from diffsync import Adapter, DiffSyncModel -from requests import Response # type: ignore[import] -from requests.adapters import HTTPAdapter # type: ignore[import] +from requests import Response +from requests.adapters import HTTPAdapter from typing_extensions import Self -from urllib3.util.retry import Retry # type: ignore[import] +from urllib3.util.retry import Retry from infrahub_sync import ( DiffSyncMixin, @@ -26,9 +26,6 @@ from .utils import get_value -if TYPE_CHECKING: - import builtins - logger = logging.getLogger(__name__) @@ -233,7 +230,7 @@ def _create_aci_client(self, adapter: SyncAdapter) -> AciApiClient: verify=verify, ) - def model_loader(self, model_name: str, model: builtins.type[AciModel]) -> None: # type: ignore[valid-type] + def model_loader(self, model_name: str, model: type[AciModel]) -> None: """ Load and process models using schema mapping filters and transformations. @@ -270,10 +267,10 @@ def model_loader(self, model_name: str, model: builtins.type[AciModel]) -> None: is_source_adapter = self.config.source.name.lower() == "aci" if is_source_adapter: # Filter records - filtered_objs = model.filter_records(records=objs, schema_mapping=element) # type: ignore[attr-defined] + filtered_objs = model.filter_records(records=objs, schema_mapping=element) logger.info("%s: Loading %d/%d %s", self.type, len(filtered_objs), total, resource_name) # Transform records - transformed_objs = model.transform_records(records=filtered_objs, schema_mapping=element) # type: ignore[attr-defined] + transformed_objs = model.transform_records(records=filtered_objs, schema_mapping=element) else: logger.info("%s: Loading all %d %s", self.type, total, resource_name) transformed_objs = objs @@ -281,14 +278,14 @@ def model_loader(self, model_name: str, model: builtins.type[AciModel]) -> None: # Create model instances after filtering and transforming for obj in transformed_objs: data = self.obj_to_diffsync(obj=obj, mapping=element, model=model) - item = model(**data) # type: ignore[misc] + item = model(**data) self.add(item) def obj_to_diffsync( self, obj: dict[str, Any], mapping: SchemaMappingModel, - model: builtins.type[AciModel], # type: ignore[valid-type] + model: type[AciModel], ) -> dict[str, Any]: """Convert an object to DiffSync format based on the provided mapping schema.""" obj_id = self._extract_aci_id(obj) @@ -298,7 +295,7 @@ def obj_to_diffsync( if not mapping.fields: return data for field in mapping.fields: - field_is_list = model.is_list(name=field.name) # type: ignore[attr-defined] + field_is_list = model.is_list(name=field.name) if field.static: data[field.name] = field.static diff --git a/infrahub_sync/adapters/prometheus.py b/infrahub_sync/adapters/prometheus.py index b95ff3a..4c786be 100644 --- a/infrahub_sync/adapters/prometheus.py +++ b/infrahub_sync/adapters/prometheus.py @@ -444,7 +444,7 @@ def _ensure_samples(self) -> dict[str, list[dict[str, Any]]]: store: dict[str, list[dict[str, Any]]] = {} for resource_name, query in self.promql_resources.items(): try: - results = self.client.instant_query(query) # type: ignore[attr-defined] + results = self.client.instant_query(query) except Exception as exc: msg = f"Prometheus API query failed for '{resource_name}': {exc!s}" raise ValueError(msg) from exc diff --git a/infrahub_sync/generator/__init__.py b/infrahub_sync/generator/__init__.py index 2269671..be82a79 100644 --- a/infrahub_sync/generator/__init__.py +++ b/infrahub_sync/generator/__init__.py @@ -169,6 +169,6 @@ def render_template(template_file: Path, output_dir: Path, output_file: Path, co template = template_env.get_template(str(template_file)) - rendered_tpl = template.render(**context) # type: ignore[arg-type] + rendered_tpl = template.render(**context) output_filename = output_dir / output_file output_filename.write_text(rendered_tpl, encoding="utf-8") diff --git a/pyproject.toml b/pyproject.toml index 735d8f7..7c5a72a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,10 +40,8 @@ dev = [ "pre-commit>=4.0,<5.0", "types-toml", "types-ujson", - "types-pyyaml", "typer-cli", "invoke>=2.2.1,<3", - "mypy>=1.15.0,<2", "types-PyYAML>=6.0.12", "ruff==0.15.5", "pytest>=9.0.2,<10", @@ -133,12 +131,6 @@ filterwarnings = [ ] addopts = "-vs --cov-report term-missing --cov-report xml --dist loadscope" -[tool.mypy] -pretty = true -ignore_missing_imports = true -disallow_untyped_defs = true -disable_error_code = ["type-abstract"] - [tool.ruff] line-length = 120 diff --git a/tests/__init__.py b/tests/__init__.py index 9c48bcf..38c6c3e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,4 +2,4 @@ from rich import print as rprint -builtins.rprint = rprint # type: ignore +builtins.rprint = rprint # ty: ignore[unresolved-attribute] # injecting rich.print as a test-global helper diff --git a/uv.lock b/uv.lock index 32e66ad..220322b 100644 --- a/uv.lock +++ b/uv.lock @@ -498,7 +498,6 @@ dev = [ { name = "ipython", version = "8.38.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "ipython", version = "9.10.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.11.*'" }, { name = "ipython", version = "9.11.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" }, - { name = "mypy" }, { name = "pre-commit" }, { name = "pylint" }, { name = "pytest" }, @@ -521,7 +520,6 @@ requires-dist = [ { name = "infrahub-sdk", extras = ["all"], specifier = ">=1.17,<2" }, { name = "invoke", marker = "extra == 'dev'", specifier = ">=2.2.1,<3" }, { name = "ipython", marker = "extra == 'dev'" }, - { name = "mypy", marker = "extra == 'dev'", specifier = ">=1.15.0,<2" }, { name = "netutils", specifier = ">=1.9,<2.0" }, { name = "pre-commit", marker = "extra == 'dev'", specifier = ">=4.0,<5.0" }, { name = "pylint", marker = "extra == 'dev'" }, @@ -535,7 +533,6 @@ requires-dist = [ { name = "ty", marker = "extra == 'dev'", specifier = "==0.0.32" }, { name = "typer-cli", marker = "extra == 'dev'" }, { name = "types-python-slugify", marker = "extra == 'dev'", specifier = ">=8.0.2.20240310" }, - { name = "types-pyyaml", marker = "extra == 'dev'" }, { name = "types-pyyaml", marker = "extra == 'dev'", specifier = ">=6.0.12" }, { name = "types-toml", marker = "extra == 'dev'" }, { name = "types-ujson", marker = "extra == 'dev'" }, @@ -680,65 +677,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, ] -[[package]] -name = "librt" -version = "0.8.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/56/9c/b4b0c54d84da4a94b37bd44151e46d5e583c9534c7e02250b961b1b6d8a8/librt-0.8.1.tar.gz", hash = "sha256:be46a14693955b3bd96014ccbdb8339ee8c9346fbe11c1b78901b55125f14c73", size = 177471, upload-time = "2026-02-17T16:13:06.101Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7c/5f/63f5fa395c7a8a93558c0904ba8f1c8d1b997ca6a3de61bc7659970d66bf/librt-0.8.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:81fd938344fecb9373ba1b155968c8a329491d2ce38e7ddb76f30ffb938f12dc", size = 65697, upload-time = "2026-02-17T16:11:06.903Z" }, - { url = "https://files.pythonhosted.org/packages/ff/e0/0472cf37267b5920eff2f292ccfaede1886288ce35b7f3203d8de00abfe6/librt-0.8.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5db05697c82b3a2ec53f6e72b2ed373132b0c2e05135f0696784e97d7f5d48e7", size = 68376, upload-time = "2026-02-17T16:11:08.395Z" }, - { url = "https://files.pythonhosted.org/packages/c8/be/8bd1359fdcd27ab897cd5963294fa4a7c83b20a8564678e4fd12157e56a5/librt-0.8.1-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:d56bc4011975f7460bea7b33e1ff425d2f1adf419935ff6707273c77f8a4ada6", size = 197084, upload-time = "2026-02-17T16:11:09.774Z" }, - { url = "https://files.pythonhosted.org/packages/e2/fe/163e33fdd091d0c2b102f8a60cc0a61fd730ad44e32617cd161e7cd67a01/librt-0.8.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5cdc0f588ff4b663ea96c26d2a230c525c6fc62b28314edaaaca8ed5af931ad0", size = 207337, upload-time = "2026-02-17T16:11:11.311Z" }, - { url = "https://files.pythonhosted.org/packages/01/99/f85130582f05dcf0c8902f3d629270231d2f4afdfc567f8305a952ac7f14/librt-0.8.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:97c2b54ff6717a7a563b72627990bec60d8029df17df423f0ed37d56a17a176b", size = 219980, upload-time = "2026-02-17T16:11:12.499Z" }, - { url = "https://files.pythonhosted.org/packages/6f/54/cb5e4d03659e043a26c74e08206412ac9a3742f0477d96f9761a55313b5f/librt-0.8.1-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8f1125e6bbf2f1657d9a2f3ccc4a2c9b0c8b176965bb565dd4d86be67eddb4b6", size = 212921, upload-time = "2026-02-17T16:11:14.484Z" }, - { url = "https://files.pythonhosted.org/packages/b1/81/a3a01e4240579c30f3487f6fed01eb4bc8ef0616da5b4ebac27ca19775f3/librt-0.8.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:8f4bb453f408137d7581be309b2fbc6868a80e7ef60c88e689078ee3a296ae71", size = 221381, upload-time = "2026-02-17T16:11:17.459Z" }, - { url = "https://files.pythonhosted.org/packages/08/b0/fc2d54b4b1c6fb81e77288ff31ff25a2c1e62eaef4424a984f228839717b/librt-0.8.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:c336d61d2fe74a3195edc1646d53ff1cddd3a9600b09fa6ab75e5514ba4862a7", size = 216714, upload-time = "2026-02-17T16:11:19.197Z" }, - { url = "https://files.pythonhosted.org/packages/96/96/85daa73ffbd87e1fb287d7af6553ada66bf25a2a6b0de4764344a05469f6/librt-0.8.1-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:eb5656019db7c4deacf0c1a55a898c5bb8f989be904597fcb5232a2f4828fa05", size = 214777, upload-time = "2026-02-17T16:11:20.443Z" }, - { url = "https://files.pythonhosted.org/packages/12/9c/c3aa7a2360383f4bf4f04d98195f2739a579128720c603f4807f006a4225/librt-0.8.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c25d9e338d5bed46c1632f851babf3d13c78f49a225462017cf5e11e845c5891", size = 237398, upload-time = "2026-02-17T16:11:22.083Z" }, - { url = "https://files.pythonhosted.org/packages/61/19/d350ea89e5274665185dabc4bbb9c3536c3411f862881d316c8b8e00eb66/librt-0.8.1-cp310-cp310-win32.whl", hash = "sha256:aaab0e307e344cb28d800957ef3ec16605146ef0e59e059a60a176d19543d1b7", size = 54285, upload-time = "2026-02-17T16:11:23.27Z" }, - { url = "https://files.pythonhosted.org/packages/4f/d6/45d587d3d41c112e9543a0093d883eb57a24a03e41561c127818aa2a6bcc/librt-0.8.1-cp310-cp310-win_amd64.whl", hash = "sha256:56e04c14b696300d47b3bc5f1d10a00e86ae978886d0cee14e5714fafb5df5d2", size = 61352, upload-time = "2026-02-17T16:11:24.207Z" }, - { url = "https://files.pythonhosted.org/packages/1d/01/0e748af5e4fee180cf7cd12bd12b0513ad23b045dccb2a83191bde82d168/librt-0.8.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:681dc2451d6d846794a828c16c22dc452d924e9f700a485b7ecb887a30aad1fd", size = 65315, upload-time = "2026-02-17T16:11:25.152Z" }, - { url = "https://files.pythonhosted.org/packages/9d/4d/7184806efda571887c798d573ca4134c80ac8642dcdd32f12c31b939c595/librt-0.8.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a3b4350b13cc0e6f5bec8fa7caf29a8fb8cdc051a3bae45cfbfd7ce64f009965", size = 68021, upload-time = "2026-02-17T16:11:26.129Z" }, - { url = "https://files.pythonhosted.org/packages/ae/88/c3c52d2a5d5101f28d3dc89298444626e7874aa904eed498464c2af17627/librt-0.8.1-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:ac1e7817fd0ed3d14fd7c5df91daed84c48e4c2a11ee99c0547f9f62fdae13da", size = 194500, upload-time = "2026-02-17T16:11:27.177Z" }, - { url = "https://files.pythonhosted.org/packages/d6/5d/6fb0a25b6a8906e85b2c3b87bee1d6ed31510be7605b06772f9374ca5cb3/librt-0.8.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:747328be0c5b7075cde86a0e09d7a9196029800ba75a1689332348e998fb85c0", size = 205622, upload-time = "2026-02-17T16:11:28.242Z" }, - { url = "https://files.pythonhosted.org/packages/b2/a6/8006ae81227105476a45691f5831499e4d936b1c049b0c1feb17c11b02d1/librt-0.8.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f0af2bd2bc204fa27f3d6711d0f360e6b8c684a035206257a81673ab924aa11e", size = 218304, upload-time = "2026-02-17T16:11:29.344Z" }, - { url = "https://files.pythonhosted.org/packages/ee/19/60e07886ad16670aae57ef44dada41912c90906a6fe9f2b9abac21374748/librt-0.8.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d480de377f5b687b6b1bc0c0407426da556e2a757633cc7e4d2e1a057aa688f3", size = 211493, upload-time = "2026-02-17T16:11:30.445Z" }, - { url = "https://files.pythonhosted.org/packages/9c/cf/f666c89d0e861d05600438213feeb818c7514d3315bae3648b1fc145d2b6/librt-0.8.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d0ee06b5b5291f609ddb37b9750985b27bc567791bc87c76a569b3feed8481ac", size = 219129, upload-time = "2026-02-17T16:11:32.021Z" }, - { url = "https://files.pythonhosted.org/packages/8f/ef/f1bea01e40b4a879364c031476c82a0dc69ce068daad67ab96302fed2d45/librt-0.8.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:9e2c6f77b9ad48ce5603b83b7da9ee3e36b3ab425353f695cba13200c5d96596", size = 213113, upload-time = "2026-02-17T16:11:33.192Z" }, - { url = "https://files.pythonhosted.org/packages/9b/80/cdab544370cc6bc1b72ea369525f547a59e6938ef6863a11ab3cd24759af/librt-0.8.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:439352ba9373f11cb8e1933da194dcc6206daf779ff8df0ed69c5e39113e6a99", size = 212269, upload-time = "2026-02-17T16:11:34.373Z" }, - { url = "https://files.pythonhosted.org/packages/9d/9c/48d6ed8dac595654f15eceab2035131c136d1ae9a1e3548e777bb6dbb95d/librt-0.8.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:82210adabbc331dbb65d7868b105185464ef13f56f7f76688565ad79f648b0fe", size = 234673, upload-time = "2026-02-17T16:11:36.063Z" }, - { url = "https://files.pythonhosted.org/packages/16/01/35b68b1db517f27a01be4467593292eb5315def8900afad29fabf56304ba/librt-0.8.1-cp311-cp311-win32.whl", hash = "sha256:52c224e14614b750c0a6d97368e16804a98c684657c7518752c356834fff83bb", size = 54597, upload-time = "2026-02-17T16:11:37.544Z" }, - { url = "https://files.pythonhosted.org/packages/71/02/796fe8f02822235966693f257bf2c79f40e11337337a657a8cfebba5febc/librt-0.8.1-cp311-cp311-win_amd64.whl", hash = "sha256:c00e5c884f528c9932d278d5c9cbbea38a6b81eb62c02e06ae53751a83a4d52b", size = 61733, upload-time = "2026-02-17T16:11:38.691Z" }, - { url = "https://files.pythonhosted.org/packages/28/ad/232e13d61f879a42a4e7117d65e4984bb28371a34bb6fb9ca54ec2c8f54e/librt-0.8.1-cp311-cp311-win_arm64.whl", hash = "sha256:f7cdf7f26c2286ffb02e46d7bac56c94655540b26347673bea15fa52a6af17e9", size = 52273, upload-time = "2026-02-17T16:11:40.308Z" }, - { url = "https://files.pythonhosted.org/packages/95/21/d39b0a87ac52fc98f621fb6f8060efb017a767ebbbac2f99fbcbc9ddc0d7/librt-0.8.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a28f2612ab566b17f3698b0da021ff9960610301607c9a5e8eaca62f5e1c350a", size = 66516, upload-time = "2026-02-17T16:11:41.604Z" }, - { url = "https://files.pythonhosted.org/packages/69/f1/46375e71441c43e8ae335905e069f1c54febee63a146278bcee8782c84fd/librt-0.8.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:60a78b694c9aee2a0f1aaeaa7d101cf713e92e8423a941d2897f4fa37908dab9", size = 68634, upload-time = "2026-02-17T16:11:43.268Z" }, - { url = "https://files.pythonhosted.org/packages/0a/33/c510de7f93bf1fa19e13423a606d8189a02624a800710f6e6a0a0f0784b3/librt-0.8.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:758509ea3f1eba2a57558e7e98f4659d0ea7670bff49673b0dde18a3c7e6c0eb", size = 198941, upload-time = "2026-02-17T16:11:44.28Z" }, - { url = "https://files.pythonhosted.org/packages/dd/36/e725903416409a533d92398e88ce665476f275081d0d7d42f9c4951999e5/librt-0.8.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:039b9f2c506bd0ab0f8725aa5ba339c6f0cd19d3b514b50d134789809c24285d", size = 209991, upload-time = "2026-02-17T16:11:45.462Z" }, - { url = "https://files.pythonhosted.org/packages/30/7a/8d908a152e1875c9f8eac96c97a480df425e657cdb47854b9efaa4998889/librt-0.8.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5bb54f1205a3a6ab41a6fd71dfcdcbd278670d3a90ca502a30d9da583105b6f7", size = 224476, upload-time = "2026-02-17T16:11:46.542Z" }, - { url = "https://files.pythonhosted.org/packages/a8/b8/a22c34f2c485b8903a06f3fe3315341fe6876ef3599792344669db98fcff/librt-0.8.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:05bd41cdee35b0c59c259f870f6da532a2c5ca57db95b5f23689fcb5c9e42440", size = 217518, upload-time = "2026-02-17T16:11:47.746Z" }, - { url = "https://files.pythonhosted.org/packages/79/6f/5c6fea00357e4f82ba44f81dbfb027921f1ab10e320d4a64e1c408d035d9/librt-0.8.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:adfab487facf03f0d0857b8710cf82d0704a309d8ffc33b03d9302b4c64e91a9", size = 225116, upload-time = "2026-02-17T16:11:49.298Z" }, - { url = "https://files.pythonhosted.org/packages/f2/a0/95ced4e7b1267fe1e2720a111685bcddf0e781f7e9e0ce59d751c44dcfe5/librt-0.8.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:153188fe98a72f206042be10a2c6026139852805215ed9539186312d50a8e972", size = 217751, upload-time = "2026-02-17T16:11:50.49Z" }, - { url = "https://files.pythonhosted.org/packages/93/c2/0517281cb4d4101c27ab59472924e67f55e375bc46bedae94ac6dc6e1902/librt-0.8.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:dd3c41254ee98604b08bd5b3af5bf0a89740d4ee0711de95b65166bf44091921", size = 218378, upload-time = "2026-02-17T16:11:51.783Z" }, - { url = "https://files.pythonhosted.org/packages/43/e8/37b3ac108e8976888e559a7b227d0ceac03c384cfd3e7a1c2ee248dbae79/librt-0.8.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e0d138c7ae532908cbb342162b2611dbd4d90c941cd25ab82084aaf71d2c0bd0", size = 241199, upload-time = "2026-02-17T16:11:53.561Z" }, - { url = "https://files.pythonhosted.org/packages/4b/5b/35812d041c53967fedf551a39399271bbe4257e681236a2cf1a69c8e7fa1/librt-0.8.1-cp312-cp312-win32.whl", hash = "sha256:43353b943613c5d9c49a25aaffdba46f888ec354e71e3529a00cca3f04d66a7a", size = 54917, upload-time = "2026-02-17T16:11:54.758Z" }, - { url = "https://files.pythonhosted.org/packages/de/d1/fa5d5331b862b9775aaf2a100f5ef86854e5d4407f71bddf102f4421e034/librt-0.8.1-cp312-cp312-win_amd64.whl", hash = "sha256:ff8baf1f8d3f4b6b7257fcb75a501f2a5499d0dda57645baa09d4d0d34b19444", size = 62017, upload-time = "2026-02-17T16:11:55.748Z" }, - { url = "https://files.pythonhosted.org/packages/c7/7c/c614252f9acda59b01a66e2ddfd243ed1c7e1deab0293332dfbccf862808/librt-0.8.1-cp312-cp312-win_arm64.whl", hash = "sha256:0f2ae3725904f7377e11cc37722d5d401e8b3d5851fb9273d7f4fe04f6b3d37d", size = 52441, upload-time = "2026-02-17T16:11:56.801Z" }, - { url = "https://files.pythonhosted.org/packages/c5/3c/f614c8e4eaac7cbf2bbdf9528790b21d89e277ee20d57dc6e559c626105f/librt-0.8.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7e6bad1cd94f6764e1e21950542f818a09316645337fd5ab9a7acc45d99a8f35", size = 66529, upload-time = "2026-02-17T16:11:57.809Z" }, - { url = "https://files.pythonhosted.org/packages/ab/96/5836544a45100ae411eda07d29e3d99448e5258b6e9c8059deb92945f5c2/librt-0.8.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cf450f498c30af55551ba4f66b9123b7185362ec8b625a773b3d39aa1a717583", size = 68669, upload-time = "2026-02-17T16:11:58.843Z" }, - { url = "https://files.pythonhosted.org/packages/06/53/f0b992b57af6d5531bf4677d75c44f095f2366a1741fb695ee462ae04b05/librt-0.8.1-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:eca45e982fa074090057132e30585a7e8674e9e885d402eae85633e9f449ce6c", size = 199279, upload-time = "2026-02-17T16:11:59.862Z" }, - { url = "https://files.pythonhosted.org/packages/f3/ad/4848cc16e268d14280d8168aee4f31cea92bbd2b79ce33d3e166f2b4e4fc/librt-0.8.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0c3811485fccfda840861905b8c70bba5ec094e02825598bb9d4ca3936857a04", size = 210288, upload-time = "2026-02-17T16:12:00.954Z" }, - { url = "https://files.pythonhosted.org/packages/52/05/27fdc2e95de26273d83b96742d8d3b7345f2ea2bdbd2405cc504644f2096/librt-0.8.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e4af413908f77294605e28cfd98063f54b2c790561383971d2f52d113d9c363", size = 224809, upload-time = "2026-02-17T16:12:02.108Z" }, - { url = "https://files.pythonhosted.org/packages/7a/d0/78200a45ba3240cb042bc597d6f2accba9193a2c57d0356268cbbe2d0925/librt-0.8.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5212a5bd7fae98dae95710032902edcd2ec4dc994e883294f75c857b83f9aba0", size = 218075, upload-time = "2026-02-17T16:12:03.631Z" }, - { url = "https://files.pythonhosted.org/packages/af/72/a210839fa74c90474897124c064ffca07f8d4b347b6574d309686aae7ca6/librt-0.8.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e692aa2d1d604e6ca12d35e51fdc36f4cda6345e28e36374579f7ef3611b3012", size = 225486, upload-time = "2026-02-17T16:12:04.725Z" }, - { url = "https://files.pythonhosted.org/packages/a3/c1/a03cc63722339ddbf087485f253493e2b013039f5b707e8e6016141130fa/librt-0.8.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4be2a5c926b9770c9e08e717f05737a269b9d0ebc5d2f0060f0fe3fe9ce47acb", size = 218219, upload-time = "2026-02-17T16:12:05.828Z" }, - { url = "https://files.pythonhosted.org/packages/58/f5/fff6108af0acf941c6f274a946aea0e484bd10cd2dc37610287ce49388c5/librt-0.8.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:fd1a720332ea335ceb544cf0a03f81df92abd4bb887679fd1e460976b0e6214b", size = 218750, upload-time = "2026-02-17T16:12:07.09Z" }, - { url = "https://files.pythonhosted.org/packages/71/67/5a387bfef30ec1e4b4f30562c8586566faf87e47d696768c19feb49e3646/librt-0.8.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:93c2af9e01e0ef80d95ae3c720be101227edae5f2fe7e3dc63d8857fadfc5a1d", size = 241624, upload-time = "2026-02-17T16:12:08.43Z" }, - { url = "https://files.pythonhosted.org/packages/d4/be/24f8502db11d405232ac1162eb98069ca49c3306c1d75c6ccc61d9af8789/librt-0.8.1-cp313-cp313-win32.whl", hash = "sha256:086a32dbb71336627e78cc1d6ee305a68d038ef7d4c39aaff41ae8c9aa46e91a", size = 54969, upload-time = "2026-02-17T16:12:09.633Z" }, - { url = "https://files.pythonhosted.org/packages/5c/73/c9fdf6cb2a529c1a092ce769a12d88c8cca991194dfe641b6af12fa964d2/librt-0.8.1-cp313-cp313-win_amd64.whl", hash = "sha256:e11769a1dbda4da7b00a76cfffa67aa47cfa66921d2724539eee4b9ede780b79", size = 62000, upload-time = "2026-02-17T16:12:10.632Z" }, - { url = "https://files.pythonhosted.org/packages/d3/97/68f80ca3ac4924f250cdfa6e20142a803e5e50fca96ef5148c52ee8c10ea/librt-0.8.1-cp313-cp313-win_arm64.whl", hash = "sha256:924817ab3141aca17893386ee13261f1d100d1ef410d70afe4389f2359fea4f0", size = 52495, upload-time = "2026-02-17T16:12:11.633Z" }, -] - [[package]] name = "markdown-it-py" version = "4.0.0" @@ -844,46 +782,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, ] -[[package]] -name = "mypy" -version = "1.19.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "librt", marker = "platform_python_implementation != 'PyPy'" }, - { name = "mypy-extensions" }, - { name = "pathspec" }, - { name = "tomli", marker = "python_full_version < '3.11'" }, - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/f5/db/4efed9504bc01309ab9c2da7e352cc223569f05478012b5d9ece38fd44d2/mypy-1.19.1.tar.gz", hash = "sha256:19d88bb05303fe63f71dd2c6270daca27cb9401c4ca8255fe50d1d920e0eb9ba", size = 3582404, upload-time = "2025-12-15T05:03:48.42Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2f/63/e499890d8e39b1ff2df4c0c6ce5d371b6844ee22b8250687a99fd2f657a8/mypy-1.19.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5f05aa3d375b385734388e844bc01733bd33c644ab48e9684faa54e5389775ec", size = 13101333, upload-time = "2025-12-15T05:03:03.28Z" }, - { url = "https://files.pythonhosted.org/packages/72/4b/095626fc136fba96effc4fd4a82b41d688ab92124f8c4f7564bffe5cf1b0/mypy-1.19.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:022ea7279374af1a5d78dfcab853fe6a536eebfda4b59deab53cd21f6cd9f00b", size = 12164102, upload-time = "2025-12-15T05:02:33.611Z" }, - { url = "https://files.pythonhosted.org/packages/0c/5b/952928dd081bf88a83a5ccd49aaecfcd18fd0d2710c7ff07b8fb6f7032b9/mypy-1.19.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee4c11e460685c3e0c64a4c5de82ae143622410950d6be863303a1c4ba0e36d6", size = 12765799, upload-time = "2025-12-15T05:03:28.44Z" }, - { url = "https://files.pythonhosted.org/packages/2a/0d/93c2e4a287f74ef11a66fb6d49c7a9f05e47b0a4399040e6719b57f500d2/mypy-1.19.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de759aafbae8763283b2ee5869c7255391fbc4de3ff171f8f030b5ec48381b74", size = 13522149, upload-time = "2025-12-15T05:02:36.011Z" }, - { url = "https://files.pythonhosted.org/packages/7b/0e/33a294b56aaad2b338d203e3a1d8b453637ac36cb278b45005e0901cf148/mypy-1.19.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ab43590f9cd5108f41aacf9fca31841142c786827a74ab7cc8a2eacb634e09a1", size = 13810105, upload-time = "2025-12-15T05:02:40.327Z" }, - { url = "https://files.pythonhosted.org/packages/0e/fd/3e82603a0cb66b67c5e7abababce6bf1a929ddf67bf445e652684af5c5a0/mypy-1.19.1-cp310-cp310-win_amd64.whl", hash = "sha256:2899753e2f61e571b3971747e302d5f420c3fd09650e1951e99f823bc3089dac", size = 10057200, upload-time = "2025-12-15T05:02:51.012Z" }, - { url = "https://files.pythonhosted.org/packages/ef/47/6b3ebabd5474d9cdc170d1342fbf9dddc1b0ec13ec90bf9004ee6f391c31/mypy-1.19.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d8dfc6ab58ca7dda47d9237349157500468e404b17213d44fc1cb77bce532288", size = 13028539, upload-time = "2025-12-15T05:03:44.129Z" }, - { url = "https://files.pythonhosted.org/packages/5c/a6/ac7c7a88a3c9c54334f53a941b765e6ec6c4ebd65d3fe8cdcfbe0d0fd7db/mypy-1.19.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e3f276d8493c3c97930e354b2595a44a21348b320d859fb4a2b9f66da9ed27ab", size = 12083163, upload-time = "2025-12-15T05:03:37.679Z" }, - { url = "https://files.pythonhosted.org/packages/67/af/3afa9cf880aa4a2c803798ac24f1d11ef72a0c8079689fac5cfd815e2830/mypy-1.19.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2abb24cf3f17864770d18d673c85235ba52456b36a06b6afc1e07c1fdcd3d0e6", size = 12687629, upload-time = "2025-12-15T05:02:31.526Z" }, - { url = "https://files.pythonhosted.org/packages/2d/46/20f8a7114a56484ab268b0ab372461cb3a8f7deed31ea96b83a4e4cfcfca/mypy-1.19.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a009ffa5a621762d0c926a078c2d639104becab69e79538a494bcccb62cc0331", size = 13436933, upload-time = "2025-12-15T05:03:15.606Z" }, - { url = "https://files.pythonhosted.org/packages/5b/f8/33b291ea85050a21f15da910002460f1f445f8007adb29230f0adea279cb/mypy-1.19.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f7cee03c9a2e2ee26ec07479f38ea9c884e301d42c6d43a19d20fb014e3ba925", size = 13661754, upload-time = "2025-12-15T05:02:26.731Z" }, - { url = "https://files.pythonhosted.org/packages/fd/a3/47cbd4e85bec4335a9cd80cf67dbc02be21b5d4c9c23ad6b95d6c5196bac/mypy-1.19.1-cp311-cp311-win_amd64.whl", hash = "sha256:4b84a7a18f41e167f7995200a1d07a4a6810e89d29859df936f1c3923d263042", size = 10055772, upload-time = "2025-12-15T05:03:26.179Z" }, - { url = "https://files.pythonhosted.org/packages/06/8a/19bfae96f6615aa8a0604915512e0289b1fad33d5909bf7244f02935d33a/mypy-1.19.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a8174a03289288c1f6c46d55cef02379b478bfbc8e358e02047487cad44c6ca1", size = 13206053, upload-time = "2025-12-15T05:03:46.622Z" }, - { url = "https://files.pythonhosted.org/packages/a5/34/3e63879ab041602154ba2a9f99817bb0c85c4df19a23a1443c8986e4d565/mypy-1.19.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ffcebe56eb09ff0c0885e750036a095e23793ba6c2e894e7e63f6d89ad51f22e", size = 12219134, upload-time = "2025-12-15T05:03:24.367Z" }, - { url = "https://files.pythonhosted.org/packages/89/cc/2db6f0e95366b630364e09845672dbee0cbf0bbe753a204b29a944967cd9/mypy-1.19.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b64d987153888790bcdb03a6473d321820597ab8dd9243b27a92153c4fa50fd2", size = 12731616, upload-time = "2025-12-15T05:02:44.725Z" }, - { url = "https://files.pythonhosted.org/packages/00/be/dd56c1fd4807bc1eba1cf18b2a850d0de7bacb55e158755eb79f77c41f8e/mypy-1.19.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c35d298c2c4bba75feb2195655dfea8124d855dfd7343bf8b8c055421eaf0cf8", size = 13620847, upload-time = "2025-12-15T05:03:39.633Z" }, - { url = "https://files.pythonhosted.org/packages/6d/42/332951aae42b79329f743bf1da088cd75d8d4d9acc18fbcbd84f26c1af4e/mypy-1.19.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:34c81968774648ab5ac09c29a375fdede03ba253f8f8287847bd480782f73a6a", size = 13834976, upload-time = "2025-12-15T05:03:08.786Z" }, - { url = "https://files.pythonhosted.org/packages/6f/63/e7493e5f90e1e085c562bb06e2eb32cae27c5057b9653348d38b47daaecc/mypy-1.19.1-cp312-cp312-win_amd64.whl", hash = "sha256:b10e7c2cd7870ba4ad9b2d8a6102eb5ffc1f16ca35e3de6bfa390c1113029d13", size = 10118104, upload-time = "2025-12-15T05:03:10.834Z" }, - { url = "https://files.pythonhosted.org/packages/de/9f/a6abae693f7a0c697dbb435aac52e958dc8da44e92e08ba88d2e42326176/mypy-1.19.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e3157c7594ff2ef1634ee058aafc56a82db665c9438fd41b390f3bde1ab12250", size = 13201927, upload-time = "2025-12-15T05:02:29.138Z" }, - { url = "https://files.pythonhosted.org/packages/9a/a4/45c35ccf6e1c65afc23a069f50e2c66f46bd3798cbe0d680c12d12935caa/mypy-1.19.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bdb12f69bcc02700c2b47e070238f42cb87f18c0bc1fc4cdb4fb2bc5fd7a3b8b", size = 12206730, upload-time = "2025-12-15T05:03:01.325Z" }, - { url = "https://files.pythonhosted.org/packages/05/bb/cdcf89678e26b187650512620eec8368fded4cfd99cfcb431e4cdfd19dec/mypy-1.19.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f859fb09d9583a985be9a493d5cfc5515b56b08f7447759a0c5deaf68d80506e", size = 12724581, upload-time = "2025-12-15T05:03:20.087Z" }, - { url = "https://files.pythonhosted.org/packages/d1/32/dd260d52babf67bad8e6770f8e1102021877ce0edea106e72df5626bb0ec/mypy-1.19.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c9a6538e0415310aad77cb94004ca6482330fece18036b5f360b62c45814c4ef", size = 13616252, upload-time = "2025-12-15T05:02:49.036Z" }, - { url = "https://files.pythonhosted.org/packages/71/d0/5e60a9d2e3bd48432ae2b454b7ef2b62a960ab51292b1eda2a95edd78198/mypy-1.19.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:da4869fc5e7f62a88f3fe0b5c919d1d9f7ea3cef92d3689de2823fd27e40aa75", size = 13840848, upload-time = "2025-12-15T05:02:55.95Z" }, - { url = "https://files.pythonhosted.org/packages/98/76/d32051fa65ecf6cc8c6610956473abdc9b4c43301107476ac03559507843/mypy-1.19.1-cp313-cp313-win_amd64.whl", hash = "sha256:016f2246209095e8eda7538944daa1d60e1e8134d98983b9fc1e92c1fc0cb8dd", size = 10135510, upload-time = "2025-12-15T05:02:58.438Z" }, - { url = "https://files.pythonhosted.org/packages/8d/f4/4ce9a05ce5ded1de3ec1c1d96cf9f9504a04e54ce0ed55cfa38619a32b8d/mypy-1.19.1-py3-none-any.whl", hash = "sha256:f1235f5ea01b7db5468d53ece6aaddf1ad0b88d9e7462b86ef96fe04995d7247", size = 2471239, upload-time = "2025-12-15T05:03:07.248Z" }, -] - [[package]] name = "mypy-extensions" version = "1.1.0" From 0754d8080d45aa61857531f3c41978772bb29604 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 15:38:00 +0200 Subject: [PATCH 16/20] refactor(ty): declare config/store on DiffSyncMixin (clarify SyncAdapter mismatch) `build_mapping(adapter: Adapter, ...)` in adapters/utils.py accessed `adapter.config` and `adapter.store`. Neither attribute exists on `diffsync.Adapter`; both are added by our `DiffSyncMixin` (config) and `diffsync.Adapter`'s own `__init__` (store). The previous T6.8 comment described `config` as "attached at runtime by SyncAdapter subclasses", which conflated two unrelated types: `SyncAdapter` is a Pydantic config model holding YAML adapter settings, and nothing subclasses it. Declare `config: SyncConfig` and `store: BaseStore` on `DiffSyncMixin` so ty resolves the attribute chain on real adapter instances directly. Retype `build_mapping`'s parameter as `DiffSyncMixin` (every caller passes a `DiffSyncMixin + Adapter` subclass) and drop the now-redundant `# ty: ignore[unresolved-attribute]` and the misleading comment. Co-Authored-By: Claude Opus 4.7 (1M context) --- infrahub_sync/__init__.py | 12 ++++++++++++ infrahub_sync/adapters/utils.py | 9 ++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/infrahub_sync/__init__.py b/infrahub_sync/__init__.py index 54e8e20..1bb8775 100644 --- a/infrahub_sync/__init__.py +++ b/infrahub_sync/__init__.py @@ -9,6 +9,8 @@ if TYPE_CHECKING: from collections.abc import Callable + + from diffsync.store import BaseStore from diffsync.enum import DiffSyncFlags from jinja2 import StrictUndefined from jinja2.nativetypes import NativeEnvironment @@ -144,6 +146,16 @@ class DiffSyncMixin: # checkers can resolve `self.top_level` on the mixin. top_level: ClassVar[list[str]] = [] + # Every concrete adapter (NetboxAdapter, NautobotAdapter, InfrahubAdapter, + # …) assigns `self.config = config` in __init__. Declaring it on the mixin + # lets ty resolve `adapter.config.schema_mapping` without per-call ignores. + config: SyncConfig + + # `store` is provided by `diffsync.Adapter` (the other base in every + # concrete adapter's MRO). Annotated here so helpers typed against the + # mixin alone — e.g. `adapters/utils.build_mapping` — can resolve it. + store: BaseStore + def load(self): """Load all the models, one by one based on the order defined in top_level.""" for item in self.top_level: diff --git a/infrahub_sync/adapters/utils.py b/infrahub_sync/adapters/utils.py index 04ec179..cf136c9 100644 --- a/infrahub_sync/adapters/utils.py +++ b/infrahub_sync/adapters/utils.py @@ -3,18 +3,17 @@ from typing import TYPE_CHECKING, Any if TYPE_CHECKING: - from diffsync import Adapter + from infrahub_sync import DiffSyncMixin -def build_mapping(adapter: Adapter, reference: str, obj, field) -> str: +def build_mapping(adapter: DiffSyncMixin, reference: str, obj, field) -> str: """This is used when references are encountered to attempt to resolve them for mapping.""" # Get object class and model name from the store object_class, modelname = adapter.store._get_object_class_and_model(model=reference) - # Find the schema element matching the model name - # `config` is attached at runtime by SyncAdapter subclasses; not part of diffsync.Adapter. + # Find the schema element matching the model name. schema_element = next( - (element for element in adapter.config.schema_mapping if element.name == modelname), # ty: ignore[unresolved-attribute] + (element for element in adapter.config.schema_mapping if element.name == modelname), None, ) if not schema_element: From 52008e4789b5ad7900bb78ef590142e751e66c04 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 15:44:24 +0200 Subject: [PATCH 17/20] refactor: address CodeRabbit review on PR #126 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AGENTS.md: Policy / Known Issues no longer reference `[tool.ty.overrides]` blocks — there are none in pyproject.toml after T6. - genericrestapi.py: guard `self.type.title()` (the `adapter_type` __init__ param is `str | None`); filter `_extract_objects_from_response` to dicts so the declared `list[dict[str, Any]]` contract holds. - infrahub.py: replace `assert isinstance(...)` runtime guards in InfrahubModel.create/update with explicit `raise TypeError(...)` (project policy: raise specific exceptions; asserts disappear under `python -O`). - slurpitsync.py: add docstrings to model_loader, slurpit_obj_to_diffsync, create, update. - utils.py: empty-string `directory` now matches the pre-refactor behavior (`Path("", config_file)` collapses to `Path(config_file)`) — `elif directory:` was a regression introduced in T6.3. Skipped: TODO labels on `# ty: ignore[unresolved-import]` for optional deps (pynetbox, pynautobot, slurpit, ipfabric, prometheus_client.parser). Those imports are intentionally optional per `[project.optional-dependencies]`; there is no "remove when X" action to TODO. The existing reason comment ("optional dep, see pyproject extras") is the stable design rationale. Co-Authored-By: Claude Opus 4.7 (1M context) --- AGENTS.md | 4 ++-- infrahub_sync/adapters/genericrestapi.py | 23 ++++++++++------------- infrahub_sync/adapters/infrahub.py | 12 +++++++++--- infrahub_sync/adapters/slurpitsync.py | 4 ++++ infrahub_sync/utils.py | 11 ++++++----- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 9316441..ac9e3e5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -56,7 +56,7 @@ uv run invoke linter.lint-ty **Policy:** - New or changed code is Ruff-clean and typed where touched (docstrings, specific exceptions). -- Do not increase existing ty debt. The `[tool.ty.overrides]` blocks in `pyproject.toml` already cover today's diagnostic baseline — do not add rules to them. If a real fix is impossible in your PR, use a targeted `# ty: ignore[]` with a short TODO. +- The codebase is clean under ty with no `[[tool.ty.overrides]]` blocks. Don't reintroduce overrides to mask type errors — fix the underlying issue, or use a targeted `# ty: ignore[]` with a short TODO at the call site. - If you add tests, run `uv run pytest -q`. **CLI sanity after changes:** @@ -205,7 +205,7 @@ uv run invoke --list - Optional dependencies (for example, `pynetbox`, `pynautobot`) may be missing, producing import warnings. - `generate` and `sync` require running servers (Infrahub, NetBox, Nautobot). -- Existing ty debt is suppressed per module via `[[tool.ty.overrides]]` in `pyproject.toml`; do not broaden those blocks, and remove rules from them as you fix the underlying code. +- The codebase is clean under ty; there are no `[[tool.ty.overrides]]` blocks in `pyproject.toml`. Prefer real type fixes over reintroducing overrides. - Docs npm audit may flag dev-only vulnerabilities; they do not affect the Python package. ## Development Rules diff --git a/infrahub_sync/adapters/genericrestapi.py b/infrahub_sync/adapters/genericrestapi.py index d6ae55c..a733894 100644 --- a/infrahub_sync/adapters/genericrestapi.py +++ b/infrahub_sync/adapters/genericrestapi.py @@ -159,8 +159,8 @@ def model_loader(self, model_name: str, model: type[GenericrestapiModel]) -> Non raise ValueError(msg) from exc total = len(objs) - # `self.type` is set via `adapter_type` in __init__ but typed `str | None` on the base. - if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] + adapter_type_title = (self.type or "").title() + if self.config.source.name.title() == adapter_type_title: # Filter records filtered_objs = model.filter_records(records=objs, schema_mapping=element) logger.info("%s: Loading %d/%d %s", self.type, len(filtered_objs), total, resource_name) @@ -201,18 +201,15 @@ def _extract_objects_from_response( # Try to get data using the response key objs = response_data.get(response_key, response_data.get(resource_name, {})) - # Handle different response formats - result: list[dict[str, Any]] + # Handle different response formats. Filter each branch down to dict items so the + # declared `list[dict[str, Any]]` contract holds and `obj_to_diffsync` (which calls + # `obj.get(...)`) doesn't crash on non-dict entries. if isinstance(objs, dict): - # If it's a dict, convert values to list (like Observium); response values are dict-shaped. - result = list(objs.values()) # ty: ignore[invalid-assignment] - elif not isinstance(objs, list): - # If it's neither dict nor list, wrap in list - result = [objs] if objs else [] - else: - result = objs - - return result + # Dict response (e.g. Observium-style: {id: {…}, id2: {…}}). + return [v for v in objs.values() if isinstance(v, dict)] + if isinstance(objs, list): + return [v for v in objs if isinstance(v, dict)] + return [] def obj_to_diffsync( self, obj: dict[str, Any], mapping: SchemaMappingModel, model: type[GenericrestapiModel] diff --git a/infrahub_sync/adapters/infrahub.py b/infrahub_sync/adapters/infrahub.py index 4e9e34d..754f7ab 100644 --- a/infrahub_sync/adapters/infrahub.py +++ b/infrahub_sync/adapters/infrahub.py @@ -454,11 +454,15 @@ def create( ) -> Self | None: # `adapter` is typed as the diffsync base for Liskov compatibility with DiffSyncModel.create, # but at runtime it is always an InfrahubAdapter (registered via add_model). - assert isinstance(adapter, InfrahubAdapter) + if not isinstance(adapter, InfrahubAdapter): + msg = f"{cls.__name__}.create expected an InfrahubAdapter, got {type(adapter).__name__}" + raise TypeError(msg) node_schema = adapter.client.schema.get(kind=cls.__name__) # client.schema.get() returns MainSchemaTypesAPI; diffsync_to_infrahub requires NodeSchemaAPI. # All nodes registered as DiffSync models are concrete (NodeSchemaAPI), not generics/profiles. - assert isinstance(node_schema, NodeSchemaAPI) + if not isinstance(node_schema, NodeSchemaAPI): + msg = f"Expected NodeSchemaAPI for {cls.__name__}, got {type(node_schema).__name__}" + raise TypeError(msg) data = diffsync_to_infrahub( ids=ids, attrs=attrs, node_schema=node_schema, store=adapter.client.store, schemas=adapter.schema ) @@ -477,7 +481,9 @@ def create( def update(self, attrs: dict) -> Self | None: # `self.adapter` is `Adapter | None` on the diffsync base; always set after registration. adapter = self.adapter - assert isinstance(adapter, InfrahubAdapter) + if not isinstance(adapter, InfrahubAdapter): + msg = f"{self.__class__.__name__}.update expected an InfrahubAdapter, got {type(adapter).__name__}" + raise TypeError(msg) node = adapter.client.get(id=self.local_id, kind=self.__class__.__name__) source_id = adapter.source_node.id if adapter.source_node else None owner_id = adapter.owner_node.id if adapter.owner_node else None diff --git a/infrahub_sync/adapters/slurpitsync.py b/infrahub_sync/adapters/slurpitsync.py index ddb0d76..c36a7a8 100644 --- a/infrahub_sync/adapters/slurpitsync.py +++ b/infrahub_sync/adapters/slurpitsync.py @@ -167,6 +167,7 @@ def planning_results(self, planning_name): return results or [] def model_loader(self, model_name: str, model: type[SlurpitsyncModel]) -> None: + """Fetch `model_name` from Slurpit, apply schema-mapping filters/transforms, and add each row to the store.""" for element in self.config.schema_mapping: if element.name != model_name: continue @@ -223,6 +224,7 @@ def model_loader(self, model_name: str, model: type[SlurpitsyncModel]) -> None: def slurpit_obj_to_diffsync( self, obj: dict[str, Any], mapping: SchemaMappingModel, model: type[SlurpitsyncModel] ) -> dict | None: + """Convert a Slurpit dict to a DiffSync-ready payload, or None when a required reference is missing.""" obj_id = obj.get("id") data: dict[str, Any] = {"local_id": str(obj_id)} @@ -286,9 +288,11 @@ def create( ids: dict[Any, Any], attrs: dict[Any, Any], ) -> Self | None: + """Create a Slurpit-side record from DiffSync ids/attrs (not yet implemented; delegates to the base).""" # TODO: To implement return super().create(adapter=adapter, ids=ids, attrs=attrs) def update(self, attrs: dict) -> Self | None: + """Update a Slurpit-side record from DiffSync attrs (not yet implemented; delegates to the base).""" # TODO: To implement return super().update(attrs) diff --git a/infrahub_sync/utils.py b/infrahub_sync/utils.py index dcc1308..79c65a5 100644 --- a/infrahub_sync/utils.py +++ b/infrahub_sync/utils.py @@ -151,11 +151,12 @@ def get_instance( # TODO: Log or raise an Error/Warning return None - config_file_path: Path | None = None - if Path(config_file).is_absolute() or directory is None: - config_file_path = Path(config_file) - elif directory: - config_file_path = Path(directory, config_file) + # Empty-string `directory` must still produce Path(config_file), matching pre-refactor behavior. + config_file_path: Path = ( + Path(config_file) + if Path(config_file).is_absolute() or directory is None + else Path(directory, config_file) + ) if config_file_path: directory_path = config_file_path.parent From f88d7c33b66534a934006264f245b5ab02e23553 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 15:46:06 +0200 Subject: [PATCH 18/20] style: ruff-format the utils.py ternary onto one line CI caught the multi-line ternary on python-lint (3.13). `ruff format` collapses it; no behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) --- infrahub_sync/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/infrahub_sync/utils.py b/infrahub_sync/utils.py index 79c65a5..a95d1e0 100644 --- a/infrahub_sync/utils.py +++ b/infrahub_sync/utils.py @@ -153,9 +153,7 @@ def get_instance( # Empty-string `directory` must still produce Path(config_file), matching pre-refactor behavior. config_file_path: Path = ( - Path(config_file) - if Path(config_file).is_absolute() or directory is None - else Path(directory, config_file) + Path(config_file) if Path(config_file).is_absolute() or directory is None else Path(directory, config_file) ) if config_file_path: From 1feea866ae7b08744beb6e4bf1c683d57acc20d2 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 19 May 2026 15:51:00 +0200 Subject: [PATCH 19/20] =?UTF-8?q?docs:=20drop=20standalone=20`invoke=20lin?= =?UTF-8?q?ter.lint-ty`=20calls=20=E2=80=94=20`invoke=20lint`=20runs=20ty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `uv run invoke lint` already runs ruff → pylint → yamllint → ty. Calling `uv run invoke linter.lint-ty` separately in the Quickstart and Required Development Workflow was redundant and misleading. Updated the Code Standards bullet to match, and added `linter.lint-ty` to the invoke task reference list (it was missing). Co-Authored-By: Claude Opus 4.7 (1M context) --- AGENTS.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ac9e3e5..f5dde7e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -34,7 +34,6 @@ uv run infrahub-sync list --directory examples/ # Make a change, then: uv run invoke format uv run invoke lint -uv run invoke linter.lint-ty uv run infrahub-sync list --directory examples/ # If docs/CLI changed: @@ -50,9 +49,10 @@ Run these in order before committing. uv sync uv run invoke format uv run invoke lint -uv run invoke linter.lint-ty ``` +`invoke lint` runs ruff → pylint → yamllint → ty. + **Policy:** - New or changed code is Ruff-clean and typed where touched (docstrings, specific exceptions). @@ -121,7 +121,7 @@ infrahub-sync/ - Prefer explicit types on new or changed code. - Ruff: formatted and lint-clean. Honor `pyproject.toml`. - Pylint: fix actionable issues in touched code; some warnings are expected. -- ty: run via `uv run invoke linter.lint-ty` (or `uv run ty check .`); do not increase the error count. +- ty: included in `uv run invoke lint`; do not increase the error count. For an ad-hoc check, `uv run ty check .` works too. - Public functions and classes require concise docstrings. - Raise specific exceptions; avoid broad `except Exception:`. @@ -187,6 +187,7 @@ uv run invoke --list # linter.lint-ruff Lint Python code with ruff # linter.lint-pylint Lint Python code with pylint # linter.lint-yaml Lint YAML files with yamllint +# linter.lint-ty Type-check Python code with ty # # docs.* # docs.generate Generate CLI documentation From 9c571f7fcc4793cf7f405bf98f15fec76729ec22 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Wed, 20 May 2026 09:04:44 +0200 Subject: [PATCH 20/20] style: drop narrating comments where code is self-explanatory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comments removed: - The 3-line block comments on `DiffSyncMixin` annotations (top_level / config / store / local_id) — the annotations on a mixin class are self-explanatory. - The 8 `# typing.Self is Python 3.11+; ...` headers above each `from typing_extensions import Self` — the import line is the rationale. - The 7 `# self.type is overridden as a non-None ClassVar; ty sees the base Optional[str]` narrations preceding `# ty: ignore[unresolved-attribute]` — the rule code is enough. - The 3 `# get_value returns Any | None; ...` narrations preceding `or []`. - The verbose multi-line shim/decorator headers in __init__.py (kept one-liner). - The 2-line `# adapter is typed as the diffsync base for Liskov ...` and `# self.adapter is Adapter | None ...` preceding the explicit TypeError raises — the error messages already explain the contract. - The 2-line `# diffsync's Adapter.top_level is a ClassVar ...` in potenda. - `# Find the schema element matching the model name.` narrates WHAT. - `# diffsync.Adapter declares type: Optional[str]` narrates the obvious. - `# local_id is declared on generated subclasses` repeated under the existing mixin-level docstring. Net: -70 / +9 across 13 files; ty / ruff / tests all stay green. Co-Authored-By: Claude Opus 4.7 (1M context) --- infrahub_sync/__init__.py | 25 +++--------------------- infrahub_sync/adapters/genericrestapi.py | 8 +------- infrahub_sync/adapters/infrahub.py | 9 +-------- infrahub_sync/adapters/ipfabricsync.py | 4 ---- infrahub_sync/adapters/nautobot.py | 4 ---- infrahub_sync/adapters/netbox.py | 4 ---- infrahub_sync/adapters/peeringmanager.py | 8 +------- infrahub_sync/adapters/prometheus.py | 3 --- infrahub_sync/adapters/slurpitsync.py | 3 --- infrahub_sync/adapters/utils.py | 2 -- infrahub_sync/cli.py | 3 +-- infrahub_sync/potenda/__init__.py | 4 +--- infrahub_sync/utils.py | 2 +- 13 files changed, 9 insertions(+), 70 deletions(-) diff --git a/infrahub_sync/__init__.py b/infrahub_sync/__init__.py index 1bb8775..7eae311 100644 --- a/infrahub_sync/__init__.py +++ b/infrahub_sync/__init__.py @@ -21,16 +21,12 @@ logger = logging.getLogger(__name__) -# Pydantic v1/v2 compatibility shim. The runtime branch picks the right decorator -# and kwargs; ty cannot statically follow this (the kwargs dict has mixed value -# types across branches), so we suppress at the single call-site below. +# Pydantic v1/v2 compatibility shim — runtime branch picks the right decorator + kwargs. if version.parse(pydantic.__version__) >= version.parse("2.0.0"): - # With Pydantic v2, we use `field_validator` with mode "before" from pydantic import field_validator as validator_decorator validator_kwargs: dict[str, Any] = {"mode": "before"} else: - # With Pydantic v1, we use validator with `pre=True` and `allow_reuse=True` from pydantic import validator as validator_decorator # ty: ignore[deprecated] validator_kwargs = {"pre": True, "allow_reuse": True} @@ -84,8 +80,6 @@ class SyncConfig(pydantic.BaseModel): schema_mapping: list[SchemaMappingModel] = [] diffsync_flags: list[Union[str, DiffSyncFlags]] | None = [] - # ty cannot resolve which overload matches because validator_kwargs holds mixed - # value types across the v1/v2 branches. The runtime branch is correct. @validator_decorator("diffsync_flags", **validator_kwargs) # ty: ignore[no-matching-overload] def convert_str_to_enum(cls, v): if not isinstance(v, list): @@ -141,19 +135,8 @@ def convert_to_int(value: Any) -> int: class DiffSyncMixin: - # `top_level` is supplied by the concrete `DiffSync` subclass (a class - # attribute on `diffsync.DiffSync`). Declare it here so static type - # checkers can resolve `self.top_level` on the mixin. top_level: ClassVar[list[str]] = [] - - # Every concrete adapter (NetboxAdapter, NautobotAdapter, InfrahubAdapter, - # …) assigns `self.config = config` in __init__. Declaring it on the mixin - # lets ty resolve `adapter.config.schema_mapping` without per-call ignores. config: SyncConfig - - # `store` is provided by `diffsync.Adapter` (the other base in every - # concrete adapter's MRO). Annotated here so helpers typed against the - # mixin alone — e.g. `adapters/utils.build_mapping` — can resolve it. store: BaseStore def load(self): @@ -171,8 +154,7 @@ def model_loader(self, model_name: str, model): class DiffSyncModelMixin: - # `local_id` is declared by generated subclasses (see generator/templates/diffsync_models.j2). - # Declare it here so static type checkers can resolve `instance.local_id` on the mixin. + # Set on generated subclasses (see generator/templates/diffsync_models.j2). local_id: str | None = None @classmethod @@ -289,8 +271,7 @@ def get_resource_name(cls, schema_mapping: list[SchemaMappingModel]) -> str: @classmethod def is_list(cls, name): - # DiffSync models extend Pydantic; the field map is `model_fields` on v2 - # and `__fields__` on v1. Look up dynamically so this works with both. + # Pydantic v2 exposes `model_fields`; v1 uses `__fields__`. Try both. fields = getattr(cls, "model_fields", None) or getattr(cls, "__fields__", None) or {} field = fields.get(name) if not field: diff --git a/infrahub_sync/adapters/genericrestapi.py b/infrahub_sync/adapters/genericrestapi.py index a733894..fa0cc5c 100644 --- a/infrahub_sync/adapters/genericrestapi.py +++ b/infrahub_sync/adapters/genericrestapi.py @@ -5,8 +5,6 @@ from typing import Any from diffsync import Adapter, DiffSyncModel - -# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. from typing_extensions import Self from infrahub_sync import ( @@ -201,11 +199,8 @@ def _extract_objects_from_response( # Try to get data using the response key objs = response_data.get(response_key, response_data.get(resource_name, {})) - # Handle different response formats. Filter each branch down to dict items so the - # declared `list[dict[str, Any]]` contract holds and `obj_to_diffsync` (which calls - # `obj.get(...)`) doesn't crash on non-dict entries. + # Filter each branch to dicts so `obj_to_diffsync` (which calls `.get(...)`) never sees non-dict items. if isinstance(objs, dict): - # Dict response (e.g. Observium-style: {id: {…}, id2: {…}}). return [v for v in objs.values() if isinstance(v, dict)] if isinstance(objs, list): return [v for v in objs if isinstance(v, dict)] @@ -266,7 +261,6 @@ def obj_to_diffsync( else: data[field.name] = [] - # get_value returns Any | None; guarded above by the outer field.mapping check. for node in get_value(obj, field.mapping) or []: if not node: continue diff --git a/infrahub_sync/adapters/infrahub.py b/infrahub_sync/adapters/infrahub.py index 754f7ab..6f351f2 100644 --- a/infrahub_sync/adapters/infrahub.py +++ b/infrahub_sync/adapters/infrahub.py @@ -15,8 +15,6 @@ from infrahub_sdk.node.property import NodeProperty from infrahub_sdk.schema.main import GenericSchemaAPI, NodeSchemaAPI, RelationshipSchemaAPI from infrahub_sdk.utils import compare_lists - -# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. from typing_extensions import Self from infrahub_sync import ( @@ -315,7 +313,6 @@ def model_loader(self, model_name: str, model: type[InfrahubModel]) -> None: # Extract the list of dicts for filtering and transforming list_obj = [pair[1] for pair in node_dict_pairs] - # `self.type` is overridden as a non-None ClassVar; ty sees the base Optional[str]. if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=list_obj, schema_mapping=element) @@ -452,14 +449,11 @@ def create( ids: dict[Any, Any], attrs: dict[Any, Any], ) -> Self | None: - # `adapter` is typed as the diffsync base for Liskov compatibility with DiffSyncModel.create, - # but at runtime it is always an InfrahubAdapter (registered via add_model). if not isinstance(adapter, InfrahubAdapter): msg = f"{cls.__name__}.create expected an InfrahubAdapter, got {type(adapter).__name__}" raise TypeError(msg) node_schema = adapter.client.schema.get(kind=cls.__name__) - # client.schema.get() returns MainSchemaTypesAPI; diffsync_to_infrahub requires NodeSchemaAPI. - # All nodes registered as DiffSync models are concrete (NodeSchemaAPI), not generics/profiles. + # client.schema.get() returns the wider MainSchemaTypesAPI; diffsync_to_infrahub needs NodeSchemaAPI. if not isinstance(node_schema, NodeSchemaAPI): msg = f"Expected NodeSchemaAPI for {cls.__name__}, got {type(node_schema).__name__}" raise TypeError(msg) @@ -479,7 +473,6 @@ def create( return super().create(adapter=adapter, ids=ids, attrs=attrs) def update(self, attrs: dict) -> Self | None: - # `self.adapter` is `Adapter | None` on the diffsync base; always set after registration. adapter = self.adapter if not isinstance(adapter, InfrahubAdapter): msg = f"{self.__class__.__name__}.update expected an InfrahubAdapter, got {type(adapter).__name__}" diff --git a/infrahub_sync/adapters/ipfabricsync.py b/infrahub_sync/adapters/ipfabricsync.py index f5dee21..0d23f22 100644 --- a/infrahub_sync/adapters/ipfabricsync.py +++ b/infrahub_sync/adapters/ipfabricsync.py @@ -6,8 +6,6 @@ from typing import Any, ClassVar from diffsync import Adapter, DiffSyncModel - -# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. from typing_extensions import Self from infrahub_sync import ( @@ -35,7 +33,6 @@ class IpfabricsyncAdapter(DiffSyncMixin, Adapter): - # diffsync.Adapter declares `type: Optional[str]`; narrow to non-None here. type: ClassVar[str] = "IPFabricsync" def __init__(self, target: str, adapter: SyncAdapter, config: SyncConfig, *args, **kwargs) -> None: @@ -80,7 +77,6 @@ def model_loader(self, model_name: str, model: type[IpfabricsyncModel]) -> None: table = self.client.fetch_all(element.mapping, filters=ipf_filters.get(element.mapping)) total = len(table) - # `self.type` is overridden as a non-None ClassVar above; ty sees the base Optional[str]. if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=table, schema_mapping=element) diff --git a/infrahub_sync/adapters/nautobot.py b/infrahub_sync/adapters/nautobot.py index bd8036e..0c26f7c 100644 --- a/infrahub_sync/adapters/nautobot.py +++ b/infrahub_sync/adapters/nautobot.py @@ -7,8 +7,6 @@ import pynautobot # ty: ignore[unresolved-import] # optional dep, see pyproject extras from diffsync import Adapter, DiffSyncModel - -# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. from typing_extensions import Self from infrahub_sync import ( @@ -77,7 +75,6 @@ def model_loader(self, model_name: str, model: type[NautobotModel]) -> None: list_obj.append(dict(node)) total = len(list_obj) - # `self.type` is overridden as a non-None ClassVar; ty sees the base Optional[str]. if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=list_obj, schema_mapping=element) @@ -137,7 +134,6 @@ def nautobot_obj_to_diffsync( else: data[field.name] = [] - # get_value returns Any | None; default to empty iterable when missing. for node in get_value(obj, field.mapping) or []: if not node: continue diff --git a/infrahub_sync/adapters/netbox.py b/infrahub_sync/adapters/netbox.py index 0a4e325..db2f5e6 100644 --- a/infrahub_sync/adapters/netbox.py +++ b/infrahub_sync/adapters/netbox.py @@ -8,8 +8,6 @@ import pynetbox # ty: ignore[unresolved-import] # optional dep, see pyproject extras from diffsync import Adapter, DiffSyncModel from requests import Session - -# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. from typing_extensions import Self from infrahub_sync import ( @@ -81,7 +79,6 @@ def model_loader(self, model_name: str, model: type[NetboxModel]) -> None: list_obj.append(dict(node)) total = len(list_obj) - # `self.type` is overridden as a non-None ClassVar; ty sees the base Optional[str]. if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=list_obj, schema_mapping=element) @@ -142,7 +139,6 @@ def netbox_obj_to_diffsync( data[field.name] = node else: data[field.name] = [] - # get_value returns Any | None; default to empty iterable when missing. for node in get_value(obj, field.mapping) or []: if not node: continue diff --git a/infrahub_sync/adapters/peeringmanager.py b/infrahub_sync/adapters/peeringmanager.py index f93b1ec..4314030 100644 --- a/infrahub_sync/adapters/peeringmanager.py +++ b/infrahub_sync/adapters/peeringmanager.py @@ -3,8 +3,6 @@ from typing import TYPE_CHECKING, Any import requests - -# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. from typing_extensions import Self from infrahub_sync.adapters.genericrestapi import GenericrestapiAdapter, GenericrestapiModel @@ -64,12 +62,9 @@ def update(self, attrs: dict) -> Self | None: based on the schema mapping configuration, and sends an update request to the API endpoint of the object. """ - # `self.adapter` is `Adapter | None` on the diffsync base, but is always - # set when `update()` is called on a registered instance. adapter = self.adapter assert adapter is not None - # `config` / `client` are attached at runtime by the concrete sync adapter - # and are not declared on the diffsync.Adapter base. + # `adapter` is typed as the base diffsync.Adapter; `config` and `client` come from the concrete subclass. resource_name = self.__class__.get_resource_name(schema_mapping=adapter.config.schema_mapping) # ty: ignore[unresolved-attribute] # Determine the unique identifier for the API request @@ -95,7 +90,6 @@ def update(self, attrs: dict) -> Self | None: filtered_nodes = [ node for node in all_nodes_for_reference if node.get_unique_id() in value ] - # `local_id` is declared on generated subclasses (DiffSyncModelMixin). mapped_attrs[target_field_name] = [node.local_id for node in filtered_nodes] # ty: ignore[unresolved-attribute] else: # For single references, find the matching node diff --git a/infrahub_sync/adapters/prometheus.py b/infrahub_sync/adapters/prometheus.py index 4c786be..3da9e11 100644 --- a/infrahub_sync/adapters/prometheus.py +++ b/infrahub_sync/adapters/prometheus.py @@ -10,8 +10,6 @@ from prometheus_client.parser import ( # ty: ignore[unresolved-import] # optional dep, see pyproject extras text_string_to_metric_families, ) - -# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. from typing_extensions import Self from infrahub_sync import ( @@ -494,7 +492,6 @@ def _mk_lookup(current: dict[str, Any], _lookup: LookupResolver = lookup): obj["lookup"] = _mk_lookup(obj) - # `self.type` is overridden as a non-None ClassVar; ty sees the base Optional[str]. if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] filtered_objs = model.filter_records(records=objs, schema_mapping=element) transformed_objs = model.transform_records(records=filtered_objs, schema_mapping=element) diff --git a/infrahub_sync/adapters/slurpitsync.py b/infrahub_sync/adapters/slurpitsync.py index c36a7a8..e797194 100644 --- a/infrahub_sync/adapters/slurpitsync.py +++ b/infrahub_sync/adapters/slurpitsync.py @@ -7,8 +7,6 @@ import slurpit # ty: ignore[unresolved-import] # optional dep, see pyproject extras from diffsync import Adapter, DiffSyncModel - -# typing.Self is Python 3.11+; project supports 3.10 so import from typing_extensions. from typing_extensions import Self from infrahub_sync import ( @@ -199,7 +197,6 @@ def model_loader(self, model_name: str, model: type[SlurpitsyncModel]) -> None: list_obj.append(node) total = len(list_obj) - # `self.type` is overridden as a non-None ClassVar; ty sees the base Optional[str]. if self.config.source.name.title() == self.type.title(): # ty: ignore[unresolved-attribute] # Filter records filtered_objs = model.filter_records(records=list_obj, schema_mapping=element) diff --git a/infrahub_sync/adapters/utils.py b/infrahub_sync/adapters/utils.py index cf136c9..61af6fc 100644 --- a/infrahub_sync/adapters/utils.py +++ b/infrahub_sync/adapters/utils.py @@ -11,7 +11,6 @@ def build_mapping(adapter: DiffSyncMixin, reference: str, obj, field) -> str: # Get object class and model name from the store object_class, modelname = adapter.store._get_object_class_and_model(model=reference) - # Find the schema element matching the model name. schema_element = next( (element for element in adapter.config.schema_mapping if element.name == modelname), None, @@ -29,7 +28,6 @@ def build_mapping(adapter: DiffSyncMixin, reference: str, obj, field) -> str: # Convert schema_element.fields to a dictionary for fast lookup field_dict = {field.name: field.mapping for field in schema_element.fields} - # Loop through object_class._identifiers to find corresponding field mappings # `_identifiers` is a private ClassVar on DiffSyncModel subclasses, not exposed on the base. for identifier in object_class._identifiers: # ty: ignore[unresolved-attribute] if identifier in field_dict: diff --git a/infrahub_sync/cli.py b/infrahub_sync/cli.py index ac32c39..5d89897 100644 --- a/infrahub_sync/cli.py +++ b/infrahub_sync/cli.py @@ -231,8 +231,7 @@ def generate( except ServerNotResponsiveError as exc: print_error_and_abort(str(exc)) - # The Infrahub SDK returns API schema variants (NodeSchemaAPI, GenericSchemaAPI, ...) that are - # structurally compatible with the (NodeSchema | GenericSchema) mapping expected by utils. + # SDK returns *SchemaAPI variants; structurally compatible with the (NodeSchema | GenericSchema) shape utils expects. typed_schema = cast("MutableMapping[str, NodeSchema | GenericSchema]", schema) missing_schema_models = find_missing_schema_model(sync_instance=sync_instance, schema=typed_schema) if missing_schema_models: diff --git a/infrahub_sync/potenda/__init__.py b/infrahub_sync/potenda/__init__.py index e3d6ed7..906fee6 100644 --- a/infrahub_sync/potenda/__init__.py +++ b/infrahub_sync/potenda/__init__.py @@ -34,9 +34,7 @@ def __init__( self.source = source self.destination = destination - # diffsync's `Adapter.top_level` is declared as a ClassVar but the library - # supports per-instance overrides via attribute assignment; ty flags the - # ClassVar assignment so we suppress just those two lines. + # diffsync's `Adapter.top_level` is a ClassVar but the library supports per-instance overrides. self.source.top_level = top_level # ty: ignore[invalid-attribute-access] self.destination.top_level = top_level # ty: ignore[invalid-attribute-access] diff --git a/infrahub_sync/utils.py b/infrahub_sync/utils.py index a95d1e0..e3da000 100644 --- a/infrahub_sync/utils.py +++ b/infrahub_sync/utils.py @@ -151,7 +151,7 @@ def get_instance( # TODO: Log or raise an Error/Warning return None - # Empty-string `directory` must still produce Path(config_file), matching pre-refactor behavior. + # Check `directory is None` (not truthiness) so an empty string still collapses to Path(config_file). config_file_path: Path = ( Path(config_file) if Path(config_file).is_absolute() or directory is None else Path(directory, config_file) )