From d9f433717c330d4a2babb3820cf318627becd343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Kuti?= Date: Fri, 3 Mar 2023 10:17:15 +0100 Subject: [PATCH] Update dependency versions in main and generated projects This has been done a few years ago, the last time, many of the tools have jumped multiple major versions. Also update pylint configs and fix new errors. --- pylintrc | 2 +- setup.py | 10 +++++----- tests/test_project_creation.py | 2 +- tests/util.py | 8 +++----- {{cookiecutter.package_name}}/pylintrc | 2 +- {{cookiecutter.package_name}}/setup.py | 4 ++-- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/pylintrc b/pylintrc index 40cb33e..ffc12a1 100644 --- a/pylintrc +++ b/pylintrc @@ -11,7 +11,7 @@ class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,32}|(__.*__))$ inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ [MESSAGES CONTROL] -disable = missing-docstring, locally-disabled, too-few-public-methods, fixme, bad-continuation +disable = missing-docstring, locally-disabled, too-few-public-methods, fixme msg-template = {module}:{line} [{msg_id}: {symbol}] - {msg} [REPORTS] diff --git a/setup.py b/setup.py index c1a7385..f692adb 100644 --- a/setup.py +++ b/setup.py @@ -22,15 +22,15 @@ install_requires=["cookiecutter>=1.4<2"], extras_require={ "lint": [ - "flake8<4", - "black==19.3b0", + "flake8<7", + "black<24", "pylint<3", - "mypy<0.800" + "mypy<2" ], "test": [ - "pytest<5", + "pytest<8", "pytest-cookies<1", - "pytest-cov<3", + "pytest-cov<5", ], }, zip_safe=False, diff --git a/tests/test_project_creation.py b/tests/test_project_creation.py index 67a636a..9844314 100644 --- a/tests/test_project_creation.py +++ b/tests/test_project_creation.py @@ -184,4 +184,4 @@ def test_build(cookies): check_output_in_result_dir("make build", result) with inside_directory_of(result): for pattern in EXPECTED_BUILD_PATTERNS: - assert glob.glob(pattern) != [] + assert glob.glob(pattern) diff --git a/tests/util.py b/tests/util.py index d799683..3dcbf68 100644 --- a/tests/util.py +++ b/tests/util.py @@ -19,11 +19,9 @@ def generate_temporary_project( @contextlib.contextmanager def inside_directory_of(result: Any) -> Iterator[None]: - try: - old_dir = result.project.chdir() - yield - finally: - os.chdir(old_dir) + old_dir = result.project.chdir() + yield + os.chdir(old_dir) def check_output_in_result_dir(command: str, result: Any) -> str: diff --git a/{{cookiecutter.package_name}}/pylintrc b/{{cookiecutter.package_name}}/pylintrc index 35648fc..a4e4db6 100644 --- a/{{cookiecutter.package_name}}/pylintrc +++ b/{{cookiecutter.package_name}}/pylintrc @@ -11,7 +11,7 @@ class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,32}|(__.*__))$ inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ [MESSAGES CONTROL] -disable = missing-docstring, locally-disabled, too-few-public-methods, fixme, bad-continuation +disable = missing-docstring, locally-disabled, too-few-public-methods, fixme msg-template = {module}:{line} [{msg_id}: {symbol}] - {msg} [REPORTS] diff --git a/{{cookiecutter.package_name}}/setup.py b/{{cookiecutter.package_name}}/setup.py index 963945a..cda60d5 100644 --- a/{{cookiecutter.package_name}}/setup.py +++ b/{{cookiecutter.package_name}}/setup.py @@ -22,8 +22,8 @@ install_requires=[], extras_require={ "build": ["wheel<1"], - "lint": ["flake8<4", "black==19.3b0"{%- if cookiecutter.use_pylint == "y" %}, "pylint<3"{%- endif%}{%- if cookiecutter.use_mypy == "y" %}, "mypy<0.800"{%- endif%}], - "test": ["pytest<5", "pytest-cov<3"], + "lint": ["flake8<7", "black<24"{%- if cookiecutter.use_pylint == "y" %}, "pylint<3"{%- endif%}{%- if cookiecutter.use_mypy == "y" %}, "mypy<2"{%- endif%}], + "test": ["pytest<8", "pytest-cov<5"], }, zip_safe=False, )