Skip to content

Commit

Permalink
MyPy: fix errors with latest versions of MyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Aug 7, 2024
1 parent 612e7aa commit 830c25c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions backend/src/hatchling/cli/dep/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def dependencies_in_sync(
if sys_path is None:
sys_path = sys.path
if environment is None:
environment = default_environment()
environment = default_environment() # type: ignore[assignment]

installed_distributions = DistributionCache(sys_path)
return all(dependency_in_sync(requirement, environment, installed_distributions) for requirement in requirements)
return all(dependency_in_sync(requirement, environment, installed_distributions) for requirement in requirements) # type: ignore[arg-type]
2 changes: 1 addition & 1 deletion backend/src/hatchling/metadata/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def project_metadata_from_core_metadata(core_metadata: str) -> dict[str, Any]:
header_registry = HeaderRegistry()

message = email.message_from_string(core_metadata)
metadata = {}
metadata: dict[str, Any] = {}

if name := message.get('Name'):
metadata['name'] = name
Expand Down
4 changes: 2 additions & 2 deletions src/hatch/cli/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def __init__(
is_interactive: bool,
verbosity: int,
spinner_style: str,
waiting_style: Style,
success_style: Style,
waiting_style: Style | str,
success_style: Style | str,
initializer: Callable,
finalizer: Callable,
):
Expand Down
4 changes: 2 additions & 2 deletions src/hatch/dep/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def dependencies_in_sync(
if sys_path is None:
sys_path = sys.path
if environment is None:
environment = default_environment()
environment = default_environment() # type: ignore[assignment]

installed_distributions = DistributionCache(sys_path)
return all(dependency_in_sync(requirement, environment, installed_distributions) for requirement in requirements)
return all(dependency_in_sync(requirement, environment, installed_distributions) for requirement in requirements) # type: ignore[arg-type]

0 comments on commit 830c25c

Please sign in to comment.