Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang

<!-- towncrier release notes start -->

## [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
Expand Down
4 changes: 2 additions & 2 deletions infrahub_sdk/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion infrahub_sdk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion infrahub_sdk/ctl/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
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:

Check warning on line 124 in infrahub_sdk/ctl/check.py

View check run for this annotation

Codecov / codecov/patch

infrahub_sdk/ctl/check.py#L124

Added line #L124 was not covered by tests
log.warning(f"{module_name}::{check}: An error occurred during execution ({exc})")
passed = False

Expand Down
4 changes: 2 additions & 2 deletions infrahub_sdk/ctl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion infrahub_sdk/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 1 addition & 4 deletions infrahub_sdk/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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 = {}

Expand Down Expand Up @@ -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] = {}

Expand Down Expand Up @@ -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] = {}

Expand Down
1 change: 0 additions & 1 deletion infrahub_sdk/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
StringOptional,
)

# pylint: disable=too-many-ancestors

# ---------------------------------------------
# ASYNC
Expand Down
3 changes: 0 additions & 3 deletions infrahub_sdk/schema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@
]


# pylint: disable=redefined-builtin


class DropdownMutationOptionalArgs(TypedDict):
color: str | None
description: str | None
Expand Down
2 changes: 1 addition & 1 deletion infrahub_sdk/transfer/exporter/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
85 changes: 2 additions & 83 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 1 addition & 49 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <info@opsmill.com>"]
readme = "README.md"
Expand Down Expand Up @@ -59,7 +59,6 @@ pytest-clarity = "^1.0.1"
pytest-cov = "^4.0.0"
pytest-httpx = ">=0.30"
yamllint = "*"
pylint = "*"
mypy = "*"
ipython = "*"
requests = "*"
Expand Down Expand Up @@ -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"]
Expand Down
1 change: 0 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_export_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# MANUFACTURER_KIND = "TestingManufacturer"
# TAG_KIND = "TestingTag"
#
# # pylint: disable=unused-argument
#
#
#
# class TestSchemaExportImportBase(TestInfrahubApp):
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_infrahub_client_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# from infrahub.database import InfrahubDatabase
#
#
# # pylint: disable=unused-argument
#
#
#
# class TestInfrahubClientSync:
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# from .conftest import InfrahubTestClient
#
# # pylint: disable=unused-argument
#
#
#
# class TestInfrahubSchema:
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/ctl/test_branch_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
Loading