- Refactor pygments-2.14.patch to not use distutils.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=81
This commit is contained in:
Steve Kowalik 2023-01-24 06:53:46 +00:00 committed by Git OBS Bridge
parent 99e4b3adf3
commit 76b2628c85
3 changed files with 9 additions and 2 deletions

View File

@ -656,11 +656,11 @@ Index: docutils-0.19/docutils/utils/code_analyzer.py
from docutils import ApplicationError
try:
import pygments
+ from distutils.version import LooseVersion
+ from packaging.version import Version
from pygments.lexers import get_lexer_by_name
from pygments.formatters.html import _get_ttype_class
with_pygments = True
+ pygments_version = LooseVersion(pygments.__version__)
+ pygments_version = Version(pygments.__version__)
except ImportError:
with_pygments = False
+ pygments_version = '0'

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Jan 24 06:53:16 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Refactor pygments-2.14.patch to not use distutils.
-------------------------------------------------------------------
Tue Jan 10 15:42:55 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>

View File

@ -45,11 +45,13 @@ Requires(post): update-alternatives
Requires(postun):update-alternatives
Recommends: python-Pillow
Recommends: python-Pygments
Requires: python-packaging
Recommends: python-roman
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module Pillow}
BuildRequires: %{python_module Pygments}
BuildRequires: %{python_module packaging}
BuildRequires: %{python_module roman}
%endif
%if "%{python_flavor}" == "python3" || "%{?python_provides}" == "python3"