-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix: Exit if any config error #15880
Open
cibinmathew
wants to merge
2
commits into
python:master
Choose a base branch
from
cibinmathew:config-error
base: master
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.
Open
Conversation
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
cibinmathew
force-pushed
the
config-error
branch
4 times, most recently
from
August 15, 2023 23:08
b58e5c7
to
98f8555
Compare
This comment has been minimized.
This comment has been minimized.
ikonst
reviewed
Aug 15, 2023
mypy/main.py
Outdated
Comment on lines
1255
to
1256
stderr.write(f"{err}") | ||
sys.exit(1) |
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.
Suggested change
stderr.write(f"{err}") | |
sys.exit(1) | |
raise SystemExit(str(err)) |
cibinmathew
force-pushed
the
config-error
branch
2 times, most recently
from
August 16, 2023 23:13
ab49054
to
c960d2a
Compare
This comment has been minimized.
This comment has been minimized.
cibinmathew
force-pushed
the
config-error
branch
from
August 17, 2023 00:09
c960d2a
to
cdb6254
Compare
This comment has been minimized.
This comment has been minimized.
cibinmathew
force-pushed
the
config-error
branch
from
August 22, 2023 20:42
cdb6254
to
8b59ac2
Compare
This comment has been minimized.
This comment has been minimized.
cibinmathew
force-pushed
the
config-error
branch
from
September 6, 2023 23:57
8b59ac2
to
4f693f3
Compare
This comment has been minimized.
This comment has been minimized.
cibinmathew
force-pushed
the
config-error
branch
from
October 3, 2023 21:34
4f693f3
to
44a8eb0
Compare
Diff from mypy_primer, showing the effect of this PR on open source code: pybind11 (https://github.com/pybind/pybind11): typechecking got 113.40x faster (18.0s -> 0.2s)
(Performance measurements are based on a single noisy sample)
- setup.py:16: error: Skipping analyzing "setuptools.command.sdist": module is installed, but missing library stubs or py.typed marker [import-untyped]
- setup.py:16: error: Skipping analyzing "setuptools.command": module is installed, but missing library stubs or py.typed marker [import-untyped]
- setup.py:16: error: Skipping analyzing "setuptools": module is installed, but missing library stubs or py.typed marker [import-untyped]
- setup.py:99: error: Class cannot subclass "sdist" (has type "Any") [misc]
- pybind11/setup_helpers.py:66: error: Skipping analyzing "setuptools": module is installed, but missing library stubs or py.typed marker [import-untyped]
- pybind11/setup_helpers.py:67: error: Skipping analyzing "setuptools.command.build_ext": module is installed, but missing library stubs or py.typed marker [import-untyped]
- pybind11/setup_helpers.py:67: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
- pybind11/setup_helpers.py:69: error: Unused "type: ignore" comment [unused-ignore]
- pybind11/setup_helpers.py:70: error: Unused "type: ignore" comment [unused-ignore]
- pybind11/setup_helpers.py:87: error: Class cannot subclass "_Extension" (has type "Any") [misc]
- pybind11/setup_helpers.py:269: error: Class cannot subclass "_build_ext" (has type "Any") [misc]
dragonchain (https://github.com/dragonchain/dragonchain): typechecking got 169.71x faster (25.9s -> 0.2s)
(Performance measurements are based on a single noisy sample)
- dragonchain/lib/dto/eth_utest.py:51:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/eth_utest.py:72:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/eth_utest.py:77:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/eth_utest.py:88:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/eth_utest.py:115:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/eth_utest.py:123:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/eth_utest.py:131:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/interfaces/registry.py:28:5: error: Name "registry" already defined (by an import) [no-redef]
- dragonchain/lib/dto/btc_utest.py:51:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:56:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:61:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:62:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:70:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:77:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:84:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:90:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:101:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:108:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:114:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:120:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:125:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:131:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/dto/btc_utest.py:138:9: error: Cannot assign to a method [method-assign]
- dragonchain/lib/database/redis.py:399:36: error: Argument 2 to "zadd" of "SortedSetCommands" has incompatible type "Dict[str, int]"; expected "Mapping[Union[str, bytes], Union[bytes, float, int, str]]" [arg-type]
- dragonchain/lib/interfaces/storage.py:42:5: error: Name "storage" already defined (by an import) [no-redef]
- dragonchain/lib/database/redis_utest.py:32:30: error: Incompatible types in assignment (expression has type "None", variable has type "Redis[Any]") [assignment]
- dragonchain/lib/database/redis_utest.py:38:34: error: Incompatible types in assignment (expression has type "None", variable has type "Redis[Any]") [assignment]
- dragonchain/lib/database/redis_utest.py:46:9: error: "Callable[[str, int, int], Coroutine[Any, Any, Any]]" has no attribute "assert_called_once" [attr-defined]
- dragonchain/lib/database/redis_utest.py:61:42: error: Argument 2 to "zadd_async" has incompatible type "str"; expected "int" [arg-type]
- dragonchain/lib/database/redis_utest.py:102:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str], Union[None, float, timedelta], Union[None, float, timedelta], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:106:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str], Union[None, float, timedelta], Union[None, float, timedelta], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:110:9: error: "Callable[[Union[str, bytes]], Optional[Any]]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:114:9: error: "Callable[[VarArg(Union[str, bytes])], int]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:122:9: error: "Callable[[bool, KwArg(Union[Any, Any])], bool]" has no attribute "assert_called_once" [attr-defined]
- dragonchain/lib/database/redis_utest.py:126:9: error: "Callable[[Union[str, bytes], VarArg(Union[str, bytes])], int]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:130:9: error: "Callable[[Union[bytes, float, int, str], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:134:9: error: "Callable[[Union[bytes, float, int, str], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:138:9: error: "Callable[[VarArg(Union[str, bytes])], int]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:142:9: error: overloaded function has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:146:9: error: overloaded function has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:150:9: error: "Callable[[Any, Any, Optional[int]], Any]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:154:9: error: "Callable[[Union[str, bytes]], Optional[Any]]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:158:9: error: "Callable[[Union[str, bytes], int], Optional[Any]]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:162:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str], Union[None, float, timedelta], Union[None, float, timedelta], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:166:9: error: "Callable[[Union[str, bytes], int, int], bool]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:170:9: error: "Callable[[Union[str, bytes], Union[str, bytes]], Optional[Any]]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:174:9: error: "Callable[[Union[str, bytes], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:178:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str]], bool]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:182:9: error: "Callable[[Union[str, bytes]], Set[Any]]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:186:9: error: "Callable[[Union[str, bytes], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:190:9: error: "Callable[[Union[str, bytes], int, int], List[Any]]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:194:9: error: "Redis[Any]" has no attribute "pipelineassert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:198:9: error: "Callable[[Union[str, bytes]], int]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:202:9: error: "Callable[[Any, Any], Any]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:206:9: error: "Callable[[Any, Optional[int]], Any]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:210:9: error: "Callable[[Union[str, bytes]], Dict[Any, Any]]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:214:9: error: "Callable[[Union[str, bytes], Union[str, bytes]], bool]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/database/redis_utest.py:217:35: error: Argument 2 to "zadd_sync" has incompatible type "str"; expected "Dict[str, int]" [arg-type]
- dragonchain/lib/database/redis_utest.py:218:9: error: "Callable[[Union[str, bytes], Mapping[Union[str, bytes], Union[bytes, float, int, str]], bool, bool, bool, bool, Optional[Any], Optional[Any]], int]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/error_reporter.py:37:5: error: Incompatible import of "reporter" (imported name has type "Callable[[str], None]", local name has type "Callable[[str, str], None]") [assignment]
- dragonchain/lib/interfaces/storage_utest.py:47:9: error: Module has no attribute "cache_condition" [attr-defined]
- dragonchain/lib/interfaces/storage_utest.py:55:9: error: "Callable[[str, str], bytes]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/interfaces/storage_utest.py:75:9: error: "Callable[[str, str, bytes], None]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/interfaces/storage_utest.py:83:9: error: "Callable[[str, Union[str, bytes], Optional[int], str], bool]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/interfaces/storage_utest.py:87:9: error: "Callable[[str, str], None]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/interfaces/storage_utest.py:95:9: error: "Callable[[str, str], int]" has no attribute "assert_called_once_with" [attr-defined]
- dragonchain/lib/interfaces/storage_utest.py:108:9: error: "Callable[[str, str], bool]" has no attribute "assert_called_once_with" [attr-defined]
... (truncated 145 lines) ...
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #15850
Few questions
https://github.com/dragonchain/dragonchain/blob/1a25eda598471fd735a2b515312bfc3bbe53770b/mypy.ini#L21
Should we ignore them.
Should there be a check to exit inside this as well
mypy/mypy/build.py
Line 2210 in 76c16a4
Can this be ignored
mypy/mypy/config_parser.py
Lines 490 to 493 in 76c16a4