This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
forked from open-mmlab/mmdetection
-
Notifications
You must be signed in to change notification settings - Fork 31
Enable type checks #208
Draft
druzhkov-paul
wants to merge
6
commits into
ote
Choose a base branch
from
dp/mypy
base: ote
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Enable type checks #208
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[mypy] | ||
python_version = 3.8 | ||
ignore_missing_imports = True | ||
show_error_codes = True | ||
check_untyped_defs = True | ||
strict = True | ||
|
||
[mypy-mmdet.core.*] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.datasets.*] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.integration.*] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.models.*] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.ops.*] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.parallel.*] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.utils.*] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.version] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.apis] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.apis.train] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.apis.test] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.apis.export] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.apis.inference] | ||
ignore_errors = True | ||
|
||
[mypy-mmdet.apis.fake_input] | ||
ignore_errors = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,47 @@ | ||
repos: | ||
- repo: https://gitlab.com/pycqa/flake8.git | ||
rev: 3.8.3 | ||
# - repo: https://gitlab.com/pycqa/flake8.git | ||
# rev: 3.8.3 | ||
# hooks: | ||
# - id: flake8 | ||
# - repo: https://github.com/asottile/seed-isort-config | ||
# rev: v2.2.0 | ||
# hooks: | ||
# - id: seed-isort-config | ||
# - repo: https://github.com/timothycrosley/isort | ||
# rev: 4.3.21 | ||
# hooks: | ||
# - id: isort | ||
# - repo: https://github.com/pre-commit/mirrors-yapf | ||
# rev: v0.30.0 | ||
# hooks: | ||
# - id: yapf | ||
# - repo: https://github.com/pre-commit/pre-commit-hooks | ||
# rev: v3.1.0 | ||
# hooks: | ||
# - id: trailing-whitespace | ||
# - id: check-yaml | ||
# - id: end-of-file-fixer | ||
# - id: requirements-txt-fixer | ||
# - id: double-quote-string-fixer | ||
# - id: check-merge-conflict | ||
# - id: fix-encoding-pragma | ||
# args: ["--remove"] | ||
# - id: mixed-line-ending | ||
# args: ["--fix=lf"] | ||
# - repo: https://github.com/jumanjihouse/pre-commit-hooks | ||
# rev: 2.1.4 | ||
# hooks: | ||
# - id: markdownlint | ||
# args: ["-r", "~MD002,~MD013,~MD024,~MD029,~MD033,~MD034,~MD036"] | ||
# - repo: https://github.com/myint/docformatter | ||
# rev: v1.3.1 | ||
# hooks: | ||
# - id: docformatter | ||
# args: ["--in-place", "--wrap-descriptions", "79"] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: 'v0.812' | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/asottile/seed-isort-config | ||
rev: v2.2.0 | ||
hooks: | ||
- id: seed-isort-config | ||
- repo: https://github.com/timothycrosley/isort | ||
rev: 4.3.21 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/pre-commit/mirrors-yapf | ||
rev: v0.30.0 | ||
hooks: | ||
- id: yapf | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.1.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: requirements-txt-fixer | ||
- id: double-quote-string-fixer | ||
- id: check-merge-conflict | ||
- id: fix-encoding-pragma | ||
args: ["--remove"] | ||
- id: mixed-line-ending | ||
args: ["--fix=lf"] | ||
- repo: https://github.com/jumanjihouse/pre-commit-hooks | ||
rev: 2.1.4 | ||
hooks: | ||
- id: markdownlint | ||
args: ["-r", "~MD002,~MD013,~MD024,~MD029,~MD033,~MD034,~MD036"] | ||
- repo: https://github.com/myint/docformatter | ||
rev: v1.3.1 | ||
hooks: | ||
- id: docformatter | ||
args: ["--in-place", "--wrap-descriptions", "79"] | ||
- id: mypy | ||
args: ["--config-file=.mypy.ini"] | ||
additional_dependencies: [numpy==1.19.5, types-PyYAML, attrs==21.2.*, types-requests, types-Deprecated, types-docutils, types_futures, types-python-dateutil] | ||
exclude: "ci|configs|data|demo|docker|docs|experiments|resources|tools|.dev_scripts|tests|setup.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
_e2e_pytest_addoption = None | ||
pass | ||
|
||
import config | ||
import e2e_config | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @LeonidBeynenson Please note. |
||
|
||
def pytest_addoption(parser): | ||
if _e2e_pytest_addoption: | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
from collections import namedtuple, OrderedDict | ||
from copy import deepcopy | ||
from pprint import pformat | ||
from typing import List, Optional, Union | ||
from typing import List, Optional, Tuple, Union | ||
|
||
import pytest | ||
import yaml | ||
|
@@ -34,10 +34,8 @@ | |
from ote_sdk.entities.model import ( | ||
ModelEntity, | ||
ModelFormat, | ||
ModelPrecision, | ||
ModelStatus, | ||
ModelOptimizationType, | ||
OptimizationMethod, | ||
) | ||
from ote_sdk.entities.model_template import parse_model_template, TargetDevice | ||
from ote_sdk.entities.optimization_parameters import OptimizationParameters | ||
|
@@ -53,7 +51,7 @@ | |
|
||
logger = logging.getLogger(__name__) | ||
|
||
def DATASET_PARAMETERS_FIELDS(): | ||
def DATASET_PARAMETERS_FIELDS() -> Tuple[str, ...]: | ||
return ('annotations_train', | ||
'images_train_dir', | ||
'annotations_val', | ||
|
@@ -63,7 +61,7 @@ def DATASET_PARAMETERS_FIELDS(): | |
) | ||
|
||
ROOT_PATH_KEY = '_root_path' | ||
DatasetParameters = namedtuple('DatasetParameters', DATASET_PARAMETERS_FIELDS()) | ||
DatasetParameters = namedtuple('DatasetParameters', DATASET_PARAMETERS_FIELDS()) # type: ignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @LeonidBeynenson Please note. |
||
|
||
@pytest.fixture | ||
def dataset_definitions_fx(request): | ||
|
@@ -659,7 +657,7 @@ class OTETestStage: | |
time the stage is called the exception is re-raised. | ||
""" | ||
def __init__(self, action: BaseOTETestAction, | ||
depends_stages: Optional[List['OTETestStage']]=None): | ||
depends_stages: Optional[List['OTETestStage']] = None): | ||
self.was_processed = False | ||
self.stored_exception = None | ||
self.action = action | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexanderDokuchaev Please note.