Skip to content

Commit

Permalink
Update pre-commit hooks (#449)
Browse files Browse the repository at this point in the history
* build: Update flake8 pre-commit hook to account for its move from GitLab to GitHub.

see PyCQA/flake8#1305

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* build: Update "pre-commit-hooks" pre-commit hook.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* build: Update "yesqa" pre-commit hook.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* build: Update "shed" pre-commit hook.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* build: Update "yamlfmt" pre-commit hook.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* build: Update "actionlint" pre-commit hook.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* build: Update "check-jsonschema" pre-commit hook.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
  • Loading branch information
seifertm authored Nov 21, 2022
1 parent 07a1416 commit d39589c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
19 changes: 9 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.3.0
hooks:
- id: check-merge-conflict
exclude: rst$
- repo: https://github.com/asottile/yesqa
rev: v1.3.0
rev: v1.4.0
hooks:
- id: yesqa
- repo: https://github.com/Zac-HD/shed
rev: 0.6.0 # 0.7 does not support Python 3.7
rev: 0.10.7
hooks:
- id: shed
args:
- --refactor
- --py37-plus
types_or:
- python
- markdown
- rst
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.1.1
rev: 0.2.2
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '2', --offset, '0']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -37,8 +36,8 @@ repos:
- id: check-xml
- id: check-yaml
- id: debug-statements
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
language_version: python3
Expand All @@ -47,7 +46,7 @@ repos:
hooks:
- id: python-use-type-annotations
- repo: https://github.com/rhysd/actionlint
rev: v1.6.8
rev: v1.6.22
hooks:
- id: actionlint-docker
args:
Expand All @@ -58,7 +57,7 @@ repos:
- -ignore
- 'SC1004:'
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.9.1
rev: 0.19.2
hooks:
- id: check-github-actions
ci:
Expand Down
24 changes: 11 additions & 13 deletions pytest_asyncio/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)

import pytest
from pytest import Function, Session, Item
from pytest import Function, Item, Session

if sys.version_info >= (3, 8):
from typing import Literal
Expand Down Expand Up @@ -89,11 +89,10 @@ def fixture(
scope: "Union[_ScopeName, Callable[[str, Config], _ScopeName]]" = ...,
params: Optional[Iterable[object]] = ...,
autouse: bool = ...,
ids: Optional[
Union[
Iterable[Union[None, str, float, int, bool]],
Callable[[Any], Optional[object]],
]
ids: Union[
Iterable[Union[str, float, int, bool, None]],
Callable[[Any], Optional[object]],
None,
] = ...,
name: Optional[str] = ...,
) -> FixtureFunction:
Expand All @@ -107,11 +106,10 @@ def fixture(
scope: "Union[_ScopeName, Callable[[str, Config], _ScopeName]]" = ...,
params: Optional[Iterable[object]] = ...,
autouse: bool = ...,
ids: Optional[
Union[
Iterable[Union[None, str, float, int, bool]],
Callable[[Any], Optional[object]],
]
ids: Union[
Iterable[Union[str, float, int, bool, None]],
Callable[[Any], Optional[object]],
None,
] = ...,
name: Optional[str] = None,
) -> FixtureFunctionMarker:
Expand Down Expand Up @@ -330,9 +328,9 @@ async def setup():

@pytest.hookimpl(tryfirst=True)
def pytest_pycollect_makeitem(
collector: Union[pytest.Module, pytest.Class], name: str, obj: object
collector: Union[pytest.Module, pytest.Class], name: str, obj: object
) -> Union[
None, pytest.Item, pytest.Collector, List[Union[pytest.Item, pytest.Collector]]
pytest.Item, pytest.Collector, List[Union[pytest.Item, pytest.Collector]], None
]:
"""A pytest hook to collect asyncio coroutines."""
if not collector.funcnamefilter(name):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pytest_min_version_warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@pytest.mark.skipif(
pytest.__version__ < "7.0.0",
reason="The warning shouldn't be present when run with recent pytest versions"
reason="The warning shouldn't be present when run with recent pytest versions",
)
@pytest.mark.parametrize("mode", ("auto", "strict"))
def test_pytest_min_version_warning_is_not_triggered_for_pytest_7(testdir, mode):
Expand Down

0 comments on commit d39589c

Please sign in to comment.