Skip to content

Commit 604f84b

Browse files
chore: upgrade pylint to latest version
1 parent 7c730ee commit 604f84b

File tree

7 files changed

+13
-15
lines changed

7 files changed

+13
-15
lines changed

.pylintrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ recursive=no
9999
# source root.
100100
source-roots=
101101

102-
# When enabled, pylint would attempt to guess common misconfiguration and emit
103-
# user-friendly hints instead of false-positive error messages.
104-
suggestion-mode=yes
105-
106102
# Allow loading of arbitrary C extensions. Extensions are imported into the
107103
# active Python interpreter and may run arbitrary code.
108104
unsafe-load-any-extension=no
@@ -437,6 +433,7 @@ disable=raw-checker-failed,
437433
too-few-public-methods,
438434
too-many-ancestors,
439435
too-many-arguments,
436+
too-many-positional-arguments,
440437
too-many-instance-attributes,
441438
too-many-locals,
442439
fixme,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ dev = [
7171
"pymdown-extensions",
7272
# linting
7373
"pre-commit >= 3.3.0, < 4.0.0",
74-
"pylint ==3.0.3",
74+
"pylint == 4.0.3",
7575
"pyright ==1.1.347",
7676
# notebooks tests
7777
"nbformat",

src/kili/core/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"LLM": "application/json",
2020
}
2121

22-
mime_extensions_for_IV2 = {
22+
MIME_EXTENSIONS_FOR_IV2 = {
2323
"AUDIO": mime_extensions["Audio"],
2424
"IMAGE": mime_extensions["Image"],
2525
"GEOSPATIAL": mime_extensions["Geospatial"],

src/kili/core/helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import tenacity
1717

1818
from kili.adapters.http_client import HttpClient
19-
from kili.core.constants import mime_extensions_for_IV2
19+
from kili.core.constants import MIME_EXTENSIONS_FOR_IV2
2020
from kili.log.logging import logger
2121

2222
T = TypeVar("T")
@@ -288,15 +288,15 @@ def check_file_mime_type(path: str, input_type: str, raise_error=True) -> bool:
288288
"""Returns true if the mime type of the file corresponds to the allowed mime types of the project."""
289289
mime_type = get_mime_type(path.lower())
290290

291-
if not (mime_extensions_for_IV2[input_type] and mime_type):
291+
if not (MIME_EXTENSIONS_FOR_IV2[input_type] and mime_type):
292292
return False
293293

294-
correct_mime_type = mime_type in mime_extensions_for_IV2[input_type]
294+
correct_mime_type = mime_type in MIME_EXTENSIONS_FOR_IV2[input_type]
295295
if not correct_mime_type and raise_error:
296296
raise ValueError(
297297
f"File mime type for {path} is {mime_type} and does not correspond "
298298
"to the type of the project. "
299-
f"File mime type should be one of {mime_extensions_for_IV2[input_type]}"
299+
f"File mime type should be one of {MIME_EXTENSIONS_FOR_IV2[input_type]}"
300300
)
301301
return correct_mime_type
302302

src/kili/entrypoints/cli/project/create.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def create_project(
7373
if ((interface is not None) + (project_id_src is not None)) == 0:
7474
raise ValueError("You must use either interface argument or option --from-project")
7575

76+
json_interface: dict
7677
if interface is not None:
7778
with open(interface, encoding="utf-8") as interface_file:
7879
json_interface = json.load(interface_file)

src/kili/services/asset_import/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Constants for the asset_import services."""
22

3-
from kili.core.constants import mime_extensions_for_IV2
3+
from kili.core.constants import MIME_EXTENSIONS_FOR_IV2
44

5-
project_compatible_mimetypes = mime_extensions_for_IV2
5+
project_compatible_mimetypes = MIME_EXTENSIONS_FOR_IV2
66

77
IMPORT_BATCH_SIZE = 100
88
FRAME_IMPORT_BATCH_SIZE = 1

src/kili/use_cases/label/process_shapefiles.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
from shapely.geometry import LinearRing, LineString, Point, Polygon
1515
from shapely.ops import transform
1616

17-
SHAPELY_INSTALLED = True
17+
shapely_installed = True
1818
try:
1919
from shapely.geometry import LinearRing, LineString, Point, Polygon
2020
from shapely.ops import transform
2121
except ImportError:
22-
SHAPELY_INSTALLED = False
22+
shapely_installed = False
2323

2424

2525
def _read_shapefile_header(file_handle):
@@ -236,7 +236,7 @@ def get_json_response_from_shapefiles(
236236
if len(shapefile_paths) != len(job_names) or len(shapefile_paths) != len(category_names):
237237
raise ValueError("Shapefile paths, job names, and category names must have the same length")
238238

239-
if not SHAPELY_INSTALLED:
239+
if not shapely_installed:
240240
raise ImportError("Install with `pip install kili[gis]` to use GIS features.")
241241

242242
json_response = {}

0 commit comments

Comments
 (0)