|
30 | 30 | from mypy.errors import CompileError |
31 | 31 | from mypy.find_sources import InvalidSourceList, create_source_list |
32 | 32 | from mypy.fscache import FileSystemCache |
33 | | -from mypy.installtypes import ( |
34 | | - make_runtime_constraints, |
35 | | - read_locked_packages, |
36 | | - resolve_stub_packages_from_lock, |
37 | | -) |
| 33 | +from mypy.installtypes import make_runtime_constraints, read_locked_packages, resolve_stub_packages_from_lock |
38 | 34 | from mypy.modulefinder import ( |
39 | 35 | BuildSource, |
40 | 36 | FindModuleCache, |
@@ -140,7 +136,11 @@ def main( |
140 | 136 | if options.install_types_from_pylock is not None and not os.path.isfile( |
141 | 137 | options.install_types_from_pylock |
142 | 138 | ): |
143 | | - fail(f"error: Can't find lock file '{options.install_types_from_pylock}'", stderr, options) |
| 139 | + fail( |
| 140 | + f"error: Can't find lock file '{options.install_types_from_pylock}'", |
| 141 | + stderr, |
| 142 | + options, |
| 143 | + ) |
144 | 144 |
|
145 | 145 | if options.install_types and not options.incremental: |
146 | 146 | fail( |
@@ -967,10 +967,10 @@ def add_invertible_flag( |
967 | 967 | ) |
968 | 968 |
|
969 | 969 | add_invertible_flag( |
970 | | - "--no-strict-bytes", |
971 | | - default=True, |
972 | | - dest="strict_bytes", |
973 | | - help="Treat bytearray and memoryview as subtypes of bytes", |
| 970 | + "--strict-bytes", |
| 971 | + default=False, |
| 972 | + strict_flag=True, |
| 973 | + help="Disable treating bytearray and memoryview as subtypes of bytes", |
974 | 974 | group=strictness_group, |
975 | 975 | ) |
976 | 976 |
|
@@ -1306,13 +1306,7 @@ def add_invertible_flag( |
1306 | 1306 | parser.add_argument("--test-env", action="store_true", help=argparse.SUPPRESS) |
1307 | 1307 | # --local-partial-types disallows partial types spanning module top level and a function |
1308 | 1308 | # (implicitly defined in fine-grained incremental mode) |
1309 | | - add_invertible_flag( |
1310 | | - "--no-local-partial-types", |
1311 | | - inverse="--local-partial-types", |
1312 | | - default=True, |
1313 | | - dest="local_partial_types", |
1314 | | - help=argparse.SUPPRESS, |
1315 | | - ) |
| 1309 | + add_invertible_flag("--local-partial-types", default=False, help=argparse.SUPPRESS) |
1316 | 1310 | # --native-parser enables the native parser (experimental) |
1317 | 1311 | add_invertible_flag("--native-parser", default=False, help=argparse.SUPPRESS) |
1318 | 1312 | # --logical-deps adds some more dependencies that are not semantically needed, but |
|
0 commit comments