From 2e1a702401bc3bbcb995fca79ee5f1aa55edad4b Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 9 Oct 2023 18:19:21 -0400 Subject: [PATCH] Update lint dependencies and fix errors Update dependencies to their latest version and constraints. Fix issues with `make reformat` by ignoring some ruff rules where it makes sense. Apply the reformatted file changes. --- {{cookiecutter.project_slug}}/pyproject.toml | 4 ++-- {{cookiecutter.project_slug}}/test/test_init.py | 9 ++++++++- .../{{cookiecutter.module_slug}}/__init__.py | 4 +--- .../{{cookiecutter.module_slug}}/__main__.py | 4 +--- .../{{cookiecutter.module_slug}}/_cli.py | 8 +++++--- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index f19090d..35dcae9 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -32,10 +32,10 @@ doc = [ ] test = ["pytest", "pytest-cov", "pretend", "coverage[toml]"] lint = [ - "black>=22.3.0", + "black ~= 23.0", # NOTE: ruff is under active development, so we pin conservatively here # and let Dependabot periodically perform this update. - "ruff < 0.0.255", + "ruff < 0.0.293", "mypy >= 1.0", "types-html5lib", "types-requests", diff --git a/{{cookiecutter.project_slug}}/test/test_init.py b/{{cookiecutter.project_slug}}/test/test_init.py index 570026d..909a1c5 100644 --- a/{{cookiecutter.project_slug}}/test/test_init.py +++ b/{{cookiecutter.project_slug}}/test/test_init.py @@ -1,6 +1,13 @@ +"""Initial testing module.""" import {{ cookiecutter.module_slug }} -def test_version(): +# ruff: noqa: S101 INP001 +# S101 Use of `assert` detected +# INP001 implicit namespace package + + +def test_version() -> None: + """Test whether the package version is valid.""" version = getattr({{ cookiecutter.module_slug }}, "__version__", None) assert version is not None assert isinstance(version, str) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/__init__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/__init__.py index 5491211..eb82381 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/__init__.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/__init__.py @@ -1,5 +1,3 @@ -""" -The `{{ cookiecutter.module_slug }}` APIs. -""" +"""The `{{ cookiecutter.module_slug }}` APIs.""" __version__ = "{{ cookiecutter.version }}" diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/__main__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/__main__.py index 77dd814..8dd43c8 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/__main__.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/__main__.py @@ -1,6 +1,4 @@ -""" -The `python -m {{ cookiecutter.module_slug }}` entrypoint. -""" +"""The `python -m {{ cookiecutter.module_slug }}` entrypoint.""" if __name__ == "__main__": # pragma: no cover from {{ cookiecutter.module_slug }}._cli import main diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/_cli.py b/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/_cli.py index b4bb2bc..04b3fa7 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/_cli.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.module_slug}}/_cli.py @@ -1,6 +1,8 @@ -""" -The `{{ cookiecutter.project_slug }}` entrypoint. -""" +"""The `{{ cookiecutter.project_slug }}` entrypoint.""" + +# ruff: noqa: T201 +# T201 `print` found + def main() -> None: print("Hello, world!")