15
0

Compare commits

8 Commits

Author SHA256 Message Date
306fb6e0ba Accepting request 1318159 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1318159
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-docformatter?expand=0&rev=12
2025-11-17 11:19:58 +00:00
13c9812c9d - Add upstream ignore-utf16.patch to fix test failure
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docformatter?expand=0&rev=25
2025-11-17 07:15:55 +00:00
0dd3e5ab49 Accepting request 1278544 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1278544
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-docformatter?expand=0&rev=11
2025-05-20 15:04:08 +00:00
e320241c99 - Update to 1.7.7
* Merged pull requests:
    + chore(deps-dev): bump black from 22.12.0 to 24.3.0
    + chore(deps-dev): bump jinja2 from 3.1.4 to 3.1.6
    + chore(deps-dev): bump requests from 2.31.0 to 2.32.2
    + chore(deps-dev): bump virtualenv from 20.21.1 to 20.26.6
    + chore(deps-dev): bump zipp from 3.15.0 to 3.19.1
    + chore(deps-dev): bump urllib3 from 2.0.7 to 2.2.2
- from version 1.7.6
  * Features
    + prefer new unittest.mock from the standard library #280
    + Handle abbreviation 'etc.' (et cetera) #273
  * Bug Fixes
    + Do not double-process urls #284
  * Merged pull requests:
    + Fix pre-commit syntax #266
    + Update version listed in documentation's Pre-Commit example #262
    + Add missing comma in requirements table #261
- Drop remove-mock.patch, merged upstream
- Drop support-python-312.patch, merged upstream
- Use Python 3.11 on SLE-15 by default

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docformatter?expand=0&rev=23
2025-05-20 08:06:42 +00:00
6b80c47ec9 Accepting request 1238300 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1238300
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-docformatter?expand=0&rev=10
2025-01-16 19:24:21 +00:00
b66852addb - Fix packaging
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docformatter?expand=0&rev=21
2025-01-16 16:29:04 +00:00
f94bb9d6c0 Accepting request 1227206 from devel:languages:python
- 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/request/show/1227206
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-docformatter?expand=0&rev=9
2024-11-30 12:27:45 +00:00
a9e69a49fc - 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
6 changed files with 142 additions and 19 deletions

15
do-not-require-venv.patch Normal file
View File

@@ -0,0 +1,15 @@
Index: docformatter-1.7.5/tests/conftest.py
===================================================================
--- docformatter-1.7.5.orig/tests/conftest.py
+++ docformatter-1.7.5/tests/conftest.py
@@ -113,8 +113,9 @@ def run_docformatter(arguments, temporar
os.environ["VIRTUAL_ENV"] + "/bin/docformatter",
]
else:
+ version = f"{sys.version_info.major}.{sys.version_info.minor}"
DOCFORMATTER_COMMAND = [
- os.environ["VIRTUAL_ENV"] + "/bin/docformatter",
+ f"{os.environ['BUILDROOT']}/usr/bin/docformatter-{version}",
] # pragma: no cover
if "-" not in arguments:

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:064e6d81f04ac96bc0d176cbaae953a0332482b22d3ad70d47c8a7f2732eef6f
size 208955

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d76165e3a52384ed982889672751bf3d96f3126b57c47c04f66925b35dd7374
size 315538

32
ignore-utf16.patch Normal file
View File

