Skip to content

Commit 9071f27

Browse files
authored
Merge pull request #835 from superannotateai/pydantic_V2
Pydantic v2
2 parents e1f1861 + a035ca1 commit 9071f27

115 files changed

Lines changed: 753 additions & 908 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: 'https://github.com/asottile/reorder_python_imports'
3-
rev: v3.13.0
3+
rev: v3.16.0
44
hooks:
55
- id: reorder-python-imports
66
exclude: src/lib/app/analytics | src/lib/app/converters | src/lib/app/input_converters
@@ -9,12 +9,12 @@ repos:
99
- '--application-directories'
1010
- app
1111
- repo: 'https://github.com/python/black'
12-
rev: 22.3.0
12+
rev: 26.1.0
1313
hooks:
1414
- id: black
1515
name: Code Formatter (black)
1616
- repo: 'https://github.com/PyCQA/flake8'
17-
rev: 6.1.0
17+
rev: 7.3.0
1818
hooks:
1919
- id: flake8
2020
exclude: src/lib/app/analytics | src/lib/app/converters | src/lib/app/input_converters
@@ -23,15 +23,15 @@ repos:
2323
- '--max-line-length=120'
2424
- --ignore=D100,D203,D405,W503,E203,E501,F841,E126,E712,E123,E131,F821,E121,W605,E402
2525
- repo: 'https://github.com/asottile/pyupgrade'
26-
rev: v2.4.3
26+
rev: v3.21.2
2727
hooks:
2828
- id: pyupgrade
2929
exclude: src/lib/app/analytics | src/lib/app/converters | src/lib/app/input_converters
3030
name: Upgrade syntax for newer versions of the language (pyupgrade)
3131
args:
3232
- '--py37-plus'
3333
- repo: 'https://github.com/PyCQA/doc8'
34-
rev: v1.1.1
34+
rev: v2.0.0
3535
hooks:
3636
- id: doc8
3737
name: doc8

log.txt

Whitespace-only changes.

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
55
;pytest_plugins = ['pytest_profiling']
6-
addopts = -n 6 --dist loadscope
6+
;addopts = -n 6 --dist loadscope

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
pydantic>=1.10,<3,!=2.0.*
1+
pydantic~=2.5
2+
pydantic-extra-types~=2.11
23
aiohttp~=3.8
34
boto3~=1.42
45
opencv-python-headless~=4.7
@@ -10,4 +11,5 @@ requests~=2.32
1011
aiofiles~=25.1
1112
fire~=0.7
1213
mixpanel~=5.1
14+
typing_extensions~=4.15
1315
superannotate-schemas==1.0.49

src/superannotate/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import sys
44

5-
65
__version__ = "4.5.2"
76

87

@@ -22,7 +21,6 @@
2221
from superannotate.lib.app.interface.sdk_interface import SAClient
2322
from superannotate.lib.app.interface.sdk_interface import ItemContext
2423

25-
2624
SESSIONS = {}
2725

2826

src/superannotate/lib/app/analytics/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import plotly.express as px
77
from lib.core.exceptions import AppException
88

9-
109
logger = logging.getLogger("sa")
1110

1211

src/superannotate/lib/app/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ def blue_color_generator(n, hex_values=True):
2424
)
2525
hex_color = (
2626
"#"
27-
+ "{:02x}".format(bgr_color[2])
27+
+ f"{bgr_color[2]:02x}"
2828
+ "{:02x}".format(
2929
bgr_color[1],
3030
)
31-
+ "{:02x}".format(bgr_color[0])
31+
+ f"{bgr_color[0]:02x}"
3232
)
3333
if hex_values:
3434
hex_colors.append(hex_color)

src/superannotate/lib/app/input_converters/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from lib.app.input_converters.conversion import export_annotation
22
from lib.app.input_converters.conversion import import_annotation
33

4-
54
__all__ = [
65
"export_annotation",
76
"import_annotation",

src/superannotate/lib/app/input_converters/conversion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Main module for input converters
33
"""
4+
45
import os
56
import shutil
67
import tempfile
@@ -15,7 +16,6 @@
1516
from .export_from_sa_conversions import export_from_sa
1617
from .import_to_sa_conversions import import_to_sa
1718

18-
1919
ALLOWED_TASK_TYPES = [
2020
"panoptic_segmentation",
2121
"instance_segmentation",
@@ -108,7 +108,7 @@ def _passes_value_sanity(values_info):
108108
for value in values_info:
109109
if value[0] not in value[2]:
110110
raise AppException(
111-
"'{}' should be one of the following '{}'".format(value[1], value[2])
111+
f"'{value[1]}' should be one of the following '{value[2]}'"
112112
)
113113

114114

src/superannotate/lib/app/input_converters/converters/baseStrategy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
"""
2-
"""
1+
""" """
2+
33
import logging
44

55
from .coco_converters.coco_to_sa_vector import coco_instance_segmentation_to_sa_vector

0 commit comments

Comments
 (0)