forked from pool/python-rstcheck
- Update to 6.2.5:
* Dropped support for python 3.8 * Added python 3.13 to tox config. * Dropped support for sphinx 5 * Add sphinx 8 to test pool for python version > 3.9 - Drop patch support-click-8.2.patch, included upstream. - Update URL. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rstcheck?expand=0&rev=21
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 4 02:06:13 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 6.2.5:
|
||||
* Dropped support for python 3.8
|
||||
* Added python 3.13 to tox config.
|
||||
* Dropped support for sphinx 5
|
||||
* Add sphinx 8 to test pool for python version > 3.9
|
||||
- Drop patch support-click-8.2.patch, included upstream.
|
||||
- Update URL.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 21 11:59:21 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
|
||||
@@ -17,16 +17,14 @@
|
||||
|
||||
|
||||
Name: python-rstcheck
|
||||
Version: 6.2.4
|
||||
Version: 6.2.5
|
||||
Release: 0
|
||||
Summary: Python module to check syntax of reStructuredText
|
||||
License: MIT
|
||||
URL: https://github.com/myint/rstcheck
|
||||
URL: https://github.com/rstcheck/rstcheck
|
||||
Source: https://files.pythonhosted.org/packages/source/r/rstcheck/rstcheck-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM gh#rstcheck/rstcheck#244
|
||||
Patch0: support-click-8.2.patch
|
||||
BuildRequires: %{python_module Sphinx}
|
||||
BuildRequires: %{python_module base >= 3.8}
|
||||
BuildRequires: %{python_module base >= 3.9}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module rstcheck-core >= 1.2}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:384942563dfbfcc85903a587ecf050447217c46b51e266ed3fe51371bc599015
|
||||
size 24520
|
||||
3
rstcheck-6.2.5.tar.gz
Normal file
3
rstcheck-6.2.5.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:122b6d6b953fa1a09d7e7de42ac5d8938da291c6f68351ace6166bb50fc3bd6c
|
||||
size 25235
|
||||
@@ -1,198 +0,0 @@
|
||||
From 045ba995bdb9e405e162fc6b2999ecdc481a15df Mon Sep 17 00:00:00 2001
|
||||
From: Steve Kowalik <steven@wedontsleep.org>
|
||||
Date: Wed, 21 May 2025 13:49:19 +0200
|
||||
Subject: [PATCH] Support click 8.2
|
||||
|
||||
While typer does not yet support click 8.2, it is coming with breaking
|
||||
changes. Support those changes by switching to checking the output
|
||||
instead of stdout, and for one testcase, support both Click 8.1 and 8.2
|
||||
so it doesn't break with either version installed.
|
||||
---
|
||||
tests/integration_tests/cli_test.py | 47 +++++++++++++++++------------
|
||||
tests/integration_tests/conftest.py | 2 +-
|
||||
2 files changed, 28 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/tests/integration_tests/cli_test.py b/tests/integration_tests/cli_test.py
|
||||
index c2da7bc1..17d1f99d 100644
|
||||
--- a/tests/integration_tests/cli_test.py
|
||||
+++ b/tests/integration_tests/cli_test.py
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
+import inspect
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
@@ -123,7 +124,7 @@ def test_all_bad_examples(
|
||||
result = cli_runner.invoke(cli_app, str(test_file))
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert ERROR_CODE_REGEX.search(result.stdout) is not None
|
||||
+ assert ERROR_CODE_REGEX.search(result.output) is not None
|
||||
|
||||
@staticmethod
|
||||
def test_all_bad_examples_recurively(
|
||||
@@ -136,7 +137,7 @@ def test_all_bad_examples_recurively(
|
||||
result = cli_runner.invoke(cli_app, [str(test_dir), "--recursive"])
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert ERROR_CODE_REGEX.search(result.stdout) is not None
|
||||
+ assert ERROR_CODE_REGEX.search(result.output) is not None
|
||||
|
||||
@staticmethod
|
||||
def test_mix_of_good_and_bad_examples(
|
||||
@@ -150,7 +151,7 @@ def test_mix_of_good_and_bad_examples(
|
||||
result = cli_runner.invoke(cli_app, [str(test_file_good), str(test_file_bad)])
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(ERROR_CODE_REGEX.findall(result.stdout)) == 1
|
||||
+ assert len(ERROR_CODE_REGEX.findall(result.output)) == 1
|
||||
|
||||
@staticmethod
|
||||
def test_good_example_with_piping(
|
||||
@@ -178,7 +179,7 @@ def test_bad_example_with_piping(
|
||||
result = cli_runner.invoke(cli_app, "-", input=test_file_content)
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(ERROR_CODE_REGEX.findall(result.stdout)) == 1
|
||||
+ assert len(ERROR_CODE_REGEX.findall(result.output)) == 1
|
||||
|
||||
@staticmethod
|
||||
def test_piping_is_not_allowed_with_additional_files(cli_app: typer.Typer) -> None:
|
||||
@@ -186,7 +187,13 @@ def test_piping_is_not_allowed_with_additional_files(cli_app: typer.Typer) -> No
|
||||
|
||||
Test cli prints error to stderr.
|
||||
"""
|
||||
- cli_runner_divided_output = typer.testing.CliRunner(mix_stderr=False)
|
||||
+ # This can be dropped to passing no arguments when typer supports
|
||||
+ # Click 8.2+.
|
||||
+ params = inspect.signature(typer.testing.CliRunner).parameters
|
||||
+ kwargs = {}
|
||||
+ if params.get("mix_stderr"):
|
||||
+ kwargs["mix_stderr"] = False
|
||||
+ cli_runner_divided_output = typer.testing.CliRunner(**kwargs) # type:ignore[arg-type]
|
||||
|
||||
result = cli_runner_divided_output.invoke(cli_app, ["-", "foo"])
|
||||
|
||||
@@ -251,7 +258,7 @@ def test_non_matching_ignore_msg_errors(
|
||||
result = cli_runner.invoke(cli_app, [str(test_file), "--ignore-messages", r"(No match\.$)"])
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert "Error! Issues detected." in result.stdout
|
||||
+ assert "Error! Issues detected." in result.output
|
||||
|
||||
@staticmethod
|
||||
def test_table_substitution_error_fixed_by_ignore(
|
||||
@@ -285,7 +292,7 @@ def test_error_without_config_file(
|
||||
result = cli_runner.invoke(cli_app, str(test_file))
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(ERROR_CODE_REGEX.findall(result.stdout)) == 6
|
||||
+ assert len(ERROR_CODE_REGEX.findall(result.output)) == 6
|
||||
|
||||
@staticmethod
|
||||
def test_no_error_with_set_ini_config_file(
|
||||
@@ -342,7 +349,7 @@ def test_file_1_is_bad_without_config(
|
||||
result = cli_runner.invoke(cli_app, [str(test_file), "--config", str(config_file)])
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(ERROR_CODE_REGEX.findall(result.stdout)) == 6
|
||||
+ assert len(ERROR_CODE_REGEX.findall(result.output)) == 6
|
||||
|
||||
@staticmethod
|
||||
def test_file_2_is_bad_without_config(
|
||||
@@ -355,7 +362,7 @@ def test_file_2_is_bad_without_config(
|
||||
result = cli_runner.invoke(cli_app, [str(test_file), "--config", str(config_file)])
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(ERROR_CODE_REGEX.findall(result.stdout)) == 2
|
||||
+ assert len(ERROR_CODE_REGEX.findall(result.output)) == 2
|
||||
|
||||
@staticmethod
|
||||
@pytest.mark.xfail(
|
||||
@@ -385,7 +392,7 @@ def test_bad_file_2_with_implicit_config_some_errors(
|
||||
result = cli_runner.invoke(cli_app, str(test_file))
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(ERROR_CODE_REGEX.findall(result.stdout)) == 1
|
||||
+ assert len(ERROR_CODE_REGEX.findall(result.output)) == 1
|
||||
|
||||
@staticmethod
|
||||
def test_bad_file_1_with_explicit_config_no_errors(
|
||||
@@ -411,7 +418,7 @@ def test_bad_file_2_with_explicit_config_some_errors(
|
||||
result = cli_runner.invoke(cli_app, [str(test_file), "--config", str(config_file)])
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(ERROR_CODE_REGEX.findall(result.stdout)) == 1
|
||||
+ assert len(ERROR_CODE_REGEX.findall(result.output)) == 1
|
||||
|
||||
|
||||
class TestWarningOnUnknownSettings:
|
||||
@@ -470,7 +477,7 @@ def test_custom_directive_and_role(
|
||||
result = cli_runner.invoke(cli_app, str(test_file))
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(ERROR_CODE_REGEX.findall(result.stdout)) == 4
|
||||
+ assert len(ERROR_CODE_REGEX.findall(result.output)) == 4
|
||||
|
||||
@staticmethod
|
||||
def test_custom_directive_and_role_with_ignore(
|
||||
@@ -556,10 +563,10 @@ def test_bad_example_has_issues(
|
||||
result = cli_runner.invoke(cli_app, str(test_file))
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert "custom-directive" in result.stdout
|
||||
- assert "custom-role" in result.stdout
|
||||
- assert "python" in result.stdout
|
||||
- assert "unmatched-substitution" in result.stdout
|
||||
+ assert "custom-directive" in result.output
|
||||
+ assert "custom-role" in result.output
|
||||
+ assert "python" in result.output
|
||||
+ assert "unmatched-substitution" in result.output
|
||||
|
||||
@staticmethod
|
||||
@pytest.mark.xfail(
|
||||
@@ -597,7 +604,7 @@ def test_bad_example_has_only_one_issue_pre310(
|
||||
result = cli_runner.invoke(cli_app, str(test_file))
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(re.findall(r"unexpected EOF while parsing", result.stdout)) == 1
|
||||
+ assert len(re.findall(r"unexpected EOF while parsing", result.output)) == 1
|
||||
|
||||
@staticmethod
|
||||
@pytest.mark.xfail(
|
||||
@@ -616,7 +623,7 @@ def test_bad_example_has_only_one_issue(
|
||||
result = cli_runner.invoke(cli_app, str(test_file))
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(re.findall(r"'\(' was never closed", result.stdout)) == 1
|
||||
+ assert len(re.findall(r"'\(' was never closed", result.output)) == 1
|
||||
|
||||
@staticmethod
|
||||
@pytest.mark.xfail(
|
||||
@@ -635,7 +642,7 @@ def test_nested_bad_example_has_only_one_issue_pre310(
|
||||
result = cli_runner.invoke(cli_app, str(test_file))
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(re.findall(r"unexpected EOF while parsing", result.stdout)) == 1
|
||||
+ assert len(re.findall(r"unexpected EOF while parsing", result.output)) == 1
|
||||
|
||||
@staticmethod
|
||||
@pytest.mark.xfail(
|
||||
@@ -654,4 +661,4 @@ def test_nested_bad_example_has_only_one_issue(
|
||||
result = cli_runner.invoke(cli_app, str(test_file))
|
||||
|
||||
assert result.exit_code != 0
|
||||
- assert len(re.findall(r"'\(' was never closed", result.stdout)) == 1
|
||||
+ assert len(re.findall(r"'\(' was never closed", result.output)) == 1
|
||||
diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py
|
||||
index ddb7684d..a0684547 100644
|
||||
--- a/tests/integration_tests/conftest.py
|
||||
+++ b/tests/integration_tests/conftest.py
|
||||
@@ -22,4 +22,4 @@ def cli_app_fixture() -> typer.Typer:
|
||||
@pytest.fixture(name="cli_runner")
|
||||
def cli_runner_fixture() -> typer.testing.CliRunner:
|
||||
"""Create CLI Test Runner."""
|
||||
- return typer.testing.CliRunner(mix_stderr=True)
|
||||
+ return typer.testing.CliRunner()
|
||||
Reference in New Issue
Block a user