15
0
Files
python-docformatter/support-python-312.patch
Steve Kowalik 487f5a9eaa - Update to 1.7.5:
* Features
    + fix: not recognizing `yield` as a sphinx field name
    + feat: support epytext style
    + feat: use tomllib for Python 3.11+
    + feat: wrap Sphinx style long parameter descriptions
    + feat: add option for user to provide list of words not to capitalize
    + Support python 3.11
  * Bug Fixes
    + fix: summary with back ticks and sphinx field names with periods
    + fix: removing newline between Sphinx field lists
    + fix: wrapping issues with reST directives, quoted URLs, and Sphinx
      field lists
    + fix: improper wrapping of short anonymous hyperlnks
    + fix: removing blank line after import section
    + fix: IndexError when only URL in long description
    + fix: removing newline after shebang
    + fix: not capitalizing first word when summary ends in period
    + fix: adding newlines around wrapped URL
    + fix: adding blank line in summary with symbol
    + fix: remove blank lines after line beginning with 'def'
    + fix: update URL handling functions
- Switch to autosetup and pyproject macros.
- No more greedy globs in %files.
- Add patches:
  * remove-mock.patch
    + Do not use external mock module
  * support-python-312.patch
    + Support Python 3.12+ changes
  * do-not-require-venv.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docformatter?expand=0&rev=19
2024-11-29 00:00:36 +00:00

77 lines
2.4 KiB
Diff

From ea60c5528506361f1f9edbeabb75ff874bb77046 Mon Sep 17 00:00:00 2001
From: finswimmer <finswimmer77@gmail.com>
Date: Sat, 19 Oct 2024 13:22:28 +0200
Subject: [PATCH 1/2] feat: drop support for Python < 3.9
Added CI pipelines for Pyton 3.12, 3.13
---
.github/workflows/ci.yml | 6 +--
pyproject.toml | 46 ++++++++++----------
tests/_data/string_files/do_format_code.toml | 6 +--
tests/test_docformatter.py | 14 +++---
4 files changed, 35 insertions(+), 37 deletions(-)
diff --git a/tests/_data/string_files/do_format_code.toml b/tests/_data/string_files/do_format_code.toml
index 5d886f3..469c78b 100644
--- a/tests/_data/string_files/do_format_code.toml
+++ b/tests/_data/string_files/do_format_code.toml
@@ -37,7 +37,7 @@ instring='''
CONST = 123
"""docstring for CONST."""
- '''
+'''
outstring='''
CONST = 123
"""docstring for CONST."""
@@ -50,7 +50,7 @@ instring='''
:cvar test_int: a class attribute.
..py.method: big_method()
"""
- '''
+'''
outstring='''
class TestClass:
"""This is a class docstring.
@@ -74,7 +74,7 @@ instring='''
"""This is a second class variable docstring."""
- '''
+'''
outstring='''
class TestClass:
"""This is a class docstring."""
diff --git a/tests/test_docformatter.py b/tests/test_docformatter.py
index 20c0809..dbad7c0 100644
--- a/tests/test_docformatter.py
+++ b/tests/test_docformatter.py
@@ -688,9 +688,9 @@ class TestEndToEndPyproject:
"contents",
[
'''\
- class TestFoo():
- """Docstring that should not have a pre-summary space."""
- '''
+class TestFoo():
+ """ Docstring that should not have a pre-summary space."""
+'''
],
)
@pytest.mark.parametrize(
@@ -725,10 +725,10 @@ def test_no_pre_summary_space_using_pyproject(
See issue #119.
"""
assert '''\
-@@ -1,3 +1,2 @@
- class TestFoo():
- """Docstring that should not have a pre-summary space."""
--
+@@ -1,2 +1,2 @@
+ class TestFoo():
+- """ Docstring that should not have a pre-summary space."""
++ """Docstring that should not have a pre-summary space."""
''' == "\n".join(
run_docformatter.communicate()[0].decode().replace("\r", "").split("\n")[2:]
)