Skip to content

Commit

Permalink
fixes for mypy 1.11 (#13989)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryevdv authored and mattpap committed Jul 25, 2024
1 parent e69f5ac commit bb7d2bf
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion conda/environment-test-3.10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dependencies:
# pip dependencies
- pip
- pip:
- mypy >=1.10
- mypy >=1.11
# docs
- bokeh_sampledata
- pydata_sphinx_theme
Expand Down
2 changes: 1 addition & 1 deletion conda/environment-test-3.11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dependencies:
# pip dependencies
- pip
- pip:
- mypy >=1.10
- mypy >=1.11
# docs
- bokeh_sampledata
- pydata_sphinx_theme
Expand Down
2 changes: 1 addition & 1 deletion conda/environment-test-3.12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dependencies:
# pip dependencies
- pip
- pip:
- mypy >=1.10
- mypy >=1.11
# docs
- bokeh_sampledata
- pydata_sphinx_theme
Expand Down
2 changes: 1 addition & 1 deletion conda/environment-test-minimal-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies:
# pip dependencies
- pip
- pip:
- mypy >=1.10
- mypy >=1.11
# docs
# omit bokeh_sampledata
- pydata_sphinx_theme
Expand Down
3 changes: 1 addition & 2 deletions src/bokeh/driving.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def update(i):
from typing import (
Any,
Callable,
Iterable,
Iterator,
Sequence,
TypeVar,
Expand Down Expand Up @@ -200,7 +199,7 @@ def f(i: float) -> float:

T = TypeVar("T")

def _advance(f: Callable[[int], T]) -> Iterable[T]:
def _advance(f: Callable[[int], T]) -> Iterator[T]:
''' Yield a sequence generated by calling a given function with
successively incremented integer values.
Expand Down
6 changes: 3 additions & 3 deletions src/bokeh/embed/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,21 @@ def autoload_static(model: Model | Document, resources: Resources, script_path:
return js, tag

@overload
def components(models: Model, wrap_script: bool = ..., # type: ignore[overload-overlap] # XXX: mypy bug
def components(models: Model, wrap_script: bool = ...,
wrap_plot_info: Literal[True] = ..., theme: ThemeLike = ...) -> tuple[str, str]: ...
@overload
def components(models: Model, wrap_script: bool = ..., wrap_plot_info: Literal[False] = ...,
theme: ThemeLike = ...) -> tuple[str, RenderRoot]: ...

@overload
def components(models: Sequence[Model], wrap_script: bool = ..., # type: ignore[overload-overlap] # XXX: mypy bug
def components(models: Sequence[Model], wrap_script: bool = ...,
wrap_plot_info: Literal[True] = ..., theme: ThemeLike = ...) -> tuple[str, Sequence[str]]: ...
@overload
def components(models: Sequence[Model], wrap_script: bool = ..., wrap_plot_info: Literal[False] = ...,
theme: ThemeLike = ...) -> tuple[str, Sequence[RenderRoot]]: ...

@overload
def components(models: dict[str, Model], wrap_script: bool = ..., # type: ignore[overload-overlap] # XXX: mypy bug
def components(models: dict[str, Model], wrap_script: bool = ...,
wrap_plot_info: Literal[True] = ..., theme: ThemeLike = ...) -> tuple[str, dict[str, str]]: ...
@overload
def components(models: dict[str, Model], wrap_script: bool = ..., wrap_plot_info: Literal[False] = ...,
Expand Down

0 comments on commit bb7d2bf

Please sign in to comment.