diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18789787..17b58efd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,8 +151,6 @@ jobs: run: "poetry install --all-extras" - name: "Mypy Tests" run: "poetry run mypy --show-error-codes infrahub_sdk/" - # - name: "Pylint Tests" - # run: "poetry run pylint infrahub_sdk/" - name: "Unit Tests" run: "poetry run pytest --cov infrahub_sdk tests/unit/" - name: "Upload coverage to Codecov" diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fd44f14..e7953502 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang +## [1.7.1](https://github.com/opsmill/infrahub-sdk-python/tree/v1.7.1) - 2025-01-30 + +### Removed + +- All mention of pylint have been removed from the project. ([#206](https://github.com/opsmill/infrahub-sdk-python/issues/206)) + ## [1.7.0](https://github.com/opsmill/infrahub-sdk-python/tree/v1.7.0) - 2025-01-23 ### Added diff --git a/infrahub_sdk/batch.py b/infrahub_sdk/batch.py index f9e8ccd3..2f1db7f4 100644 --- a/infrahub_sdk/batch.py +++ b/infrahub_sdk/batch.py @@ -30,7 +30,7 @@ def execute(self, return_exceptions: bool = False) -> tuple[InfrahubNodeSync | N result = None try: result = self.task(*self.args, **self.kwargs) - except Exception as exc: # pylint: disable=broad-exception-caught + except Exception as exc: if return_exceptions: return self.node, exc raise exc @@ -44,7 +44,7 @@ async def execute_batch_task_in_pool( async with semaphore: try: result = await task.task(*task.args, **task.kwargs) - except Exception as exc: # pylint: disable=broad-exception-caught + except Exception as exc: if return_exceptions: return (task.node, exc) raise exc diff --git a/infrahub_sdk/config.py b/infrahub_sdk/config.py index 06144087..4034553a 100644 --- a/infrahub_sdk/config.py +++ b/infrahub_sdk/config.py @@ -113,7 +113,7 @@ def validate_address(cls, value: str) -> str: @model_validator(mode="after") def validate_proxy_config(self) -> Self: - if self.proxy and self.proxy_mounts.is_set: # pylint: disable=no-member + if self.proxy and self.proxy_mounts.is_set: raise ValueError("'proxy' and 'proxy_mounts' are mutually exclusive") return self diff --git a/infrahub_sdk/ctl/check.py b/infrahub_sdk/ctl/check.py index a194fc1c..3d5319dd 100644 --- a/infrahub_sdk/ctl/check.py +++ b/infrahub_sdk/ctl/check.py @@ -121,7 +121,7 @@ async def run_check( except QueryNotFoundError as exc: log.warning(f"{module_name}::{check}: unable to find query ({exc!s})") passed = False - except Exception as exc: # pylint: disable=broad-exception-caught + except Exception as exc: log.warning(f"{module_name}::{check}: An error occurred during execution ({exc})") passed = False diff --git a/infrahub_sdk/ctl/utils.py b/infrahub_sdk/ctl/utils.py index 38e9ce1c..5c0b069e 100644 --- a/infrahub_sdk/ctl/utils.py +++ b/infrahub_sdk/ctl/utils.py @@ -88,7 +88,7 @@ def decorator(func: Callable[..., T]) -> Callable[..., T | Coroutine[Any, Any, T async def async_wrapper(*args: Any, **kwargs: Any) -> T: try: return await func(*args, **kwargs) - except (Error, Exception) as exc: # pylint: disable=broad-exception-caught + except (Error, Exception) as exc: return handle_exception(exc=exc, console=console, exit_code=exit_code) return async_wrapper @@ -97,7 +97,7 @@ async def async_wrapper(*args: Any, **kwargs: Any) -> T: def wrapper(*args: Any, **kwargs: Any) -> T: try: return func(*args, **kwargs) - except (Error, Exception) as exc: # pylint: disable=broad-exception-caught + except (Error, Exception) as exc: return handle_exception(exc=exc, console=console, exit_code=exit_code) return wrapper diff --git a/infrahub_sdk/data.py b/infrahub_sdk/data.py index 63d5f0ce..1539cce9 100644 --- a/infrahub_sdk/data.py +++ b/infrahub_sdk/data.py @@ -20,7 +20,7 @@ class RepositoryData(BaseModel): branch_info: dict[str, RepositoryBranchInfo] = Field(default_factory=dict) def get_staging_branch(self) -> str | None: - for branch, info in self.branch_info.items(): # pylint: disable=no-member + for branch, info in self.branch_info.items(): if info.internal_status == "staging": return branch return None diff --git a/infrahub_sdk/node.py b/infrahub_sdk/node.py index 7a929d38..174cc06a 100644 --- a/infrahub_sdk/node.py +++ b/infrahub_sdk/node.py @@ -25,7 +25,6 @@ from .schema import AttributeSchemaAPI, MainSchemaTypesAPI, RelationshipSchemaAPI from .types import Order -# pylint: disable=too-many-lines PROPERTIES_FLAG = ["is_visible", "is_protected"] PROPERTIES_OBJECT = ["source", "owner"] @@ -801,7 +800,7 @@ def _generate_input_data(self, exclude_unmodified: bool = False, exclude_hfid: b Returns: dict[str, Dict]: Representation of an input data in dict format """ - # pylint: disable=too-many-branches + data = {} variables = {} @@ -1251,7 +1250,6 @@ async def generate_query_data_node( Returns: dict[str, Union[Any, Dict]]: GraphQL query in dictionary format """ - # pylint: disable=too-many-branches data: dict[str, Any] = {} @@ -1763,7 +1761,6 @@ def generate_query_data_node( Returns: dict[str, Union[Any, Dict]]: GraphQL query in dictionary format """ - # pylint: disable=too-many-branches data: dict[str, Any] = {} diff --git a/infrahub_sdk/protocols.py b/infrahub_sdk/protocols.py index f187cc43..14b04c7b 100644 --- a/infrahub_sdk/protocols.py +++ b/infrahub_sdk/protocols.py @@ -29,7 +29,6 @@ StringOptional, ) -# pylint: disable=too-many-ancestors # --------------------------------------------- # ASYNC diff --git a/infrahub_sdk/schema/__init__.py b/infrahub_sdk/schema/__init__.py index 1b334fa0..790b5873 100644 --- a/infrahub_sdk/schema/__init__.py +++ b/infrahub_sdk/schema/__init__.py @@ -61,9 +61,6 @@ ] -# pylint: disable=redefined-builtin - - class DropdownMutationOptionalArgs(TypedDict): color: str | None description: str | None diff --git a/infrahub_sdk/transfer/exporter/json.py b/infrahub_sdk/transfer/exporter/json.py index 1234b931..79a813d8 100644 --- a/infrahub_sdk/transfer/exporter/json.py +++ b/infrahub_sdk/transfer/exporter/json.py @@ -98,7 +98,7 @@ async def retrieve_many_to_many_relationships( return many_relationships # FIXME: Split in smaller functions - async def export( # pylint: disable=too-many-branches + async def export( self, export_directory: Path, namespaces: list[str], branch: str, exclude: list[str] | None = None ) -> None: illegal_namespaces = set(ILLEGAL_NAMESPACES) diff --git a/poetry.lock b/poetry.lock index 14fa938e..fc23269b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "annotated-types" @@ -309,21 +309,6 @@ files = [ {file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"}, ] -[[package]] -name = "dill" -version = "0.3.8" -description = "serialize all of Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, - {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, -] - -[package.extras] -graph = ["objgraph (>=1.7.2)"] -profile = ["gprof2dot (>=2022.7.29)"] - [[package]] name = "distlib" version = "0.3.8" @@ -731,20 +716,6 @@ qtconsole = ["qtconsole"] test = ["pickleshare", "pytest (<7.1)", "pytest-asyncio (<0.22)", "testpath"] test-extra = ["curio", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.22)", "pandas", "pickleshare", "pytest (<7.1)", "pytest-asyncio (<0.22)", "testpath", "trio"] -[[package]] -name = "isort" -version = "5.13.2" -description = "A Python utility / library to sort Python imports." -optional = false -python-versions = ">=3.8.0" -files = [ - {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, - {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, -] - -[package.extras] -colors = ["colorama (>=0.4.6)"] - [[package]] name = "jedi" version = "0.19.1" @@ -888,17 +859,6 @@ files = [ [package.dependencies] traitlets = "*" -[[package]] -name = "mccabe" -version = "0.7.0" -description = "McCabe checker, plugin for flake8" -optional = false -python-versions = ">=3.6" -files = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, -] - [[package]] name = "mdurl" version = "0.1.2" @@ -1485,36 +1445,6 @@ files = [ [package.extras] windows-terminal = ["colorama (>=0.4.6)"] -[[package]] -name = "pylint" -version = "3.1.1" -description = "python code static checker" -optional = false -python-versions = ">=3.8.0" -files = [ - {file = "pylint-3.1.1-py3-none-any.whl", hash = "sha256:862eddf25dab42704c5f06d3688b8bc19ef4c99ad8a836b6ff260a3b2fbafee1"}, - {file = "pylint-3.1.1.tar.gz", hash = "sha256:c7c2652bf8099c7fb7a63bc6af5c5f8f7b9d7b392fa1d320cb020e222aff28c2"}, -] - -[package.dependencies] -astroid = ">=3.1.0,<=3.2.0-dev0" -colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -dill = [ - {version = ">=0.2", markers = "python_version < \"3.11\""}, - {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, - {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, -] -isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" -mccabe = ">=0.6,<0.8" -platformdirs = ">=2.2.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -tomlkit = ">=0.10.1" -typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} - -[package.extras] -spelling = ["pyenchant (>=3.2,<4.0)"] -testutils = ["gitpython (>3)"] - [[package]] name = "pytest" version = "8.3.3" @@ -1935,17 +1865,6 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "tomlkit" -version = "0.13.2" -description = "Style preserving TOML library" -optional = false -python-versions = ">=3.8" -files = [ - {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, - {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, -] - [[package]] name = "towncrier" version = "24.8.0" @@ -2319,4 +2238,4 @@ tests = ["Jinja2", "pytest", "pyyaml", "rich"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "97d089383df1d2c713508ce441ebae49ff3f3371247174e723d465ca535bc2c1" +content-hash = "8df86b45a0478a859bbe784b5d9027b2f033da597a52815f6006fd81fd424fdf" diff --git a/pyproject.toml b/pyproject.toml index 2ccddc6d..86314d7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires-python = ">=3.9" [tool.poetry] name = "infrahub-sdk" -version = "1.7.0" +version = "1.7.1" description = "Python Client to interact with Infrahub" authors = ["OpsMill "] readme = "README.md" @@ -59,7 +59,6 @@ pytest-clarity = "^1.0.1" pytest-cov = "^4.0.0" pytest-httpx = ">=0.30" yamllint = "*" -pylint = "*" mypy = "*" ipython = "*" requests = "*" @@ -101,53 +100,6 @@ branch = true [tool.coverage.report] exclude_lines = ["if TYPE_CHECKING:", "raise NotImplementedError()"] -[tool.pylint.general] -extension-pkg-whitelist = ["pydantic", "ujson"] - -[tool.pylint.format] -disable = "logging-fstring-interpolation" - -[tool.pylint.basic] -# No docstrings required for private methods (Pylint default), or for test_ functions. -no-docstring-rgx = "^(_|test_)" - -[tool.pylint.messages_control] -# Line length is enforced by Black, so pylint doesn't need to check it. -# Pylint and Black disagree about how to format multi-line arrays; Black wins. -# Rules already covered by RUFF -# - too-many-statements -# - unused-argument -disable = """, - line-too-long, - missing-module-docstring, - missing-function-docstring, - missing-class-docstring, - consider-using-from-import, - invalid-name, - too-many-arguments, - too-many-locals, - keyword-arg-before-vararg, - too-few-public-methods, - too-many-instance-attributes, - too-many-statements, - fixme, - consider-using-f-string, - protected-access, - import-self, - wrong-import-order, - multiple-statements, - unused-argument, - """ - -[tool.pylint.miscellaneous] -notes = """, - FIXME, - XXX, - """ - -[tool.pylint.similarities] -min-similarity-lines = 20 - [tool.pytest.ini_options] asyncio_mode = "auto" testpaths = ["tests"] diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 0596ce23..752f8fdc 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -28,7 +28,6 @@ # os.environ["PYTEST_RUNNING"] = "true" -# # pylint: disable=redefined-outer-name # class InfrahubTestClient(TestClient): # def _request( # self, url: str, method: HTTPMethod, headers: dict[str, Any], timeout: int, payload: Optional[dict] = None diff --git a/tests/integration/test_export_import.py b/tests/integration/test_export_import.py index 5687cf8b..846a4803 100644 --- a/tests/integration/test_export_import.py +++ b/tests/integration/test_export_import.py @@ -18,7 +18,7 @@ # MANUFACTURER_KIND = "TestingManufacturer" # TAG_KIND = "TestingTag" # -# # pylint: disable=unused-argument +# # # # class TestSchemaExportImportBase(TestInfrahubApp): diff --git a/tests/integration/test_infrahub_client_sync.py b/tests/integration/test_infrahub_client_sync.py index 9322a2da..d5b9ad48 100644 --- a/tests/integration/test_infrahub_client_sync.py +++ b/tests/integration/test_infrahub_client_sync.py @@ -24,7 +24,7 @@ # from infrahub.database import InfrahubDatabase # # -# # pylint: disable=unused-argument +# # # # class TestInfrahubClientSync: diff --git a/tests/integration/test_node.py b/tests/integration/test_node.py index a0d8e890..b5ee1566 100644 --- a/tests/integration/test_node.py +++ b/tests/integration/test_node.py @@ -7,8 +7,6 @@ from infrahub_sdk.testing.docker import TestInfrahubDockerClient from infrahub_sdk.testing.schemas.car_person import TESTING_CAR, TESTING_MANUFACTURER, SchemaCarPerson -# pylint: disable=unused-argument - class TestInfrahubNode(TestInfrahubDockerClient, SchemaCarPerson): @pytest.fixture(scope="class") diff --git a/tests/integration/test_schema.py b/tests/integration/test_schema.py index 1d9515fa..90fb2e52 100644 --- a/tests/integration/test_schema.py +++ b/tests/integration/test_schema.py @@ -7,7 +7,7 @@ # # from .conftest import InfrahubTestClient # -# # pylint: disable=unused-argument +# # # # class TestInfrahubSchema: diff --git a/tests/unit/ctl/test_branch_app.py b/tests/unit/ctl/test_branch_app.py index 1b21a1a3..05c0248b 100644 --- a/tests/unit/ctl/test_branch_app.py +++ b/tests/unit/ctl/test_branch_app.py @@ -5,8 +5,6 @@ runner = CliRunner() -# pylint: disable=unused-argument - def test_branch_list(mock_branches_list_query): result = runner.invoke(app=app, args=["list"]) diff --git a/tests/unit/sdk/conftest.py b/tests/unit/sdk/conftest.py index 7f1d494b..d3dc9dd8 100644 --- a/tests/unit/sdk/conftest.py +++ b/tests/unit/sdk/conftest.py @@ -18,8 +18,6 @@ if TYPE_CHECKING: from pytest_httpx import HTTPXMock -# pylint: disable=redefined-outer-name,unused-argument - @dataclass class BothClients: diff --git a/tests/unit/sdk/test_batch.py b/tests/unit/sdk/test_batch.py index 8b498170..5778e687 100644 --- a/tests/unit/sdk/test_batch.py +++ b/tests/unit/sdk/test_batch.py @@ -54,7 +54,7 @@ async def test_batch_return_exception( mock_schema_query_01, clients: BothClients, client_type: str, -): # pylint: disable=unused-argument +): if client_type == "standard": batch = await clients.standard.create_batch(return_exceptions=True) locations = ["JFK1", "JFK1"] @@ -100,7 +100,7 @@ async def test_batch_exception( mock_schema_query_01, clients: BothClients, client_type: str, -): # pylint: disable=unused-argument +): if client_type == "standard": batch = await clients.standard.create_batch(return_exceptions=False) locations = ["JFK1", "JFK1"] diff --git a/tests/unit/sdk/test_branch.py b/tests/unit/sdk/test_branch.py index df08a5f9..05622576 100644 --- a/tests/unit/sdk/test_branch.py +++ b/tests/unit/sdk/test_branch.py @@ -31,7 +31,7 @@ def test_validate_method_signature(method): @pytest.mark.parametrize("client_type", client_types) -async def test_get_branches(clients, mock_branches_list_query, client_type): # pylint: disable=unused-argument +async def test_get_branches(clients, mock_branches_list_query, client_type): if client_type == "standard": branches = await clients.standard.branch.all() else: diff --git a/tests/unit/sdk/test_client.py b/tests/unit/sdk/test_client.py index f8624c10..4d849221 100644 --- a/tests/unit/sdk/test_client.py +++ b/tests/unit/sdk/test_client.py @@ -58,7 +58,7 @@ def test_init_with_invalid_address(): async def test_get_repositories( client: InfrahubClient, mock_branches_list_query, mock_schema_query_02, mock_repositories_query -): # pylint: disable=unused-argument +): repos = await client.get_list_repositories() assert len(repos) == 2 @@ -74,7 +74,7 @@ async def test_get_repositories( @pytest.mark.parametrize("client_type", client_types) -async def test_method_count(clients, mock_query_repository_count, client_type): # pylint: disable=unused-argument +async def test_method_count(clients, mock_query_repository_count, client_type): if client_type == "standard": count = await clients.standard.count(kind="CoreRepository") else: @@ -84,7 +84,7 @@ async def test_method_count(clients, mock_query_repository_count, client_type): @pytest.mark.parametrize("client_type", client_types) -async def test_method_count_with_filter(clients, mock_query_repository_count, client_type): # pylint: disable=unused-argument +async def test_method_count_with_filter(clients, mock_query_repository_count, client_type): if client_type == "standard": count = await clients.standard.count(kind="CoreRepository", name__value="test") else: @@ -94,7 +94,7 @@ async def test_method_count_with_filter(clients, mock_query_repository_count, cl @pytest.mark.parametrize("client_type", client_types) -async def test_method_get_version(clients, mock_query_infrahub_version, client_type): # pylint: disable=unused-argument +async def test_method_get_version(clients, mock_query_infrahub_version, client_type): if client_type == "standard": version = await clients.standard.get_version() else: @@ -104,7 +104,7 @@ async def test_method_get_version(clients, mock_query_infrahub_version, client_t @pytest.mark.parametrize("client_type", client_types) -async def test_method_get_user(clients, mock_query_infrahub_user, client_type): # pylint: disable=unused-argument +async def test_method_get_user(clients, mock_query_infrahub_user, client_type): if client_type == "standard": user = await clients.standard.get_user() else: @@ -115,7 +115,7 @@ async def test_method_get_user(clients, mock_query_infrahub_user, client_type): @pytest.mark.parametrize("client_type", client_types) -async def test_method_get_user_permissions(clients, mock_query_infrahub_user, client_type): # pylint: disable=unused-argument +async def test_method_get_user_permissions(clients, mock_query_infrahub_user, client_type): if client_type == "standard": groups = await clients.standard.get_user_permissions() else: @@ -126,7 +126,7 @@ async def test_method_get_user_permissions(clients, mock_query_infrahub_user, cl @pytest.mark.parametrize("client_type", client_types) -async def test_method_all_with_limit(clients, mock_query_repository_page1_2, client_type): # pylint: disable=unused-argument +async def test_method_all_with_limit(clients, mock_query_repository_page1_2, client_type): if client_type == "standard": repos = await clients.standard.all(kind="CoreRepository", limit=3) assert not clients.standard.store._store["CoreRepository"] @@ -146,7 +146,7 @@ async def test_method_all_with_limit(clients, mock_query_repository_page1_2, cli @pytest.mark.parametrize("client_type", client_types) async def test_method_all_multiple_pages( clients, mock_query_repository_page1_2, mock_query_repository_page2_2, client_type -): # pylint: disable=unused-argument +): if client_type == "standard": repos = await clients.standard.all(kind="CoreRepository") assert not clients.standard.store._store["CoreRepository"] @@ -166,7 +166,7 @@ async def test_method_all_multiple_pages( @pytest.mark.parametrize("client_type, use_parallel", batch_client_types) async def test_method_all_batching( clients, mock_query_location_batch_count, mock_query_location_batch, client_type, use_parallel -): # pylint: disable=unused-argument +): if client_type == "standard": locations = await clients.standard.all(kind="BuiltinLocation", parallel=use_parallel) assert not clients.standard.store._store["BuiltinLocation"] @@ -184,7 +184,7 @@ async def test_method_all_batching( @pytest.mark.parametrize("client_type", client_types) -async def test_method_all_single_page(clients, mock_query_repository_page1_1, client_type): # pylint: disable=unused-argument +async def test_method_all_single_page(clients, mock_query_repository_page1_1, client_type): if client_type == "standard": repos = await clients.standard.all(kind="CoreRepository") assert not clients.standard.store._store["CoreRepository"] @@ -202,7 +202,7 @@ async def test_method_all_single_page(clients, mock_query_repository_page1_1, cl @pytest.mark.parametrize("client_type", client_types) -async def test_method_all_generic(clients, mock_query_corenode_page1_1, client_type): # pylint: disable=unused-argument +async def test_method_all_generic(clients, mock_query_corenode_page1_1, client_type): if client_type == "standard": nodes = await clients.standard.all(kind="CoreNode") else: @@ -214,7 +214,7 @@ async def test_method_all_generic(clients, mock_query_corenode_page1_1, client_t @pytest.mark.parametrize("client_type", client_types) -async def test_method_get_by_id(httpx_mock: HTTPXMock, clients, mock_schema_query_01, client_type): # pylint: disable=unused-argument +async def test_method_get_by_id(httpx_mock: HTTPXMock, clients, mock_schema_query_01, client_type): response = { "data": { "CoreRepository": { @@ -259,7 +259,7 @@ async def test_method_get_by_id(httpx_mock: HTTPXMock, clients, mock_schema_quer @pytest.mark.parametrize("client_type", client_types) -async def test_method_get_by_hfid(httpx_mock: HTTPXMock, clients, mock_schema_query_01, client_type): # pylint: disable=unused-argument +async def test_method_get_by_hfid(httpx_mock: HTTPXMock, clients, mock_schema_query_01, client_type): response = { "data": { "CoreRepository": { @@ -305,7 +305,7 @@ async def test_method_get_by_hfid(httpx_mock: HTTPXMock, clients, mock_schema_qu @pytest.mark.parametrize("client_type", client_types) -async def test_method_get_by_default_filter(httpx_mock: HTTPXMock, clients, mock_schema_query_01, client_type): # pylint: disable=unused-argument +async def test_method_get_by_default_filter(httpx_mock: HTTPXMock, clients, mock_schema_query_01, client_type): response = { "data": { "CoreRepository": { @@ -350,7 +350,7 @@ async def test_method_get_by_default_filter(httpx_mock: HTTPXMock, clients, mock @pytest.mark.parametrize("client_type", client_types) -async def test_method_get_by_name(httpx_mock: HTTPXMock, clients, mock_schema_query_01, client_type): # pylint: disable=unused-argument +async def test_method_get_by_name(httpx_mock: HTTPXMock, clients, mock_schema_query_01, client_type): response = { "data": { "CoreRepository": { @@ -385,7 +385,7 @@ async def test_method_get_by_name(httpx_mock: HTTPXMock, clients, mock_schema_qu @pytest.mark.parametrize("client_type", client_types) -async def test_method_get_not_found(httpx_mock: HTTPXMock, clients, mock_query_repository_page1_empty, client_type): # pylint: disable=unused-argument +async def test_method_get_not_found(httpx_mock: HTTPXMock, clients, mock_query_repository_page1_empty, client_type): with pytest.raises(NodeNotFoundError): if client_type == "standard": await clients.standard.get(kind="CoreRepository", name__value="infrahub-demo-core") @@ -396,7 +396,7 @@ async def test_method_get_not_found(httpx_mock: HTTPXMock, clients, mock_query_r @pytest.mark.parametrize("client_type", client_types) async def test_method_get_not_found_none( httpx_mock: HTTPXMock, clients, mock_query_repository_page1_empty, client_type -): # pylint: disable=unused-argument +): if client_type == "standard": response = await clients.standard.get( kind="CoreRepository", name__value="infrahub-demo-core", raise_when_missing=False @@ -414,7 +414,7 @@ async def test_method_get_found_many( mock_schema_query_01, mock_query_repository_page1_1, client_type, -): # pylint: disable=unused-argument +): with pytest.raises(IndexError): if client_type == "standard": await clients.standard.get(kind="CoreRepository", id="bfae43e8-5ebb-456c-a946-bf64e930710a") @@ -423,7 +423,7 @@ async def test_method_get_found_many( @pytest.mark.parametrize("client_type", client_types) -async def test_method_filters_many(httpx_mock: HTTPXMock, clients, mock_query_repository_page1_1, client_type): # pylint: disable=unused-argument +async def test_method_filters_many(httpx_mock: HTTPXMock, clients, mock_query_repository_page1_1, client_type): if client_type == "standard": repos = await clients.standard.filters( kind="CoreRepository", @@ -469,7 +469,7 @@ async def test_method_filters_many(httpx_mock: HTTPXMock, clients, mock_query_re @pytest.mark.parametrize("client_type", client_types) -async def test_method_filters_empty(httpx_mock: HTTPXMock, clients, mock_query_repository_page1_empty, client_type): # pylint: disable=unused-argument +async def test_method_filters_empty(httpx_mock: HTTPXMock, clients, mock_query_repository_page1_empty, client_type): if client_type == "standard": repos = await clients.standard.filters( kind="CoreRepository", @@ -710,7 +710,7 @@ async def test_allocate_next_ip_prefix( @pytest.mark.parametrize("client_type", client_types) -async def test_query_echo(httpx_mock: HTTPXMock, echo_clients, client_type): # pylint: disable=unused-argument +async def test_query_echo(httpx_mock: HTTPXMock, echo_clients, client_type): httpx_mock.add_response( method="POST", json={"data": {"BuiltinTag": {"edges": []}}}, diff --git a/tests/unit/sdk/test_graphql.py b/tests/unit/sdk/test_graphql.py index b9e88b05..de16fe02 100644 --- a/tests/unit/sdk/test_graphql.py +++ b/tests/unit/sdk/test_graphql.py @@ -2,8 +2,6 @@ from infrahub_sdk.graphql import Mutation, Query, render_input_block, render_query_block -# pylint: disable=redefined-outer-name - @pytest.fixture def query_data_no_filter(): diff --git a/tests/unit/sdk/test_node.py b/tests/unit/sdk/test_node.py index 34a8b4e3..cc7834d3 100644 --- a/tests/unit/sdk/test_node.py +++ b/tests/unit/sdk/test_node.py @@ -19,7 +19,6 @@ if TYPE_CHECKING: from infrahub_sdk.client import InfrahubClient, InfrahubClientSync -# pylint: disable=no-member,too-many-lines # type: ignore[attr-defined] async_node_methods = [ @@ -751,7 +750,7 @@ async def test_query_data_node_with_prefetch_relationships(clients, mock_schema_ @pytest.mark.parametrize("client_type", client_types) -async def test_query_data_generic_property(clients, mock_schema_query_02, client_type): # pylint: disable=unused-argument +async def test_query_data_generic_property(clients, mock_schema_query_02, client_type): if client_type == "standard": client: InfrahubClient = getattr(clients, client_type) # type: ignore[annotation-unchecked] corenode_schema: GenericSchema = await client.schema.get(kind="CoreNode") # type: ignore[annotation-unchecked] @@ -780,7 +779,7 @@ async def test_query_data_generic_property(clients, mock_schema_query_02, client @pytest.mark.parametrize("client_type", client_types) -async def test_query_data_generic_fragment_property(clients, mock_schema_query_02, client_type): # pylint: disable=unused-argument +async def test_query_data_generic_fragment_property(clients, mock_schema_query_02, client_type): if client_type == "standard": client: InfrahubClient = getattr(clients, client_type) # type: ignore[annotation-unchecked] corenode_schema: GenericSchema = await client.schema.get(kind="CoreNode") # type: ignore[annotation-unchecked] @@ -926,7 +925,7 @@ async def test_query_data_generic_fragment_property(clients, mock_schema_query_0 @pytest.mark.parametrize("client_type", client_types) -async def test_query_data_generic_fragment(clients, mock_schema_query_02, client_type): # pylint: disable=unused-argument +async def test_query_data_generic_fragment(clients, mock_schema_query_02, client_type): if client_type == "standard": client: InfrahubClient = getattr(clients, client_type) # type: ignore[annotation-unchecked] corenode_schema: GenericSchema = await client.schema.get(kind="CoreNode") # type: ignore[annotation-unchecked] @@ -1795,7 +1794,7 @@ async def test_node_fetch_relationship( tag_red_data, tag_blue_data, client_type, -): # pylint: disable=unused-argument +): response1 = { "data": { "BuiltinTag": { diff --git a/tests/unit/sdk/test_object_store.py b/tests/unit/sdk/test_object_store.py index 8da5d460..1cf6cd17 100644 --- a/tests/unit/sdk/test_object_store.py +++ b/tests/unit/sdk/test_object_store.py @@ -5,8 +5,6 @@ from infrahub_sdk.object_store import ObjectStore, ObjectStoreSync -# pylint: disable=redefined-outer-name,unused-argument - async_methods = [method for method in dir(ObjectStore) if not method.startswith("_")] sync_methods = [method for method in dir(ObjectStoreSync) if not method.startswith("_")] diff --git a/tests/unit/sdk/test_schema.py b/tests/unit/sdk/test_schema.py index 5c44e9c7..fcffb1c0 100644 --- a/tests/unit/sdk/test_schema.py +++ b/tests/unit/sdk/test_schema.py @@ -46,7 +46,7 @@ async def test_validate_method_signature(method): @pytest.mark.parametrize("client_type", client_types) -async def test_fetch_schema(mock_schema_query_01, client_type): # pylint: disable=unused-argument +async def test_fetch_schema(mock_schema_query_01, client_type): if client_type == "standard": client = InfrahubClient(config=Config(address="http://mock", insert_tracker=True)) nodes = await client.schema.fetch(branch="main")