@@ -0,0 +1,32 @@
From 412479e5d6b02f7dd7e20f870132a413dc83898a Mon Sep 17 00:00:00 2001
From: Doyle Rowland <doyle.rowland@reliaqual.com>
Date: Thu, 14 Aug 2025 17:58:02 -0400
Subject: [PATCH] fix: explicitly ignore utf_16 and utf_32 encoding
---
src/docformatter/encode.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/docformatter/encode.py b/src/docformatter/encode.py
index ac55ee9..c7e36f0 100644
--- a/src/docformatter/encode.py
+++ b/src/docformatter/encode.py
@@ -64,9 +64,15 @@ def do_detect_encoding(self, filename) -> None:
"""
try:
detection_result = from_path(filename).best()
- self.encoding = (
- detection_result.encoding if detection_result else self.DEFAULT_ENCODING
- )
+ if detection_result and detection_result.encoding in ["utf_16", "utf_32"]:
+ # Treat undetectable/binary encodings as failure
+ self.encoding = self.DEFAULT_ENCODING
+ else:
+ self.encoding = (
+ detection_result.encoding
+ if detection_result
+ else self.DEFAULT_ENCODING
+ )
# Check for correctness of encoding.
with self.do_open_with_encoding(filename) as check_file:

View File

@@ -1,3 +1,73 @@
-------------------------------------------------------------------
Fri Nov 14 13:51:14 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Add upstream ignore-utf16.patch to fix test failure
-------------------------------------------------------------------
Mon May 19 10:01:24 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 1.7.7
* Merged pull requests:
+ chore(deps-dev): bump black from 22.12.0 to 24.3.0
+ chore(deps-dev): bump jinja2 from 3.1.4 to 3.1.6
+ chore(deps-dev): bump requests from 2.31.0 to 2.32.2
+ chore(deps-dev): bump virtualenv from 20.21.1 to 20.26.6
+ chore(deps-dev): bump zipp from 3.15.0 to 3.19.1
+ chore(deps-dev): bump urllib3 from 2.0.7 to 2.2.2
- from version 1.7.6
* Features
+ prefer new unittest.mock from the standard library #280
+ Handle abbreviation 'etc.' (et cetera) #273
* Bug Fixes
+ Do not double-process urls #284
* Merged pull requests:
+ Fix pre-commit syntax #266
+ Update version listed in documentation's Pre-Commit example #262
+ Add missing comma in requirements table #261
- Drop remove-mock.patch, merged upstream
- Drop support-python-312.patch, merged upstream
- Use Python 3.11 on SLE-15 by default
-------------------------------------------------------------------
Thu Jan 16 14:06:31 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Fix packaging
-------------------------------------------------------------------
Fri Nov 29 00:00:01 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- 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
+ Do not require a virtualenv to run the testsuite
-------------------------------------------------------------------
Thu May 20 07:18:31 UTC 2021 - pgajdos@suse.com

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-docformatter
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,28 +16,31 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%{?sle15_python_module_pythons}
Name: python-docformatter
Version: 1.4
Version: 1.7.7
Release: 0
Summary: Utility to re-format docstrings per PEP 257
License: MIT
Group: Development/Languages/Python
URL: https://github.com/myint/docformatter
Source: https://files.pythonhosted.org/packages/source/d/docformatter/docformatter-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
Source: https://github.com/PyCQA/docformatter/archive/refs/tags/v%{version}.tar.gz#/docformatter-%{version}.tar.gz
# PATCH-FIX-OPENSUSE Do not require virtualenvs to run the tests
Patch0: do-not-require-venv.patch
# PATCH-FIX-UPSTREAM cherry-pick from https://github.com/PyCQA/docformatter/pull/323 fix: issue 321
Patch1: ignore-utf16.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module poetry-core}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-setuptools
Requires: python-charset-normalizer
Requires: python-untokenize
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
# SECTION test requirements
%if %{suse_version} <= 1500
BuildRequires: python2-mock
%endif
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module charset-normalizer >= 3.0}
BuildRequires: %{python_module untokenize}
# /SECTION
%python_subpackages
@@ -63,18 +66,20 @@ docformatter also handles some of the PEP 8 conventions.
and some editors (or more recently, reindent.py) will trim them.
%prep
%setup -q -n docformatter-%{version}
sed -i -e '/^#!\//, 1d' docformatter.py
%autosetup -p1 -n docformatter-%{version}
sed -i -e '/^#!\//, 1d' src/docformatter/*.py
chmod -x src/docformatter/__main__.py
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/docformatter
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export BUILDROOT=%{buildroot}
%pytest
%post
@@ -87,6 +92,7 @@ sed -i -e '/^#!\//, 1d' docformatter.py
%license LICENSE
%doc AUTHORS.rst README.rst
%python_alternative %{_bindir}/docformatter
%{python_sitelib}/*
%{python_sitelib}/docformatter
%{python_sitelib}/docformatter-%{version}.dist-info
%changelog