Skip to content

Commit

Permalink
Merge PR #697 and PR #698 into main
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Apr 24, 2024
3 parents f156ccd + dac703b + 28d79d5 commit 1e05bcc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ jobs:
- ubuntu-22.04
- ubuntu-20.04
- macos-11.0
- macos-latest
- macos-13
- windows-2019
- windows-2022

Expand Down
74 changes: 14 additions & 60 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ repos:
- rst

- repo: https:/asottile/add-trailing-comma.git
rev: v3.0.0
rev: v3.1.0
hooks:
- id: add-trailing-comma

Expand Down Expand Up @@ -86,13 +86,12 @@ repos:
^.*\.rst$
- repo: https:/hhatto/autopep8.git
rev: >- # v2.0.2 does not yet have config, maybe v2.0.3 will, SHA for now
5b9110ba53fecd60cd3091fb66d808e8ced3b2e8
rev: v2.1.0
hooks:
- id: autopep8

- repo: https:/pre-commit/pre-commit-hooks.git
rev: v4.4.0
rev: v4.6.0
hooks:
# Side-effects:
- id: trailing-whitespace
Expand Down Expand Up @@ -145,37 +144,20 @@ repos:
- --strict

- repo: https:/PyCQA/flake8.git
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
alias: flake8-no-wps
name: flake8 WPS-excluded
additional_dependencies:
- darglint ~= 1.8.1
- flake8-2020 ~= 1.7.0
- flake8-annotations ~= 2.9.1; python_version >= "3.7"
- flake8-annotations ~= 2.7.0; python_version < "3.7"
- flake8-annotations ~= 2.9.1
- flake8-docstrings ~= 1.6.0
- flake8-length ~= 0.3.0
- flake8-logging-format ~= 0.7.5
- flake8-pytest-style ~= 1.6.0
- flake8-spellcheck ~= 0.28.0; python_version >= "3.8"
- flake8-spellcheck ~= 0.26.0; python_version < "3.8"
language_version: python3

- repo: https:/PyCQA/flake8.git
# NOTE: This is kept at v4 for until WPS starts supporting flake v5.
rev: 4.0.1 # enforce-version: 4.0.1
hooks:
- id: flake8
alias: flake8-only-wps
name: flake8 WPS-only
args:
- --select
- WPS
additional_dependencies:
- wemake-python-styleguide ~= 0.17.0
language_version: python3
- flake8-spellcheck ~= 0.28.0
- wemake-python-styleguide ~= 0.19.0
language_version: python3.11 # flake8-commas doesn't work w/ Python 3.12

- repo: https:/Lucas-C/pre-commit-hooks-lxml.git
rev: v1.1.0
Expand Down Expand Up @@ -258,7 +240,7 @@ repos:
$
- repo: https:/PyCQA/pylint.git
rev: v2.15.9
rev: v3.1.0
hooks:
- id: pylint
additional_dependencies:
Expand All @@ -267,42 +249,14 @@ repos:
- jaraco.text
- more_itertools
- portend
- pylint-pytest < 1.1.0
- pylint-pytest ~= 2.0.0a0
- pyOpenSSL # needed by pylint-pytest since it picks up pytest's args
- pypytools
- pytest-cov # needed by pylint-pytest since it picks up pytest's args
- pytest-xdist # needed by pylint-pytest since it picks up pytest's args
- requests_toolbelt
- requests_unixsocket
- Sphinx

- repo: local
hooks:
- id: enforced-flake8-version
name: Verify that enforced flake8 version stays unchanged
description: >-
This is a sanity check and fixer that makes sure that
the `flake8` version in this file remains matching the
corresponding request in the `# enforce-version` comment.
# Using Python here because using
# shell test does not always work in CIs:
entry: >-
python -c 'import pathlib, re, sys;
pre_commit_config = pathlib.Path(sys.argv[1]);
cfg_txt = pre_commit_config.read_text();
new_cfg_txt = re.sub(
r"(?P<spaces>\s+)rev:\s(?:\d+\.\d+\.\d+)\s{0,2}"
r"#\senforce-version:\s(?P<enforced_version>\d+\.\d+\.\d+)"
r"[ \t\f\v]*",
r"\g<spaces>rev: \g<enforced_version> "
r"# enforce-version: \g<enforced_version>",
cfg_txt,
);
cfg_txt != new_cfg_txt and
pre_commit_config.write_text(new_cfg_txt)
'
pass_filenames: true
language: system
files: >-
^\.pre-commit-config\.ya?ml$
types:
- yaml
- trustme # needed by pylint-pytest since it picks up pytest's args

...
11 changes: 7 additions & 4 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ ignore-patterns=

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# This patch injects the project directory into the import path so that the
# local `pytest` plugin can be imported when `pylint-pytest` invokes it when
# exploring the fixtures available:
init-hook="import os, sys; sys.path[:0] = [os.getcwd()]; os.environ['PYTHONPATH'] = sys.path[0]"

# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use.
Expand Down Expand Up @@ -635,7 +638,7 @@ preferred-modules=
[EXCEPTIONS]

# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
# "builtins.BaseException, builtins.Exception".
overgeneral-exceptions=
BaseException,
Exception,
builtins.BaseException,
builtins.Exception,
1 change: 1 addition & 0 deletions cheroot/test/webtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def interactive(self):
'Interactive test failure interceptor support via '
'WEBTEST_INTERACTIVE environment variable is deprecated.',
DeprecationWarning,
stacklevel=1,
)
return is_interactive

Expand Down
2 changes: 1 addition & 1 deletion cheroot/workers/threadpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def _process_connections_until_interrupted(self):
raise SystemExit(
str(shutdown_request),
) from shutdown_request
except BaseException as unhandled_error: # noqa: WPS424
except BaseException as unhandled_error: # noqa: B036, WPS424
# NOTE: Only a shutdown request should bubble up to the
# NOTE: external cleanup code. Otherwise, this thread dies.
# NOTE: If this were to happen, the threadpool would still
Expand Down

0 comments on commit 1e05bcc

Please sign in to comment.