Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review
  • Loading branch information
sobolevn committed Sep 11, 2023
commit a1725b4f30fa228b0c359bdc32fa215b39f8056a
5 changes: 2 additions & 3 deletions Tools/wasm/mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ python_version = 3.8
strict = True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this mean all code in this directory must be fully typed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can ignore any code that is not typed:

  1. Via adding global disallow_incomplete_defs = false
  2. Via per-file ignores
  3. Via inline # type: ignore

For now, yes, all code must be typed. Do you want to add disallow_incomplete_defs = false?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add disallow_incomplete_defs = false?

Yes please.

enable_error_code = truthy-bool,ignore-without-code

# except for a few settings that can't yet be enabled:
warn_return_any = False
warn_unreachable = False
# except for incomplete defs, which are useful for module authors:
disallow_incomplete_defs = False
3 changes: 2 additions & 1 deletion Tools/wasm/wasm_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ def get_builddir(args: argparse.Namespace) -> pathlib.Path:

def get_sysconfigdata(args: argparse.Namespace) -> pathlib.Path:
"""Get path to sysconfigdata relative to build root"""
data_name = sysconfig._get_sysconfigdata_name() # type: ignore[attr-defined]
assert isinstance(args.builddir, pathlib.Path)
data_name: str = sysconfig._get_sysconfigdata_name() # type: ignore[attr-defined]
if not data_name.startswith(SYSCONFIG_NAMES):
raise ValueError(
f"Invalid sysconfig data name '{data_name}'.", SYSCONFIG_NAMES
Expand Down