diff --git a/.gitattributes b/.gitattributes index e19fdd3..3073225 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ # Ensure Docker script files uses LF to support Docker for Windows. # Ensure "git config --global core.autocrlf input" before you clone * text eol=lf -*.py whitespace=error \ No newline at end of file +*.py whitespace=error diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index 417d671..0000000 --- a/.pylintrc +++ /dev/null @@ -1,2 +0,0 @@ -[FORMAT] -max-line-length=140 diff --git a/sagemcom_api/client.py b/sagemcom_api/client.py index 2645e40..89d6192 100644 --- a/sagemcom_api/client.py +++ b/sagemcom_api/client.py @@ -40,6 +40,7 @@ ) from .models import Device, DeviceInfo, PortMapping + # pylint: disable=too-many-instance-attributes class SagemcomClient: """Client to communicate with the Sagemcom API.""" @@ -54,7 +55,7 @@ def __init__( password: str, authentication_method: EncryptionMethod, session: ClientSession | None = None, - ssl: bool | None = False, + ssl: bool | None = False, verify_ssl: bool | None = True, ): """ @@ -292,9 +293,7 @@ async def logout(self): self._server_nonce = "" self._request_id = -1 - async def get_value_by_xpath( - self, xpath: str, options: dict | None = None - ) -> dict: + async def get_value_by_xpath(self, xpath: str, options: dict | None = None) -> dict: """ Retrieve raw value from router using XPath. diff --git a/sagemcom_api/enums.py b/sagemcom_api/enums.py index 4f85208..1240c3b 100644 --- a/sagemcom_api/enums.py +++ b/sagemcom_api/enums.py @@ -1,6 +1,6 @@ """Enums for the Sagemcom F@st client.""" -import sys from enum import unique +import sys # Since we support Python versions lower than 3.11, we use # a backport for StrEnum when needed. @@ -9,6 +9,7 @@ else: from backports.strenum import StrEnum + @unique class EncryptionMethod(StrEnum): """Encryption method defining the password hash.""" diff --git a/sagemcom_api/models.py b/sagemcom_api/models.py index 1dfe433..09ec31c 100644 --- a/sagemcom_api/models.py +++ b/sagemcom_api/models.py @@ -4,6 +4,7 @@ from dataclasses import dataclass from typing import Any, List, Optional + # pylint: disable=too-many-instance-attributes @dataclass class Device: @@ -66,6 +67,7 @@ def name(self): """Return name of the device.""" return self.user_host_name or self.host_name + # pylint: disable=too-many-instance-attributes @dataclass class DeviceInfo: @@ -100,11 +102,11 @@ class DeviceInfo: reboot_status: Optional[float] = None reset_status: Optional[float] = None update_status: Optional[float] = None - SNMP: Optional[bool] = None # pylint: disable=invalid-name + SNMP: Optional[bool] = None # pylint: disable=invalid-name first_connection: Optional[bool] = None build_date: Optional[str] = None spec_version: Optional[str] = None - CLID: Optional[str] = None # pylint: disable=invalid-name + CLID: Optional[str] = None # pylint: disable=invalid-name flush_device_log: Optional[bool] = None locations: Optional[str] = None api_version: Optional[str] = None diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..a5e9243 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,5 @@ +[flake8] +ignore = E501 + +[pylint.FORMAT] +max-line-length=140 diff --git a/tests/test_sagemcom.py b/tests/test_sagemcom.py index 7afd7be..3927aab 100644 --- a/tests/test_sagemcom.py +++ b/tests/test_sagemcom.py @@ -1,8 +1 @@ """Test for Sagemcom F@st client.""" - -from sagemcom_api import __version__ - - -def test_version(): - """Test if version number is 1.0.0.""" - assert __version__ == "1.0.0"