From f03f3ff9cba544cbe527099d8a72c1e8d494b87c Mon Sep 17 00:00:00 2001 From: Mindee Date: Thu, 28 Nov 2024 15:20:20 +0100 Subject: [PATCH] :arrow_up: update pylint --- .pre-commit-config.yaml | 2 +- .pylintrc | 33 +++++++++++++++++++++-------- mindee/mindee_http/base_settings.py | 4 ++-- mindee/versions.py | 2 +- pyproject.toml | 5 ++--- 5 files changed, 30 insertions(+), 16 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e1103c73..6232f59a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: - id: gitleaks - repo: https://github.com/PyCQA/pylint - rev: v3.2.7 + rev: v3.3.1 hooks: - id: pylint name: pylint diff --git a/.pylintrc b/.pylintrc index 89ad2322..a5c1bc55 100644 --- a/.pylintrc +++ b/.pylintrc @@ -39,7 +39,7 @@ extension-pkg-whitelist= fail-on= # Specify a score threshold under which the program will exit with error. -fail-under=10.0 +fail-under=10 # Interpret the stdin as a python script, whose filename needs to be passed as # the module_or_package argument. @@ -59,10 +59,11 @@ ignore-paths=tests,docs,examples,^mindee/product/fr/carte_grise/.*$ # Emacs file locks ignore-patterns=^\.# -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis). It -# supports qualified module names, as well as Unix pattern matching. +# List of module names for which member attributes should not be checked and +# will not be imported (useful for modules/projects where namespaces are +# manipulated during runtime and thus existing member attributes cannot be +# deduced by static analysis). It supports qualified module names, as well as +# Unix pattern matching. ignored-modules= # Python code to execute, usually for sys.path manipulation such as @@ -86,6 +87,10 @@ load-plugins= # Pickle collected data for later comparisons. persistent=yes +# Resolve imports to .pyi stubs if available. May reduce no-member messages and +# increase not-an-iterable messages. +prefer-stubs=no + # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. #py-version=3.8 @@ -127,7 +132,7 @@ attr-naming-style=snake_case # Regular expression matching correct attribute names. Overrides attr-naming- # style. If left empty, attribute names will be checked with the set naming # style. -attr-rgx=[a-z_][a-z0-9_]{1,40}$ +#attr-rgx= # Bad variable names which should always be refused, separated by a comma. bad-names=foo, @@ -302,6 +307,9 @@ max-locals=15 # Maximum number of parents for a class (see R0901). max-parents=7 +# Maximum number of positional arguments for function / method. +max-positional-arguments=5 + # Maximum number of public methods for a class (see R0904). max-public-methods=20 @@ -426,6 +434,7 @@ disable=duplicate-code, missing-module-docstring, too-many-instance-attributes, too-many-arguments, + too-many-positional-arguments, # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option @@ -463,6 +472,11 @@ max-nested-blocks=5 # printed. never-returning-functions=sys.exit,argparse.parse_error +# Let 'consider-using-join' be raised when the separator to join on would be +# non-empty (resulting in expected fixes of the type: ``"- " + " - +# ".join(items)``) +suggest-join-with-non-empty-separator=yes + [REPORTS] @@ -477,8 +491,9 @@ evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor # used to format the message information. See doc for all details. msg-template= -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio). You can also give a reporter class, e.g. +# Set the output format. Available formats are: text, parseable, colorized, +# json2 (improved json format), json (old json format) and msvs (visual +# studio). You can also give a reporter class, e.g. # mypackage.mymodule.MyReporterClass. #output-format= @@ -513,7 +528,7 @@ min-similarity-lines=4 max-spelling-suggestions=4 # Spelling dictionary name. No available dictionaries : You need to install -# both the python package and the system dependency for enchant to work.. +# both the python package and the system dependency for enchant to work. spelling-dict= # List of comma separated words that should be considered directives if they diff --git a/mindee/mindee_http/base_settings.py b/mindee/mindee_http/base_settings.py index c83e0869..1eea385e 100644 --- a/mindee/mindee_http/base_settings.py +++ b/mindee/mindee_http/base_settings.py @@ -3,7 +3,7 @@ from typing import Dict, Optional, Union from mindee.logger import logger -from mindee.versions import __version__, get_platform, python_version +from mindee.versions import PYTHON_VERSION, __version__, get_platform API_KEY_ENV_NAME = "MINDEE_API_KEY" API_KEY_DEFAULT = "" @@ -15,7 +15,7 @@ TIMEOUT_DEFAULT = 120 PLATFORM = get_platform() -USER_AGENT = f"mindee-api-python@v{__version__} python-v{python_version} {PLATFORM}" +USER_AGENT = f"mindee-api-python@v{__version__} python-v{PYTHON_VERSION} {PLATFORM}" @dataclass diff --git a/mindee/versions.py b/mindee/versions.py index b2f5f3cf..1efbf59a 100644 --- a/mindee/versions.py +++ b/mindee/versions.py @@ -2,7 +2,7 @@ __version__ = "4.15.0" -python_version = f"{sys.version_info[0]}.{sys.version_info[1]}" +PYTHON_VERSION = f"{sys.version_info[0]}.{sys.version_info[1]}" def get_platform() -> str: diff --git a/pyproject.toml b/pyproject.toml index 69110129..d8a5fc79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "wheel"] +requires = ["setuptools >= 68.0.0", "wheel >= 0.40.0"] build-backend = "setuptools.build_meta" [project] @@ -44,7 +44,7 @@ Changelog = "https://github.com/mindee/mindee-api-python/blob/main/CHANGELOG.md" [project.optional-dependencies] lint = [ - "pylint==3.2.7", + "pylint==3.3.1", "pre-commit~=3.2.2", "types-pytz>=2023.3", "types-requests>=2.31", @@ -60,7 +60,6 @@ docs = [ "sphinx-autodoc-typehints~=1.20", ] build = [ - "setuptools==57.5.0", "build", "twine", ]