Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove flake8 references #1475

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

22 changes: 15 additions & 7 deletions labelme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# flake8: noqa

import logging
import sys

from qtpy import QT_VERSION


__appname__ = "labelme"

# Semantic Versioning 2.0.0: https://semver.org/
Expand All @@ -17,12 +13,24 @@

QT4 = QT_VERSION[0] == "4"
QT5 = QT_VERSION[0] == "5"
del QT_VERSION

PY2 = sys.version[0] == "2"
PY3 = sys.version[0] == "3"
del sys

from labelme.label_file import LabelFile
# These need to be later than the above definitions due to
# circular import dependencies.

from labelme import testing
from labelme import utils
from labelme.label_file import LabelFile

__all__ = [
"__appname__",
"LabelFile",
"PY2",
"PY3",
"QT4",
"QT5",
"testing",
"utils",
]
9 changes: 7 additions & 2 deletions labelme/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# flake8: noqa

from . import draw_json
from . import draw_label_png
from . import export_json
from . import on_docker

__all__ = [
'draw_json',
'draw_label_png',
'export_json',
'on_docker',
]
48 changes: 35 additions & 13 deletions labelme/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# flake8: noqa

from ._io import lblsave

from .image import apply_exif_orientation
from .image import img_arr_to_b64
from .image import img_arr_to_data
Expand All @@ -11,19 +8,44 @@
from .image import img_data_to_png_data
from .image import img_pil_to_data
from .image import img_qt_to_arr

from .qt import addActions
from .qt import distance
from .qt import distancetoline
from .qt import fmtShortcut
from .qt import labelValidator
from .qt import newAction
from .qt import newButton
from .qt import newIcon
from .qt import struct
from .shape import labelme_shapes_to_label
from .shape import masks_to_bboxes
from .shape import polygons_to_mask
from .shape import shape_to_mask
from .shape import shapes_to_label

from .qt import newIcon
from .qt import newButton
from .qt import newAction
from .qt import addActions
from .qt import labelValidator
from .qt import struct
from .qt import distance
from .qt import distancetoline
from .qt import fmtShortcut
__all__ = [
"addActions",
"apply_exif_orientation",
"distance",
"distancetoline",
"fmtShortcut",
"img_arr_to_b64",
"img_arr_to_data",
"img_b64_to_arr",
"img_data_to_arr",
"img_data_to_pil",
"img_data_to_png_data",
"img_pil_to_data",
"img_qt_to_arr",
"labelValidator",
"labelme_shapes_to_label",
"lblsave",
"masks_to_bboxes",
"newAction",
"newButton",
"newIcon",
"polygons_to_mask",
"shape_to_mask",
"shapes_to_label",
"struct",
]
26 changes: 15 additions & 11 deletions labelme/widgets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# flake8: noqa

from .ai_prompt_widget import AiPromptWidget

from .brightness_contrast_dialog import BrightnessContrastDialog

from .canvas import Canvas

from .color_dialog import ColorDialog

from .file_dialog_preview import FileDialogPreview

from .label_dialog import LabelDialog
from .label_dialog import LabelQLineEdit

from .label_list_widget import LabelListWidget
from .label_list_widget import LabelListWidgetItem

from .tool_bar import ToolBar

from .unique_label_qlist_widget import UniqueLabelQListWidget

from .zoom_widget import ZoomWidget

__all__ = [
"AiPromptWidget",
"BrightnessContrastDialog",
"Canvas",
"ColorDialog",
"FileDialogPreview",
"LabelDialog",
"LabelQLineEdit",
"LabelListWidget",
"LabelListWidgetItem",
"ToolBar",
"UniqueLabelQListWidget",
"ZoomWidget",
]
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github2pypi==1.0.0
pytest
pytest-qt
ruff==0.1.9
ruff==0.5.7
twine
5 changes: 5 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ line-ending = "auto"

[lint.isort]
force-single-line = true

[lint.per-file-ignores]
"**/__init__.py" = [
"E402", # module level import not at top of file
]