diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c52bb0f..0626838 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,11 +4,11 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.19.0 hooks: - id: pyupgrade - repo: https://github.com/psf/black - rev: 24.2.0 + rev: 24.10.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-prettier @@ -16,7 +16,7 @@ repos: hooks: - id: prettier - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-added-large-files - id: check-ast @@ -32,7 +32,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.1.1 hooks: - id: flake8 args: @@ -45,27 +45,27 @@ repos: - id: isort args: [--profile, black] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.13.0 hooks: - id: mypy args: [--show-error-codes, --ignore-missing-imports] additional_dependencies: [types-setuptools, types-requests, types-python-dateutil] - repo: https://github.com/teemtee/tmt.git - rev: 1.31.0 + rev: 1.38.0 hooks: - id: tmt-lint # linting of the reverse-dependency tests requires internet access - stages: [manual, push] + stages: [manual, pre-push] - repo: https://github.com/packit/pre-commit-hooks rev: v1.2.0 hooks: - id: check-rebase args: - https://github.com/packit/specfile.git - stages: [manual, push] + stages: [manual, pre-push] - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.28.0 + rev: 0.29.4 hooks: - id: check-github-workflows args: ["--verbose"] diff --git a/specfile/context_management.py b/specfile/context_management.py index 0f8a3a4..c88b409 100644 --- a/specfile/context_management.py +++ b/specfile/context_management.py @@ -23,6 +23,7 @@ def capture_stderr() -> Generator[List[bytes], None, None]: Yields: List of captured lines. """ + assert sys.__stderr__, "stderr should exist" fileno = sys.__stderr__.fileno() with tempfile.TemporaryFile() as stderr, os.fdopen(os.dup(fileno)) as backup: sys.stderr.flush()