#35 Update to 4.2.0
Merged 2 years ago by ksurma. Opened 2 years ago by ksurma.
rpms/ ksurma/python-sphinx 4.2.0  into  rawhide

file modified
+1
@@ -32,3 +32,4 @@ 

  /Sphinx-3.5.4.tar.gz

  /Sphinx-4.0.2.tar.gz

  /Sphinx-4.1.2.tar.gz

+ /Sphinx-4.2.0.tar.gz

@@ -1,62 +0,0 @@ 

- From 06ec5b027d01e8f7717e4687f89f335e83545ff9 Mon Sep 17 00:00:00 2001

- From: Takeshi KOMIYA <i.tkomiya@gmail.com>

- Date: Wed, 18 Aug 2021 01:50:08 +0900

- Subject: [PATCH] Fix test: Tests has been broken with pygments-2.10+

- 

- ---

-  tests/test_intl.py | 21 +++++++++++++++++----

-  1 file changed, 17 insertions(+), 4 deletions(-)

- 

- diff --git a/tests/test_intl.py b/tests/test_intl.py

- index 7791b4aeed5..e9e7ee9e24b 100644

- --- a/tests/test_intl.py

- +++ b/tests/test_intl.py

- @@ -12,6 +12,7 @@

-  import os

-  import re

-  

- +import pygments

-  import pytest

-  from babel.messages import mofile, pofile

-  from babel.messages.catalog import Catalog

- @@ -30,6 +31,8 @@

-      },

-  )

-  

- +pygments_version = tuple(int(v) for v in pygments.__version__.split('.'))

- +

-  

-  def read_po(pathname):

-      with pathname.open() as f:

- @@ -1060,8 +1063,13 @@ def test_additional_targets_should_not_be_translated(app):

-      assert_count(expected_expr, result, 1)

-  

-      # C code block with lang should not be translated but be *C* highlighted

- -    expected_expr = ("""<span class="cp">#include</span> """

- -                     """<span class="cpf">&lt;stdio.h&gt;</span>""")

- +    if pygments_version < (2, 10, 0):

- +        expected_expr = ("""<span class="cp">#include</span> """

- +                         """<span class="cpf">&lt;stdio.h&gt;</span>""")

- +    else:

- +        expected_expr = ("""<span class="cp">#include</span>"""

- +                         """<span class="w"> </span>"""

- +                         """<span class="cpf">&lt;stdio.h&gt;</span>""")

-      assert_count(expected_expr, result, 1)

-  

-      # literal block in list item should not be translated

- @@ -1138,8 +1146,13 @@ def test_additional_targets_should_be_translated(app):

-      assert_count(expected_expr, result, 1)

-  

-      # C code block with lang should be translated and be *C* highlighted

- -    expected_expr = ("""<span class="cp">#include</span> """

- -                     """<span class="cpf">&lt;STDIO.H&gt;</span>""")

- +    if pygments_version < (2, 10, 0):

- +        expected_expr = ("""<span class="cp">#include</span> """

- +                         """<span class="cpf">&lt;STDIO.H&gt;</span>""")

- +    else:

- +        expected_expr = ("""<span class="cp">#include</span>"""

- +                         """<span class="w"> </span>"""

- +                         """<span class="cpf">&lt;STDIO.H&gt;</span>""")

-      assert_count(expected_expr, result, 1)

-  

-      # literal block in list item should be translated

file modified
+12 -10
@@ -24,11 +24,11 @@ 

  %global upstream_name Sphinx

  

  Name:       python-sphinx

- %global     general_version 4.1.2

+ %global     general_version 4.2.0

  #global     prerel ...

  %global     upstream_version %{general_version}%{?prerel}

  Version:    %{general_version}%{?prerel:~%{prerel}}

- Release:    2%{?dist}

+ Release:    1%{?dist}

  Epoch:      1

  Summary:    Python documentation generator

  
@@ -44,12 +44,6 @@ 

  # Allow extra themes to exist. We pull in python3-sphinx-theme-alabaster

  # which causes that test to fail.

  Patch1:     sphinx-test_theming.diff

- # `types.Union` was renamed to `types.UnionType` on the HEAD of Python 3.10

- # (refs: python/cpython#27342). Afterwars, sphinx-build crashes because of ImportError

- Patch2:     rename-types-Union-to-types-UnionType.patch

- # Fix test failures with python-pygments 2.10+

- # https://github.com/sphinx-doc/sphinx/pull/9557

- Patch3:     fix-tests-with-pygments-210.patch

  

  BuildArch:     noarch

  
@@ -339,10 +333,9 @@ 

  %if %{with tests}

  %check

  # Currently, all linkcheck tests and test_latex_images need internet

- # test_signature_annotations is broken on Python 3.10 (at least in 3.5.4)

  %pytest \

  %if %{without internet}

