Skip to content

Commit

Permalink
tools: Migrate & merge mypy config into setup.cfg.
Browse files Browse the repository at this point in the history
Configuration for mypy was previously loading from mypy.ini, however
there was also unconnected - unused - configuration in setup.cfg.

This commit mainly migrates config across from mypy.ini, as well as
setting a python_version (3.6) and ignoring imports with no typing
information. This was broadly the configuration (as unused) previously
in setup.cfg, with the unknown import ignore now applied to all modules
rather than relying upon explicit listing (based on an approach in
zulip/zulip for mypy.ini).

Migrating the mypy configuration into setup.cfg reduces the number of
config files at the base level and reduces the potential confusion over
multiple configuration locations which were previously present.

One marginal benefit is also that fewer root level files pushes the
start of the README further up slightly on GitHub, improving its
visibility.
  • Loading branch information
neiljp committed Apr 16, 2021
1 parent 646bbd1 commit 306f237
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
14 changes: 0 additions & 14 deletions mypy.ini

This file was deleted.

17 changes: 15 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,22 @@ exclude=.git,__pycache__,build,dist,tools

[mypy]
python_version = 3.6
mypy_path = mypy_stubs

[mypy-urwid,zulip,pudb]
# Logistics of what code to check and how to handle the data.
# mypy_path = stubs/
scripts_are_modules = True
show_traceback = True
cache_dir = .mypy_cache

# Options to make the checking stricter.
check_untyped_defs = True
disallow_untyped_defs = True
disallow_any_generics = True
warn_no_return = True
no_implicit_optional = True
strict_optional = True

# If a library is typed, that's fine, otherwise don't worry
ignore_missing_imports = True

[coverage:run]
Expand Down

0 comments on commit 306f237

Please sign in to comment.