From d7076c4b528548a28d80c734cb1122ac0deb6809 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 23:34:32 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.15.0 → v3.19.0](https://github.com/asottile/pyupgrade/compare/v3.15.0...v3.19.0) - [github.com/psf/black: 24.2.0 → 24.10.0](https://github.com/psf/black/compare/24.2.0...24.10.0) - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v5.0.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.1](https://github.com/PyCQA/flake8/compare/7.0.0...7.1.1) - [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.13.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.13.0) - [github.com/teemtee/tmt.git: 1.31.0 → 1.38.0](https://github.com/teemtee/tmt.git/compare/1.31.0...1.38.0) - [github.com/python-jsonschema/check-jsonschema: 0.28.0 → 0.29.4](https://github.com/python-jsonschema/check-jsonschema/compare/0.28.0...0.29.4) --- .pre-commit-config.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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"] From 1a0010d208e1416ab56180710afc69ff4ca73504 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Wed, 30 Oct 2024 11:03:12 +0100 Subject: [PATCH 2/2] fix: assert existence of stderr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Needed to make the mypy be quiet about the ‹fileno()› on possibly ‹None›. Signed-off-by: Matej Focko --- specfile/context_management.py | 1 + 1 file changed, 1 insertion(+) 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()