Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-gi-docgen for 
openSUSE:Factory checked in at 2023-03-24 15:17:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-gi-docgen (Old)
 and      /work/SRC/openSUSE:Factory/.python-gi-docgen.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-gi-docgen"

Fri Mar 24 15:17:58 2023 rev:7 rq:1073243 version:2023.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-gi-docgen/python-gi-docgen.changes        
2022-11-16 15:42:28.631629987 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-gi-docgen.new.31432/python-gi-docgen.changes 
    2023-03-24 15:18:15.722212485 +0100
@@ -1,0 +2,8 @@
+Fri Jan  6 19:34:04 UTC 2023 - Bjørn Lie <bjorn....@gmail.com>
+
+- Update to version 2023.1:
+  + Added: Use tomlib for Python >= 3.11 and tomli/toml for Python
+    < 3.11
+  + Fixed: Use the proper link fragment for interface prerequisite
+
+-------------------------------------------------------------------

Old:
----
  gi-docgen-2022.2.tar.gz

New:
----
  gi-docgen-2023.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-gi-docgen.spec ++++++
--- /var/tmp/diff_new_pack.f3usux/_old  2023-03-24 15:18:16.178214863 +0100
+++ /var/tmp/diff_new_pack.f3usux/_new  2023-03-24 15:18:16.186214904 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-gi-docgen
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define pythons python3
 Name:           python-gi-docgen
-Version:        2022.2
+Version:        2023.1
 Release:        0
 Summary:        Documentation tool for GObject-based libraries
 License:        Apache-2.0 AND GPL-3.0-or-later AND CC0-1.0

++++++ gi-docgen-2022.2.tar.gz -> gi-docgen-2023.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/.reuse/dep5 
new/gi-docgen-2023.1/.reuse/dep5
--- old/gi-docgen-2022.2/.reuse/dep5    2022-05-22 15:42:27.000000000 +0200
+++ new/gi-docgen-2023.1/.reuse/dep5    2022-11-12 22:47:42.000000000 +0100
@@ -3,6 +3,14 @@
 Upstream-Contact: Emmanuele Bassi <eba...@gnome.org>
 Source: https://gitlab.gnome.org/ebassi/gi-docgen
 
+Files: README.md
+Copyright: 2021  GNOME Foundation
+License: Apache-2.0 OR GPL-3.0-or-later
+
+Files: CHANGES.md
+Copyright: 2022  Emmanuele Bassi
+License: CC0-1.0
+
 Files: gi-docgen.pc.in
 Copyright: 2021  GNOME Foundation
 License: CC0-1.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/CHANGES.md 
