"Fossies" - the Fresh Open Source Software Archive

Member "pytorch-1.8.2/mypy-strict.ini" (23 Jul 2021, 1825 Bytes) of package /linux/misc/pytorch-1.8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) INI source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "mypy-strict.ini": 1.12.1_vs_1.13.0.

    1 # This is the PyTorch mypy-strict.ini file (note: don't change this line! -
    2 # test_run_mypy in test/test_type_hints.py uses this string)
    3 
    4 # Unlike mypy.ini, it enforces very strict typing rules. The intention is for
    5 # this config file to be used to ENFORCE that people are using mypy on codegen
    6 # files.
    7 
    8 # For now, only code_template.py and benchmark utils Timer are covered this way
    9 
   10 [mypy]
   11 python_version = 3.6
   12 
   13 cache_dir = .mypy_cache/strict
   14 strict_optional = True
   15 show_column_numbers = True
   16 warn_no_return = True
   17 disallow_any_unimported = True
   18 
   19 # Across versions of mypy, the flags toggled by --strict vary.  To ensure
   20 # we have reproducible type check, we instead manually specify the flags
   21 warn_unused_configs = True
   22 disallow_any_generics = True
   23 disallow_subclassing_any = True
   24 disallow_untyped_calls = True
   25 disallow_untyped_defs = True
   26 disallow_incomplete_defs = True
   27 check_untyped_defs = True
   28 disallow_untyped_decorators = True
   29 no_implicit_optional = True
   30 warn_redundant_casts = True
   31 warn_unused_ignores = True
   32 warn_return_any = True
   33 implicit_reexport = False
   34 strict_equality = True
   35 
   36 files = tools/codegen/gen.py,
   37     tools/autograd/*.py,
   38     tools/pyi/*.py,
   39     torch/testing/_internal/mypy_wrapper.py,
   40     torch/utils/benchmark/utils/common.py,
   41     torch/utils/benchmark/utils/timer.py,
   42     torch/utils/benchmark/utils/valgrind_wrapper/*.py,
   43     torch/utils/_pytree.py
   44 
   45 # Specifically enable imports of benchmark utils. As more of `torch` becomes
   46 # strict compliant, those modules can be enabled as well.
   47 [mypy-torch.utils.benchmark.utils.*]
   48 follow_imports = normal
   49 
   50 # Don't follow imports as much of `torch` is not strict compliant.
   51 [mypy-torch]
   52 follow_imports = skip
   53 
   54 [mypy-torch.*]
   55 follow_imports = skip
   56 
   57 # Missing stubs.
   58 
   59 [mypy-numpy]
   60 ignore_missing_imports = True
   61 
   62 [mypy-mypy.*]
   63 ignore_missing_imports = True