Skip to content

Commit

Permalink
⬆️ update pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindee committed Nov 28, 2024
1 parent 6cd40df commit f03f3ff
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 24 additions & 9 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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

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

Expand All @@ -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=

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mindee/mindee_http/base_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mindee/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "wheel"]
requires = ["setuptools >= 68.0.0", "wheel >= 0.40.0"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -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",
Expand All @@ -60,7 +60,6 @@ docs = [
"sphinx-autodoc-typehints~=1.20",
]
build = [
"setuptools==57.5.0",
"build",
"twine",
]
Expand Down

0 comments on commit f03f3ff

Please sign in to comment.