new/gi-docgen-2023.1/CHANGES.md
--- old/gi-docgen-2022.2/CHANGES.md     1970-01-01 01:00:00.000000000 +0100
+++ new/gi-docgen-2023.1/CHANGES.md     2023-01-06 20:02:06.000000000 +0100
@@ -0,0 +1,23 @@
+# Changes
+
+All notable changes to this project will be documented in this file.
+
+## [Unreleased]
+
+### Added
+
+### Changed
+
+### Fixed
+
+### Removed
+
+## [2023.1] - 2023-01-06
+
+### Added
+
+- Use tomlib for Python >= 3.11 and tomli/toml for Python < 3.11 [!168, !172]
+
+### Fixed
+
+- Use the proper link fragment for interface prerequisite [#148]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/MANIFEST.in 
new/gi-docgen-2023.1/MANIFEST.in
--- old/gi-docgen-2022.2/MANIFEST.in    2021-12-12 17:24:35.000000000 +0100
+++ new/gi-docgen-2023.1/MANIFEST.in    2022-11-12 22:44:58.000000000 +0100
@@ -3,7 +3,7 @@
 
 include pyproject.toml
 include pytest.ini
-include README.md meson.build gi-docgen.pc.in
+include CHANGES.md README.md meson.build gi-docgen.pc.in
 include gi-docgen.py
 include .flake8
 include .green
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/PKG-INFO 
new/gi-docgen-2023.1/PKG-INFO
--- old/gi-docgen-2022.2/PKG-INFO       2022-11-07 17:31:31.290821800 +0100
+++ new/gi-docgen-2023.1/PKG-INFO       2023-01-06 20:04:20.412527000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: gi-docgen
-Version: 2022.2
+Version: 2023.1
 Summary: Documentation tool for GObject-based libraries
 Home-page: https://gitlab.gnome.org/GNOME/gi-docgen
 Author: Emmanuele Bassi
@@ -31,12 +31,6 @@
 License-File: LICENSES/Apache-2.0.txt
 License-File: LICENSES/GPL-3.0-or-later.txt
 
-<!--
-SPDX-FileCopyrightText: 2021 GNOME Foundation
-
-SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
--->
-
 GI-DocGen: Documentation tool for GObject-based libraries
 -------------------------------------------------------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/README.md 
new/gi-docgen-2023.1/README.md
--- old/gi-docgen-2022.2/README.md      2021-07-24 15:14:07.000000000 +0200
+++ new/gi-docgen-2023.1/README.md      2022-11-12 22:47:02.000000000 +0100
@@ -1,9 +1,3 @@
-<!--
-SPDX-FileCopyrightText: 2021 GNOME Foundation
-
-SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
--->
-
 GI-DocGen: Documentation tool for GObject-based libraries
 -------------------------------------------------------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/gi_docgen.egg-info/PKG-INFO 
new/gi-docgen-2023.1/gi_docgen.egg-info/PKG-INFO
--- old/gi-docgen-2022.2/gi_docgen.egg-info/PKG-INFO    2022-11-07 
17:31:31.000000000 +0100
+++ new/gi-docgen-2023.1/gi_docgen.egg-info/PKG-INFO    2023-01-06 
20:04:20.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: gi-docgen
-Version: 2022.2
+Version: 2023.1
 Summary: Documentation tool for GObject-based libraries
 Home-page: https://gitlab.gnome.org/GNOME/gi-docgen
 Author: Emmanuele Bassi
@@ -31,12 +31,6 @@
 License-File: LICENSES/Apache-2.0.txt
 License-File: LICENSES/GPL-3.0-or-later.txt
 
-<!--
-SPDX-FileCopyrightText: 2021 GNOME Foundation
-
-SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
--->
-
 GI-DocGen: Documentation tool for GObject-based libraries
 -------------------------------------------------------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/gi_docgen.egg-info/SOURCES.txt 
new/gi-docgen-2023.1/gi_docgen.egg-info/SOURCES.txt
--- old/gi-docgen-2022.2/gi_docgen.egg-info/SOURCES.txt 2022-11-07 
17:31:31.000000000 +0100
+++ new/gi-docgen-2023.1/gi_docgen.egg-info/SOURCES.txt 2023-01-06 
20:04:20.000000000 +0100
@@ -1,5 +1,6 @@
 .flake8
 .green
+CHANGES.md
 CONTRIBUTING.md
 MANIFEST.in
 README.md
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/gi_docgen.egg-info/requires.txt 
new/gi-docgen-2023.1/gi_docgen.egg-info/requires.txt
--- old/gi-docgen-2022.2/gi_docgen.egg-info/requires.txt        2022-11-07 
17:31:31.000000000 +0100
+++ new/gi-docgen-2023.1/gi_docgen.egg-info/requires.txt        2023-01-06 
20:04:20.000000000 +0100
@@ -2,5 +2,7 @@
 MarkupSafe
 Pygments
 jinja2
-toml
 typogrify
+
+[:python_version < "3.11"]
+tomli
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/gidocgen/config.py 
new/gi-docgen-2023.1/gidocgen/config.py
--- old/gi-docgen-2022.2/gidocgen/config.py     2022-11-07 13:06:55.000000000 
+0100
+++ new/gi-docgen-2023.1/gidocgen/config.py     2022-11-29 14:14:22.000000000 
+0100
@@ -3,13 +3,45 @@
 
 import os
 import re
-import toml
+
+toml_module = None
+try:
+    import tomllib as toml_lib
+    toml_module = 'tomlib'
+except ImportError:
+    try:
+        import tomli as toml_lib
+        toml_module = 'tomli'
+    except ImportError:
+        import toml as toml_lib
+        toml_module = 'toml'
 
 from urllib.parse import urljoin
 
 from . import core, log, utils
 
 
+class TomlConfig:
+    """Wrapper class for TOML loading"""
+
+    @staticmethod
+    def load(toml):
+        log.debug(f"Using TOML module: {toml_module}")
+        if toml_module is None:
+            log.error("No toml module found")
+        elif toml_module in ['tomlib', 'tomli']:
+            try:
+                with open(toml, "rb") as f:
+                    return toml_lib.load(f)
+            except toml_lib.TOMLDecodeError as err:
+                log.error(f"Invalid configuration file: {toml}: {err}")
+        elif toml_module in ['toml']:
+            try:
+                return toml_lib.load(toml)
+            except toml_lib.TomlDecodeError as err:
+                log.error(f"Invalid configuration file: {toml}: {err}")
+
+
 class GIDocConfig:
     """Load and represent the configuration for gidocgen"""
     def __init__(self, config_file=None):
@@ -17,11 +49,8 @@
 
         self._config = {}
         if self._config_file is not None:
-            try:
-                log.debug(f"Reading configuration file: {self._config_file}")
-                self._config = toml.load(self._config_file)
-            except toml.TomlDecodeError as err:
-                log.error(f"Invalid configuration file: {self._config_file}: 
{err}")
+            log.debug(f"Reading configuration file: {self._config_file}")
+            self._config = TomlConfig.load(self._config_file)
 
     @property
     def library(self):
@@ -241,11 +270,8 @@
         self._config_file = os.path.join(templates_dir, template_name, 
f"{template_name}.toml")
 
         self._config = {}
-        try:
-            log.debug(f"Reading template configuration file: 
{self._config_file}")
-            self._config = toml.load(self._config_file)
-        except toml.TomlDecodeError as err:
-            log.error(f"Invalid template configuration file: 
{self._config_file}: {err}")
+        log.debug(f"Reading template configuration file: {self._config_file}")
+        self._config = TomlConfig.load(self._config_file)
 
     @property
     def name(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/gidocgen/core.py 
new/gi-docgen-2023.1/gidocgen/core.py
--- old/gi-docgen-2022.2/gidocgen/core.py       2022-02-12 19:05:10.000000000 
+0100
+++ new/gi-docgen-2023.1/gidocgen/core.py       2023-01-06 20:02:23.000000000 
+0100
@@ -1,4 +1,4 @@
 # SPDX-FileCopyrightText: 2020 GNOME Foundation <https://gnome.org>
 # SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 
-version = "2022.2"
+version = "2023.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/gidocgen/gdgenerate.py 
new/gi-docgen-2023.1/gidocgen/gdgenerate.py
--- old/gi-docgen-2022.2/gidocgen/gdgenerate.py 2022-07-29 21:14:45.000000000 
+0200
+++ new/gi-docgen-2023.1/gidocgen/gdgenerate.py 2023-01-06 19:58:29.000000000 
+0100
@@ -1253,6 +1253,16 @@
         self.requires_fqtn = f"{self.requires_namespace}.{self.requires_name}"
         log.debug(f"Preqrequisite for {self.fqtn}: {self.requires_fqtn}")
 
+        def prereq_link_fragment(_ns: gir.Namespace, ns: str, name: str) -> 
str:
+            if _ns.repository.find_class(name, ns) is not None:
+                return "class"
+            elif _ns.repository.find_interface(name, ns) is not None:
+                return "iface"
+            else:
+                log.error(f"Invalid prerequisite type {ns}.{name}")
+
+        self.requires_link_fragment = prereq_link_fragment(namespace, 
self.requires_namespace, self.requires_name)
+
         self.symbol_prefix = 
f"{namespace.symbol_prefix[0]}_{interface.symbol_prefix}"
         self.type_cname = interface.base_ctype
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/gidocgen/templates/basic/base.html 
new/gi-docgen-2023.1/gidocgen/templates/basic/base.html
--- old/gi-docgen-2022.2/gidocgen/templates/basic/base.html     2022-11-07 
13:06:55.000000000 +0100
+++ new/gi-docgen-2023.1/gidocgen/templates/basic/base.html     2022-11-23 
21:05:52.000000000 +0100
@@ -80,7 +80,7 @@
       {% block sidebar %}
       {% endblock %}
       <div class="section generator">
-        <p>Generated by gi-docgen {{ CONFIG.generator }}</p>
+        <p>Generated by <a 
href="https://gitlab.gnome.org/GNOME/gi-docgen";>gi-docgen</a> {{ 
CONFIG.generator }}</p>
       </div>
     </nav>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gi-docgen-2022.2/gidocgen/templates/basic/interface.html 
new/gi-docgen-2023.1/gidocgen/templates/basic/interface.html
--- old/gi-docgen-2022.2/gidocgen/templates/basic/interface.html        
2022-11-07 13:06:55.000000000 +0100
+++ new/gi-docgen-2023.1/gidocgen/templates/basic/interface.html        
2023-01-06 19:58:29.000000000 +0100
@@ -150,10 +150,10 @@
 
       <div class="docblock">
         <p>In order to implement {{ interface.name }}, your type must inherit 
from
-        {% if interface.requires_namespace == namespace.name -%}
-        <a href="class.{{ interface.requires_name }}.html">
+        {%- if interface.requires_namespace == namespace.name -%}
+        <a href="{{ interface.requires_link_fragment }}.{{ 
interface.requires_name }}.html">
         {%- else -%}
-        <a data-namespace="{{ interface.requires_namespace }}" 
data-link="class.{{ interface.requires_name }}.html" href="javascript:void(0)" 
class="external">
+        <a data-namespace="{{ interface.requires_namespace }}" data-link="{{ 
interface.requires_link_fragment }}.{{ interface.requires_name }}.html" 
href="javascript:void(0)" class="external">
         {%- endif -%}
         <code>{{ interface.requires_ctype }}</code></a>.</p>
       </div>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/meson.build 
new/gi-docgen-2023.1/meson.build
--- old/gi-docgen-2022.2/meson.build    2022-11-07 13:06:59.000000000 +0100
+++ new/gi-docgen-2023.1/meson.build    2023-01-06 20:02:14.000000000 +0100
@@ -3,7 +3,7 @@
 # SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
 
 project('gi-docgen',
-  version: '2022.2',
+  version: '2023.1',
   meson_version: '>= 0.55.0',
 )
 
@@ -13,7 +13,6 @@
     'markdown',
     'markupsafe',
     'pygments',
-    'toml',
     'typogrify',
   ],
 )
@@ -27,6 +26,26 @@
   error('gi-docgen requires at least markdown >= 3.2')
 endif
 
+if py.language_version().version_compare('<3.11')
+  tomli_version = run_command(
+    py, '-c', 'import tomli; print(tomli.__version__)',
+    check: false,
+  ).stdout().strip()
+  if tomli_version.version_compare('>=1.0')
+    message('Falling back to toml on Python <3.11')
+  else
+    toml_version = run_command(
+      py, '-c', 'import toml; print(toml.__version__)',
+      check: false,
+    ).stdout().strip()
+    if toml_version.version_compare('>=0.10.2')
+      warning('Falling back to deprecated toml module; please update to tomli')
+    else
+      error('tomli 1.0 or newer required on Python 3.10 and older')
+    endif
+  endif
+endif
+
 configure_file(
   input: 'gi-docgen.py',
   output: 'gi-docgen',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/pyproject.toml 
new/gi-docgen-2023.1/pyproject.toml
--- old/gi-docgen-2022.2/pyproject.toml 2022-11-07 13:06:59.000000000 +0100
+++ new/gi-docgen-2023.1/pyproject.toml 2022-12-30 17:58:24.000000000 +0100
@@ -39,7 +39,7 @@
 MarkupSafe = "^1"
 Pygments = "^2"
 Jinja2 = "^2"
-toml = "^0"
+tomli = { version = ">=1,<3", markers = "python_version < '3.11'" }
 typogrify = "^2"
 
 [tool.poetry.dev-dependencies]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gi-docgen-2022.2/setup.cfg 
new/gi-docgen-2023.1/setup.cfg
--- old/gi-docgen-2022.2/setup.cfg      2022-11-07 17:31:31.290821800 +0100
+++ new/gi-docgen-2023.1/setup.cfg      2023-01-06 20:04:20.412527000 +0100
@@ -51,7 +51,7 @@
        MarkupSafe
        Pygments
        jinja2
-       toml
+       tomli; python_version < '3.11'
        typogrify
 
 [options.entry_points]

Reply via email to