Skip to content

Commit

Permalink
Add some missing generic arguments (#595)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Fleet <tomfleet2018@gmail.com>
  • Loading branch information
RobertCraigie and FollowTheProcess committed Apr 21, 2022
1 parent 7415851 commit d9e2580
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nox/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Status(enum.Enum):


class _WorkingDirContext:
def __init__(self, dir: str | os.PathLike) -> None:
def __init__(self, dir: str | os.PathLike[str]) -> None:
self._prev_working_dir = os.getcwd()
os.chdir(dir)

Expand Down Expand Up @@ -152,7 +152,7 @@ def name(self) -> str:
return self._runner.friendly_name

@property
def env(self) -> dict:
def env(self) -> dict[str, str]:
"""A dictionary of environment variables to pass into all commands."""
return self.virtualenv.env

Expand Down Expand Up @@ -218,7 +218,7 @@ def invoked_from(self) -> str:
"""
return self._runner.global_config.invoked_from

def chdir(self, dir: str | os.PathLike) -> _WorkingDirContext:
def chdir(self, dir: str | os.PathLike[str]) -> _WorkingDirContext:
"""Change the current working directory.
Can be used as a context manager to automatically restore the working directory::
Expand All @@ -238,7 +238,7 @@ def chdir(self, dir: str | os.PathLike) -> _WorkingDirContext:
"""An alias for :meth:`chdir`."""

def _run_func(
self, func: Callable, args: Iterable[Any], kwargs: Mapping[str, Any]
self, func: Callable[..., Any], args: Iterable[Any], kwargs: Mapping[str, Any]
) -> Any:
"""Legacy support for running a function through :func`run`."""
self.log(f"{func}(args={args!r}, kwargs={kwargs!r})")
Expand Down

0 comments on commit d9e2580

Please sign in to comment.