Skip to content

Commit 5de3327

Browse files
authored
Merge pull request #816 from superannotateai/FRIDAY-4370
update packaging depandancy, change logging handlers
2 parents dbaed96 + f483701 commit 5de3327

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: black
1515
name: Code Formatter (black)
1616
- repo: 'https://github.com/PyCQA/flake8'
17-
rev: 3.8.2
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

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pydantic>=1.10,!=2.0.*
22
aiohttp~=3.8
33
boto3~=1.26
44
opencv-python-headless~=4.7
5-
packaging~=24.0
5+
packaging>=24.0,<26.0
66
plotly~=5.14
77
pandas~=2.0
88
pillow>=9.5,~=10.0

requirements_extra.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
setuptools~=67.7
22
wheel~=0.40
3-
Sphinx==6.2.1
4-
tox==4.5.1
3+
Sphinx~=6.2.1
4+
tox~=4.0
55
sphinx_rtd_theme==1.2.0
66
furo==2023.3.27
77
jaraco.tidelift==1.5.1
88
sphinx-notfound-page==0.8.3
99
sphinx_inline_tabs==2023.4.21
10-
pytest==7.3.1
10+
pytest~=8.0
1111
pytest-xdist==3.2.1
1212
pytest-parallel==0.1.1
1313
pytest-cov==4.0.0

src/superannotate/lib/app/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,5 @@ def wrap_error(errors_list: List[Tuple[str, str]]) -> str:
123123
_tabulation = tabulation - len(key)
124124
if not key:
125125
key, value, _tabulation = value, "", 0
126-
msgs.append(f'{key}{ " " * _tabulation}{value}')
126+
msgs.append(f'{key}{" " * _tabulation}{value}')
127127
return "\n".join(msgs)

src/superannotate/lib/core/__init__.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
import os
3+
import sys
34
from logging import Formatter
45
from logging.handlers import RotatingFileHandler
56
from os.path import expanduser
@@ -36,10 +37,21 @@ def setup_logging(level=DEFAULT_LOGGING_LEVEL, file_path=LOG_FILE_LOCATION):
3637
logger.removeHandler(handler)
3738
logger.propagate = False
3839
logger.setLevel(level)
39-
stream_handler = logging.StreamHandler()
40+
41+
# Separate handlers for different log levels
42+
stdout_handler = logging.StreamHandler(sys.stdout)
43+
stdout_handler.setLevel(logging.DEBUG)
44+
stdout_handler.addFilter(lambda record: record.levelno < logging.WARNING)
45+
46+
stderr_handler = logging.StreamHandler(sys.stderr)
47+
stderr_handler.setLevel(logging.WARNING)
48+
4049
formatter = Formatter("SA-PYTHON-SDK - %(levelname)s - %(message)s")
41-
stream_handler.setFormatter(formatter)
42-
logger.addHandler(stream_handler)
50+
stdout_handler.setFormatter(formatter)
51+
stderr_handler.setFormatter(formatter)
52+
53+
logger.addHandler(stdout_handler)
54+
logger.addHandler(stderr_handler)
4355
try:
4456
os.makedirs(file_path, exist_ok=True)
4557
log_file_path = os.path.join(file_path, "sa.log")

0 commit comments

Comments
 (0)