Skip to content

Commit

Permalink
chore: bump linting versions to latests (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Dec 23, 2021
1 parent 7eb3719 commit c996522
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -76,3 +76,6 @@ target/

# PyCharm
.idea/

# Standard venv location
.venv
4 changes: 2 additions & 2 deletions nox/_decorators.py
Expand Up @@ -16,7 +16,7 @@
import functools
import inspect
import types
from typing import Any, Callable, Dict, Iterable, List, Optional, cast
from typing import Any, Callable, Dict, Iterable, List, Optional

from . import _typing

Expand All @@ -29,7 +29,7 @@ def __new__(
cls, func: Callable[..., Any], *args: Any, **kwargs: Any
) -> "FunctionDecorator":
obj = super().__new__(cls)
return cast("FunctionDecorator", functools.wraps(func)(obj))
return functools.wraps(func)(obj)


def _copy_func(src: Callable, name: Optional[str] = None) -> Callable:
Expand Down
2 changes: 1 addition & 1 deletion nox/_parametrize.py
Expand Up @@ -155,7 +155,7 @@ def parametrize_decorator(


def update_param_specs(
param_specs: Iterable[Param], new_specs: List[Param]
param_specs: Optional[Iterable[Param]], new_specs: List[Param]
) -> List[Param]:
"""Produces all combinations of the given sets of specs."""
if not param_specs:
Expand Down
3 changes: 1 addition & 2 deletions nox/tasks.py
Expand Up @@ -63,8 +63,7 @@ def _load_and_exec_nox_module(global_config: Namespace) -> types.ModuleType:
if not loader: # pragma: no cover
raise IOError(f"Could not get module loader for {global_config.noxfile}")
# See https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly
# unsure why mypy doesn't like this
loader.exec_module(module) # type: ignore
loader.exec_module(module)
return module


Expand Down
20 changes: 11 additions & 9 deletions noxfile.py
Expand Up @@ -90,34 +90,36 @@ def cover(session):
session.run("coverage", "erase")


@nox.session(python="3.8")
black_pins = ["black==21.12b0", "isort==5.10.1"]


@nox.session(python="3.9")
def blacken(session):
"""Run black code formatter."""
session.install("black==21.5b2", "isort==5.8.0")
session.install(*black_pins)
files = ["nox", "tests", "noxfile.py", "docs/conf.py"]
session.run("black", *files)
session.run("isort", *files)


@nox.session(python="3.8")
@nox.session(python="3.9")
def lint(session):
session.install(
"flake8==3.9.2",
"black==21.6b0",
"isort==5.8.0",
"mypy==0.902",
*black_pins,
"flake8==4.0.1",
"mypy==0.930",
"types-jinja2",
"packaging",
"importlib_metadata",
)
session.run("mypy")
session.run("mypy", "--show-error-codes")
files = ["nox", "tests", "noxfile.py", "docs/conf.py"]
session.run("black", "--check", *files)
session.run("isort", "--check", *files)
session.run("flake8", *files)


@nox.session(python="3.8")
@nox.session(python="3.9")
def docs(session):
"""Build the documentation."""
output_dir = os.path.join(session.create_tmp(), "output")
Expand Down

0 comments on commit c996522

Please sign in to comment.