From 77de07940dd9e6ce39c64cd17565077e10ef2484 Mon Sep 17 00:00:00 2001 From: Sebastian Weigand Date: Sat, 27 Aug 2022 19:32:16 +0200 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20UPGRADE:=20Autoupdate=20pr?= =?UTF-8?q?e-commit=20config=20(#61)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * โฌ†๏ธ UPGRADE: Autoupdate pre-commit config * ๐Ÿ”ง๐Ÿงน Removed interrogate pre-push hook * ๐Ÿฉน๐Ÿ“š Fixed typo * ๐Ÿ”ง๐Ÿ‘Œ Sorted pre-commit hooks to run more effectively * ๐Ÿ”ง๐Ÿฉน Fixed rstcheck hook config * ๐Ÿ”ง๐Ÿงน Ignore false positive type error Ref.: https://github.com/python/typeshed/issues/7767 Co-authored-by: s-weigand --- .pre-commit-config.yaml | 44 ++++++++++-------------- setup.cfg | 7 +--- verbose_version_info/resource_finders.py | 4 ++- verbose_version_info/settings.py | 2 +- 4 files changed, 23 insertions(+), 34 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f4c8cc..3075055 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.3.0 hooks: - id: check-ast - id: check-builtin-literals @@ -11,7 +11,7 @@ repos: args: [--remove] - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + rev: v2.37.3 hooks: - id: pyupgrade args: [--py36-plus] @@ -22,28 +22,35 @@ repos: - id: isort - repo: https://github.com/python/black - rev: 22.3.0 + rev: 22.6.0 hooks: - id: black language_version: python3 + - repo: https://github.com/asottile/yesqa + rev: v1.4.0 + hooks: + - id: yesqa + additional_dependencies: [flake8-docstrings] + - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.6.2 # Use the sha or tag you want to point at + rev: v3.0.0-alpha.0 # Use the sha or tag you want to point at hooks: - id: prettier + - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.1 + rev: v2.0.0 hooks: - id: setup-cfg-fmt - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.9.2 + - repo: https://github.com/pycqa/flake8 + rev: 5.0.4 hooks: - id: flake8 additional_dependencies: [flake8-comprehensions, flake8-2020] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.942 + rev: v0.971 hooks: - id: mypy exclude: "^(docs|tests/dummy_packages)" @@ -69,10 +76,11 @@ repos: pass_filenames: false - repo: https://github.com/myint/rstcheck - rev: "v5.0.0" + rev: "v6.1.0" hooks: - id: rstcheck additional_dependencies: [sphinx] + exclude: "^(docs/_templates)" - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.9.0 @@ -87,25 +95,9 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.2.1 hooks: - id: codespell types: [file] types_or: [python, pyi, markdown, rst, jupyter] args: [-L nnumber] - - - repo: https://github.com/asottile/yesqa - rev: v1.3.0 - hooks: - - id: yesqa - additional_dependencies: [flake8-docstrings] - - - repo: https://github.com/econchick/interrogate - rev: 1.5.0 - hooks: - - id: interrogate - name: Update interrogate badge - args: - [-v, --config=pyproject.toml, -g, docs/_static/interrogate_badge.svg] - pass_filenames: false - stages: [push] diff --git a/setup.cfg b/setup.cfg index 3148fe2..fd72ba8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,11 +16,6 @@ classifiers = Natural Language :: English Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 keywords = verbose_version_info project_urls = Documentation=https://verbose-version-info.readthedocs.io @@ -71,7 +66,7 @@ convention = numpy test = pytest [rstcheck] -ignore_directives = autoattribute,autoclass,autoexception,autofunction,automethod,automodule,highlight +ignore_directives = highlight,autosummary [mypy] show_error_codes = True diff --git a/verbose_version_info/resource_finders.py b/verbose_version_info/resource_finders.py index 83db974..94227a5 100644 --- a/verbose_version_info/resource_finders.py +++ b/verbose_version_info/resource_finders.py @@ -136,7 +136,9 @@ def egg_link_lines(distribution_name: str) -> Optional[List[str]]: -------- find_editable_install_basepath """ - distribution_name = distribution(distribution_name).metadata.get("name") + distribution_name = distribution(distribution_name).metadata.get( # type:ignore[attr-defined] + "name" + ) for path_item in sys.path: egg_link = os.path.join(path_item, f"{distribution_name}.egg-link") if os.path.isfile(egg_link): diff --git a/verbose_version_info/settings.py b/verbose_version_info/settings.py index 75535ea..06c34f8 100644 --- a/verbose_version_info/settings.py +++ b/verbose_version_info/settings.py @@ -1,4 +1,4 @@ -"""Module containing all seetings related functionalities.""" +"""Module containing all settings related functionalities.""" from copy import copy DEFAULT_VCS_SETTINGS = {"warn_dirty": True}