-     -k "not linkcheck and not test_latex_images and not test_signature_annotations" \

+     -k "not linkcheck and not test_latex_images" \

  %endif

  ;

  %endif
@@ -371,6 +364,15 @@ 

  

  

  %changelog

+ * Fri Sep 17 2021 Karolina Surma <ksurma@redhat.com> - 1:4.2.0-1

+ - Update to 4.2.0

+ - Fixes rhbz#2003427

+ 

+ * Thu Sep 16 2021 Karolina Surma <ksurma@redhat.com> - 1:4.1.2-3

+ - Display typing objects correctly with Python 3.10 (fix FTBFS)

+ - Generate correct reference to parent class if class has `_name` attribute

+ - Enable previously deselected test

+ 

  * Wed Aug 18 2021 Karolina Surma <ksurma@redhat.com> - 1:4.1.2-2

  - Patch python-sphinx to work with python-pygments >=2.10

  

@@ -1,49 +0,0 @@ 

- From 8b2031c747e7c7e6b845ee2e3db47de617d33cc6 Mon Sep 17 00:00:00 2001

- From: Takeshi KOMIYA <i.tkomiya@gmail.com>

- Date: Fri, 30 Jul 2021 01:27:38 +0900

- Subject: [PATCH] Fix #9512: sphinx-build: crashed with the HEAD of Python 3.10

- 

- Recently, `types.Union` was renamed to `types.UnionType` on the HEAD

- of 3.10 (refs: python/cpython#27342). After this change, sphinx-build

- has been crashed because of ImportError.

- ---

-  sphinx/util/typing.py | 12 ++++++------

-  1 files changed, 8 insertions(+), 6 deletions(-)

- 

- diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py

- index f1723c035a..012d32e524 100644

- --- a/sphinx/util/typing.py

- +++ b/sphinx/util/typing.py

- @@ -33,10 +33,10 @@ def _evaluate(self, globalns: Dict, localns: Dict) -> Any:

-              ref = _ForwardRef(self.arg)

-              return ref._eval_type(globalns, localns)

-  

- -if sys.version_info > (3, 10):

- -    from types import Union as types_Union

- -else:

- -    types_Union = None

- +try:

- +    from types import UnionType  # type: ignore  # python 3.10 or above

- +except ImportError:

- +    UnionType = None

-  

-  if False:

-      # For type annotation

- @@ -114,7 +114,7 @@ def restify(cls: Optional[Type]) -> str:

-              return ':class:`%s`' % INVALID_BUILTIN_CLASSES[cls]

-          elif inspect.isNewType(cls):

-              return ':class:`%s`' % cls.__name__

- -        elif types_Union and isinstance(cls, types_Union):

- +        elif UnionType and isinstance(cls, UnionType):

-              if len(cls.__args__) > 1 and None in cls.__args__:

-                  args = ' | '.join(restify(a) for a in cls.__args__ if a)

-                  return 'Optional[%s]' % args

- @@ -337,7 +337,7 @@ def _stringify_py37(annotation: Any) -> str:

-      elif hasattr(annotation, '__origin__'):

-          # instantiated generic provided by a user

-          qualname = stringify(annotation.__origin__)

- -    elif types_Union and isinstance(annotation, types_Union):  # types.Union (for py3.10+)

- +    elif UnionType and isinstance(annotation, UnionType):  # types.Union (for py3.10+)

-          qualname = 'types.Union'

-      else:

-          # we weren't able to extract the base type, appending arguments would

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (Sphinx-4.1.2.tar.gz) = 1fe998de7b8fc47989e186835748b7fb5d0b523db95434515b6af29b56d28372f2f92ab917c27cbed51aa0cad13175eda8bf4fc93a8726eb5e93e9bc6995e457

+ SHA512 (Sphinx-4.2.0.tar.gz) = 6c6a2424362805b758c43136a9293dcfb02d45af6e6dc2dd7ed9382f6ae04ecfbd416efeecb42219b67d026a4a0b007500e87b20d81847ab48e2ccfcdca52e75

The impact was tested together with docutils-0.17.1 and cross-checked with a control copr repository.
It looks like the only problematic package is bodhi, will report it.

Build succeeded.

rebased onto 9a0c2b819ef18f57954173f9b2e98c1e888dfb27

2 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

specfile-error error: %changelog not in descending chronological order

4 new commits added

  • Update to 4.2.0
  • Enable one of previously deselected tests
  • Add references to the upstream commits
  • Backport bugfixes from upstream 4.1.x branch for compatibility with Python 3.10-rc2
2 years ago

Yep, overlook. Now it should be fine.

Build succeeded.

Looks good to be merged. I'd personally squash Add references to the upstream commits, but that is not a blocker.

Thank you!

rebased onto f0f09a5

2 years ago

Build succeeded.

Squashed - shipping it.

Pull-Request has been merged by ksurma

2 years ago