Skip to content

Commit

Permalink
Fix most new pyright complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
pydsigner committed Dec 20, 2023
1 parent 876d00a commit 35305fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/anchovy/components/md_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AnchovyRendererHTML(RendererHTML):
integration and toml frontmatter support.
"""
# https://github.com/executablebooks/markdown-it-py/issues/256
def fence(self, tokens: Sequence[Token], idx: int, options: OptionsDict, _env: EnvType):
def fence(self, tokens: Sequence[Token], idx: int, options: OptionsDict, env: EnvType):
"""
Handles rendering a markdown code fence, with optional syntax
highlighting.
Expand Down
7 changes: 5 additions & 2 deletions src/anchovy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from .dependencies import Dependency
from .pretty_utils import track_progress

if t.TYPE_CHECKING:
from collections.abc import Sequence, Set


T = t.TypeVar('T')
T2 = t.TypeVar('T2')
Expand Down Expand Up @@ -297,7 +300,7 @@ def is_available(cls) -> bool:
return all(d.satisfied for d in cls.get_dependencies())

@classmethod
def get_dependencies(cls) -> set[Dependency]:
def get_dependencies(cls) -> Set[Dependency]:
"""
Return the requirements for this Step.
"""
Expand All @@ -314,7 +317,7 @@ def __call__(
self,
path: Path,
output_paths: list[Path]
) -> None | tuple[list[Path | CustodyEntry], list[Path]]:
) -> None | tuple[Sequence[Path | CustodyEntry], Sequence[Path]]:
...


Expand Down
4 changes: 2 additions & 2 deletions src/anchovy/include.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from .core import Context
from .custody import CustodyEntry
from .dependencies import PipDependency
from .dependencies import Dependency, PipDependency
from .simple import BaseStandardStep


Expand Down Expand Up @@ -76,7 +76,7 @@ class URLLibFetchStep(BaseStandardStep):
"""
@classmethod
def get_dependencies(cls):
return {PipDependency('tomli')} if sys.version_info < (3, 11) else {}
return {PipDependency('tomli')} if sys.version_info < (3, 11) else set[Dependency]()

def bind(self, context: Context):
super().bind(context)
Expand Down
2 changes: 1 addition & 1 deletion src/anchovy/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class JinjaRenderStep(BaseStandardStep):
Abstract base class for Steps using Jinja rendering.
"""
@classmethod
def get_dependencies(cls):
def get_dependencies(cls) -> set[Dependency]:
return {
PipDependency('jinja2'),
}
Expand Down

0 comments on commit 35305fb

Please sign in to comment.