public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/css-parser/, dev-python/css-parser/files/
Date: Wed, 10 Aug 2022 13:05:56 +0000 (UTC)	[thread overview]
Message-ID: <1660136400.f196f19cb6c00c18e4cdce076e7265676bd9646e.sam@gentoo> (raw)

commit:     f196f19cb6c00c18e4cdce076e7265676bd9646e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 10 12:41:34 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 10 13:00:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f196f19c

dev-python/css-parser: enable py3.11

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/css-parser/css-parser-1.0.7-r1.ebuild   |  6 ++-
 .../files/css-parser-1.0.7-python311-tests.patch   | 51 ++++++++++++++++++++++
 2 files changed, 56 insertions(+), 1 deletion(-)

diff --git a/dev-python/css-parser/css-parser-1.0.7-r1.ebuild b/dev-python/css-parser/css-parser-1.0.7-r1.ebuild
index d450388f0198..91c945604f6a 100644
--- a/dev-python/css-parser/css-parser-1.0.7-r1.ebuild
+++ b/dev-python/css-parser/css-parser-1.0.7-r1.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_COMPAT=( python3_{8..11} )
 
 inherit distutils-r1
 
@@ -20,4 +20,8 @@ BDEPEND="
 	test? ( dev-python/chardet[${PYTHON_USEDEP}] )
 "
 
+PATCHES=(
+	"${FILESDIR}"/${P}-python311-tests.patch
+)
+
 distutils_enable_tests unittest

diff --git a/dev-python/css-parser/files/css-parser-1.0.7-python311-tests.patch b/dev-python/css-parser/files/css-parser-1.0.7-python311-tests.patch
new file mode 100644
index 000000000000..c9e4801cafbe
--- /dev/null
+++ b/dev-python/css-parser/files/css-parser-1.0.7-python311-tests.patch
@@ -0,0 +1,51 @@
+https://github.com/ebook-utils/css-parser/commit/ad79cfcb6e55837a4353b92d051de023c18f6581
+
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Sat, 21 May 2022 14:21:28 +0200
+Subject: [PATCH] tests: adjust exception string checks for python 3.11
+
+Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2062102.
+--- a/css_parser_tests/test_property.py
++++ b/css_parser_tests/test_property.py
+@@ -5,6 +5,7 @@
+ import xml.dom
+ from . import basetest
+ import css_parser
++import sys
+ 
+ 
+ class PropertyTestCase(basetest.BaseTestCase):
+@@ -162,8 +163,9 @@ def test_literalname(self):
+         "Property.literalname"
+         p = css_parser.css.property.Property(r'c\olor', 'red')
+         self.assertEqual(r'c\olor', p.literalname)
+-        self.assertRaisesMsgSubstring(AttributeError, "can't set attribute", p.__setattr__,
+-                                      'literalname', 'color')
++        pattern = "object has no setter" if sys.version_info >= (3,11) else "can't set attribute"
++        self.assertRaisesMsgSubstring(AttributeError, pattern,
++                                      p.__setattr__, 'literalname', 'color')
+ 
+     def test_validate(self):
+         "Property.valid"
+--- a/css_parser_tests/test_selector.py
++++ b/css_parser_tests/test_selector.py
+@@ -11,6 +11,7 @@
+ import xml.dom
+ from . import basetest
+ import css_parser
++import sys
+ 
+ 
+ class SelectorTestCase(basetest.BaseTestCase):
+@@ -412,7 +413,9 @@ def test_specificity(self):
+ 
+         # readonly
+         def _set(): selector.specificity = 1
+-        self.assertRaisesMsgSubstring(AttributeError, "can't set attribute", _set)
++
++        pattern = "object has no setter" if sys.version_info >= (3,11) else "can't set attribute"
++        self.assertRaisesMsgSubstring(AttributeError, pattern, _set)
+ 
+         tests = {
+             '*': (0, 0, 0, 0),
+


             reply	other threads:[~2022-08-10 13:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 13:05 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-11-04  6:15 [gentoo-commits] repo/gentoo:master commit in: dev-python/css-parser/, dev-python/css-parser/files/ Michał Górny
2022-01-10 20:47 Michał Górny
2021-05-18  9:32 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1660136400.f196f19cb6c00c18e4cdce076e7265676bd9646e.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox