commit:     ccaf8600d71b6b3ac910f6728765990821786362
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 11 11:35:49 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 11 13:09:34 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ccaf8600

dev-python/sphinxcontrib-websupport: Bump to 2.0.0

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/sphinxcontrib-websupport/Manifest       |  1 +
 ...nxcontrib-websupport-2.0.0-fix-sqlalchemy.patch | 57 ++++++++++++++++++++++
 .../sphinxcontrib-websupport-2.0.0.ebuild          | 49 +++++++++++++++++++
 3 files changed, 107 insertions(+)

diff --git a/dev-python/sphinxcontrib-websupport/Manifest 
b/dev-python/sphinxcontrib-websupport/Manifest
index 71079fde8dc4..946287713db6 100644
--- a/dev-python/sphinxcontrib-websupport/Manifest
+++ b/dev-python/sphinxcontrib-websupport/Manifest
@@ -1 +1,2 @@
 DIST sphinxcontrib_websupport-1.2.7.tar.gz 599362 BLAKE2B 
544e77a739e0ecd9391893f56eeec2df4d5ddc6840a30e9a92e84e35e9ed0a765d4190790a13e329621ba045ee46b5e01d4d0825b6f37e9848953f9e796ae8af
 SHA512 
daa5ecf6fd3fb6df6a9a3b60668d42d50d93454dc3c2703a1dd43d75220b326e90c5e0ae2cca27afe62e41ae03e7144e6b4cfe70096b857af74c8981fadba9ca
+DIST sphinxcontrib_websupport-2.0.0.tar.gz 600125 BLAKE2B 
975ff0ceb1f94a87cf57f0ea7f9b80aae4dea7583d90ceb142491ea935201acbb21828b5f56f104fa95643cbc8050c21459c34da123172292955908a2bfb036b
 SHA512 
2a38530db266b6eb26f200ac135a98d1ea982baae4d20fa6dbccc8ff36c6f4c4b7fe012665372c1065553cd27ebba4178127b40481e0b25363436a4a7a3920e0

diff --git 
a/dev-python/sphinxcontrib-websupport/files/sphinxcontrib-websupport-2.0.0-fix-sqlalchemy.patch
 
b/dev-python/sphinxcontrib-websupport/files/sphinxcontrib-websupport-2.0.0-fix-sqlalchemy.patch
new file mode 100644
index 000000000000..c735988155b6
--- /dev/null
+++ 
b/dev-python/sphinxcontrib-websupport/files/sphinxcontrib-websupport-2.0.0-fix-sqlalchemy.patch
@@ -0,0 +1,57 @@
+diff --git a/sphinxcontrib/websupport/storage/sqlalchemy_db.py 
b/sphinxcontrib/websupport/storage/sqlalchemy_db.py
+index e681a68..13e094e 100644
+--- a/sphinxcontrib/websupport/storage/sqlalchemy_db.py
++++ b/sphinxcontrib/websupport/storage/sqlalchemy_db.py
+@@ -5,10 +5,11 @@
+ 
+ from __future__ import annotations
+ 
+-from datetime import datetime, timezone
++from datetime import datetime
+ 
+ from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, 
String, Text
+ from sqlalchemy.orm import aliased, declarative_base, relationship, 
sessionmaker
++from sqlalchemy.sql.expression import true
+ 
+ Base = declarative_base()
+ Session = sessionmaker()
+@@ -51,7 +52,7 @@ def nested_comments(self, username, moderator):
+ 
+         # Filter out all comments that are not moderated yet.
+         if not moderator:
+-            q = q.filter(Comment.displayed is True)
++            q = q.filter(Comment.displayed == true())
+ 
+         # Retrieve all results. Results must be ordered by Comment.path
+         # so that we can easily transform them from a flat list to a tree.
+@@ -159,7 +160,7 @@ def serializable(self, vote=0):
+         """Creates a serializable representation of the comment. This is
+         converted to JSON, and used on the client side.
+         """
+-        delta = datetime.now(tz=timezone.utc) - self.time
++        delta = datetime.now() - self.time  # noqa: DTZ005
+ 
+         time = {
+             "year": self.time.year,
+diff --git a/sphinxcontrib/websupport/storage/sqlalchemystorage.py 
b/sphinxcontrib/websupport/storage/sqlalchemystorage.py
+index 070692b..b48c32f 100644
+--- a/sphinxcontrib/websupport/storage/sqlalchemystorage.py
++++ b/sphinxcontrib/websupport/storage/sqlalchemystorage.py
+@@ -2,7 +2,7 @@
+ 
+ from __future__ import annotations
+ 
+-from datetime import datetime, timezone
++from datetime import datetime
+ 
+ import sqlalchemy
+ from sqlalchemy.orm import aliased
+@@ -72,7 +72,7 @@ def add_comment(self, text, displayed, username, time,
+                 raise CommentNotAllowedError(msg)
+ 
+         comment = Comment(text, displayed, username, 0,
+-                          time or datetime.now(tz=timezone.utc), proposal, 
proposal_diff)
++                          time or datetime.now(), proposal, proposal_diff)  # 
noqa: DTZ005
+         session.add(comment)
+         session.flush()
+         # We have to flush the session before setting the path so the

diff --git 
a/dev-python/sphinxcontrib-websupport/sphinxcontrib-websupport-2.0.0.ebuild 
b/dev-python/sphinxcontrib-websupport/sphinxcontrib-websupport-2.0.0.ebuild
new file mode 100644
index 000000000000..e40d74394481
--- /dev/null
+++ b/dev-python/sphinxcontrib-websupport/sphinxcontrib-websupport-2.0.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=flit
+PYTHON_TESTED=( pypy3_11 python3_{11..14} )
+PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Sphinx websupport extension"
+HOMEPAGE="
+       https://www.sphinx-doc.org/
+       https://github.com/sphinx-doc/sphinxcontrib-websupport/
+       https://pypi.org/project/sphinxcontrib-websupport/
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-solaris"
+
+RDEPEND="
+       dev-python/jinja2[${PYTHON_USEDEP}]
+       dev-python/sphinxcontrib-serializinghtml[${PYTHON_USEDEP}]
+"
+# avoid circular dependency with sphinx
+PDEPEND="
+       >=dev-python/sphinx-5[${PYTHON_USEDEP}]
+"
+# there are additional optional test deps on sqlalchemy and whoosh
+BDEPEND="
+       test? (
+               ${PDEPEND}
+               $(python_gen_cond_dep '
+                       dev-python/sqlalchemy[${PYTHON_USEDEP}]
+                       dev-python/whoosh[${PYTHON_USEDEP}]
+               ' "${PYTHON_TESTED[@]}")
+       )
+"
+
+EPYTEST_PLUGINS=()
+EPYTEST_XDIST=1
+distutils_enable_tests pytest
+
+PATCHES=(
+       # https://github.com/sphinx-doc/sphinxcontrib-websupport/pull/78
+       "${FILESDIR}/${P}-fix-sqlalchemy.patch"
+)

Reply via email to