public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/cssutils/, dev-python/cssutils/files/
@ 2015-11-26  9:28 Justin Lecher
  0 siblings, 0 replies; 3+ messages in thread
From: Justin Lecher @ 2015-11-26  9:28 UTC (permalink / raw
  To: gentoo-commits

commit:     d924168b217c90faea5781e0c91fed0f5e797aab
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 09:27:15 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 09:28:25 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d924168b

dev-python/cssutils: Backport fix for test failures on pypy

Package-Manager: portage-2.2.25
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 dev-python/cssutils/cssutils-1.0.1.ebuild          |  6 ++--
 .../files/cssutils-1.0.1-pypy-test-backport.patch  | 32 ++++++++++++++++++++++
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/dev-python/cssutils/cssutils-1.0.1.ebuild b/dev-python/cssutils/cssutils-1.0.1.ebuild
index 60fc741..c2be49f 100644
--- a/dev-python/cssutils/cssutils-1.0.1.ebuild
+++ b/dev-python/cssutils/cssutils-1.0.1.ebuild
@@ -20,6 +20,10 @@ RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
 DEPEND="${RDEPEND}
 	test? ( dev-python/mock[${PYTHON_USEDEP}] )"
 
+PATCHES=(
+	"${FILESDIR}"/${P}-pypy-test-backport.patch
+)
+
 python_prepare_all() {
 	# Disable test failing with dev-python/pyxml installed.
 	if has_version dev-python/pyxml; then
@@ -35,8 +39,6 @@ python_prepare_all() {
 }
 
 python_test() {
-	# https://bitbucket.org/cthedot/cssutils/issues/55
-	[[ "${EPYTHON}" =~ "pypy" ]] && return
 	ln -s "${S}/sheets" "${BUILD_DIR}/sheets" || die
 	# esetup.py test
 	# exclude tests that connect to the network

diff --git a/dev-python/cssutils/files/cssutils-1.0.1-pypy-test-backport.patch b/dev-python/cssutils/files/cssutils-1.0.1-pypy-test-backport.patch
new file mode 100644
index 0000000..89c7608
--- /dev/null
+++ b/dev-python/cssutils/files/cssutils-1.0.1-pypy-test-backport.patch
@@ -0,0 +1,32 @@
+# HG changeset patch
+# User Daniel <kingdread@gmx.de>
+# Date 1448482419 -3600
+# Node ID 01a19d494b6f31e91c54ae39c5a6f43f6292a85d
+# Parent  3a01bd18118a6466ad93aa23caaa4164528b59ac
+Fix tests on PyPy 2
+
+Tests fail because of the extra "u" prefix in the error message
+
+diff --git a/src/cssutils/tests/test_profiles.py b/src/cssutils/tests/test_profiles.py
+--- a/src/cssutils/tests/test_profiles.py
++++ b/src/cssutils/tests/test_profiles.py
+@@ -2,6 +2,7 @@
+ __version__ = '$Id: test_cssvalue.py 1443 2008-08-31 13:54:39Z cthedot $'
+ 
+ import sys
++import platform
+ import basetest
+ import cssutils
+ 
+@@ -124,6 +125,11 @@
+             expmsg = u"invalid literal for int(): x" 
+         elif sys.platform.startswith('java'):
+             expmsg = u"invalid literal for int() with base 10: x"
++        # PyPy adds the u prefix, but only in versions lower than Python 3
++        elif (platform.python_implementation() == "PyPy" and
++              sys.version_info < (3, 0)):
++            expmsg = u"invalid literal for int() with base 10: u'x'"
++
+             
+         self.assertRaisesMsg(Exception, expmsg, 
+                              cssutils.profile.validate, u'-test-funcval', u'x')


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cssutils/, dev-python/cssutils/files/
@ 2020-03-07 15:45 Michał Górny
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2020-03-07 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     b265f17bc2d3a58b311c073acb48fd49527e5332
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  7 15:37:56 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Mar  7 15:37:56 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b265f17b

dev-python/cssutils: Remove redundant versions

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

 dev-python/cssutils/Manifest                       |  1 -
 dev-python/cssutils/cssutils-1.0.1.ebuild          | 55 ----------------------
 dev-python/cssutils/cssutils-1.0.2-r1.ebuild       | 55 ----------------------
 .../files/cssutils-1.0.1-pypy-test-backport.patch  | 32 -------------
 4 files changed, 143 deletions(-)

diff --git a/dev-python/cssutils/Manifest b/dev-python/cssutils/Manifest
index e9f838eecc6..23b7b70e68a 100644
--- a/dev-python/cssutils/Manifest
+++ b/dev-python/cssutils/Manifest
@@ -1,2 +1 @@
-DIST cssutils-1.0.1.tar.gz 353621 BLAKE2B 142320e2358acb1b5b95400f42fb5eb40840602bd204f68a1896ea92b35dfe2ce6f316d84cf5d21a2ef8047f4748294b908057fa12cab352b42d7ab2ffcfaa6f SHA512 932a128443cc31f689d91c7c75a04ddc79824b4e5c0779e48d30fa0a3a760cad82d8208264ec95a3b120c38962f2eabf6b3456aa8f81d24e9c9718e95fd6bf83
 DIST cssutils-1.0.2.tar.gz 367038 BLAKE2B e19edce100dbc05d6e469eb6b0ad234d7d4c9458aca1b2a3e72bdeff1a35dec64427353936a339e2071d8ba2e8804c5754f55a391955a61ef61ae56381269125 SHA512 4988893875a03923d3127e334654799e5c2ebcdc0a7f5b3fb5c9ab27d1b331caa5bf197161312a298531e0757843aa3259ceba5fa19947353eea24a5da53ceda

diff --git a/dev-python/cssutils/cssutils-1.0.1.ebuild b/dev-python/cssutils/cssutils-1.0.1.ebuild
deleted file mode 100644
index f3e9e622067..00000000000
--- a/dev-python/cssutils/cssutils-1.0.1.ebuild
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-PYTHON_COMPAT=( python3_6 )
-
-inherit distutils-r1
-
-DESCRIPTION="A CSS Cascading Style Sheets library"
-HOMEPAGE="https://pypi.org/project/cssutils/ https://bitbucket.org/cthedot/cssutils http://cthedot.de/cssutils/"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="amd64 arm ppc x86"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
-DEPEND="${RDEPEND}
-	test? (
-		dev-python/mock[${PYTHON_USEDEP}]
-		dev-python/nose[${PYTHON_USEDEP}]
-	)"
-
-PATCHES=(
-	"${FILESDIR}"/${P}-pypy-test-backport.patch
-)
-
-python_prepare_all() {
-	# Disable test failing with dev-python/pyxml installed.
-	if has_version dev-python/pyxml; then
-		sed -e "s/test_linecol/_&/" -i src/tests/test_errorhandler.py
-	fi
-
-	# requires old pbr, does it really?
-	sed \
-		-e '/tests_require/d' \
-		-i setup.py || die
-
-	EPATCH_OPTS="--binary"
-
-	distutils-r1_python_prepare_all
-}
-
-python_test() {
-	ln -s "${S}/sheets" "${BUILD_DIR}/sheets" || die
-	# esetup.py test
-	# exclude tests that connect to the network
-	set --  nosetests \
-		-e test_parseUrl -e test_handlers -P "${BUILD_DIR}/lib/cssutils/tests"
-	echo "$@"
-	"$@" || die "Testing failed with ${EPYTHON}"
-}

diff --git a/dev-python/cssutils/cssutils-1.0.2-r1.ebuild b/dev-python/cssutils/cssutils-1.0.2-r1.ebuild
deleted file mode 100644
index 4c06df2a752..00000000000
--- a/dev-python/cssutils/cssutils-1.0.2-r1.ebuild
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{6,7} )
-
-inherit distutils-r1
-
-DESCRIPTION="A CSS Cascading Style Sheets library"
-HOMEPAGE="https://pypi.org/project/cssutils/ https://bitbucket.org/cthedot/cssutils http://cthedot.de/cssutils/"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="amd64 ~arm arm64 ~ppc ~x86"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
-DEPEND="${RDEPEND}
-	test? (
-		dev-python/mock[${PYTHON_USEDEP}]
-		dev-python/nose[${PYTHON_USEDEP}]
-	)"
-
-python_prepare_all() {
-	# Disable test failing with dev-python/pyxml installed.
-	if has_version dev-python/pyxml; then
-		sed -e "s/test_linecol/_&/" \
-			-i src/cssutils/tests/test_errorhandler.py \
-			|| die
-	fi
-
-	# requires old pbr, does it really?
-	sed \
-		-e '/tests_require/d' \
-		-i setup.py || die
-
-	# fix casing of call to Windows-1252. Remove when upstream fixes casing.
-	sed -i -e 's/encutils.tryEncodings(test)/encutils.tryEncodings(test).lower()/' \
-	src/cssutils/tests/test_encutils/__init__.py || die "fixing test_encutils failed"
-
-	distutils-r1_python_prepare_all
-}
-
-python_test() {
-	ln -s "${S}/sheets" "${BUILD_DIR}/sheets" || die
-	# esetup.py test
-	# exclude tests that connect to the network
-	set --  nosetests \
-		-e test_parseUrl -e test_handlers -P "${BUILD_DIR}/lib/cssutils/tests"
-	echo "$@"
-	"$@" || die "Testing failed with ${EPYTHON}"
-}

diff --git a/dev-python/cssutils/files/cssutils-1.0.1-pypy-test-backport.patch b/dev-python/cssutils/files/cssutils-1.0.1-pypy-test-backport.patch
deleted file mode 100644
index f5f1bda3516..00000000000
--- a/dev-python/cssutils/files/cssutils-1.0.1-pypy-test-backport.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-# HG changeset patch
-# User Daniel <kingdread@gmx.de>
-# Date 1448482419 -3600
-# Node ID 01a19d494b6f31e91c54ae39c5a6f43f6292a85d
-# Parent  3a01bd18118a6466ad93aa23caaa4164528b59ac
-Fix tests on PyPy 2
-
-Tests fail because of the extra "u" prefix in the error message
-
-diff --git a/src/cssutils/tests/test_profiles.py b/src/cssutils/tests/test_profiles.py
---- a/src/cssutils/tests/test_profiles.py
-+++ b/src/cssutils/tests/test_profiles.py
-@@ -2,6 +2,7 @@
- __version__ = '$Id: test_cssvalue.py 1443 2008-08-31 13:54:39Z cthedot $'
- 
- import sys
-+import platform
- import basetest
- import cssutils
- 
-@@ -124,6 +125,11 @@
-             expmsg = u"invalid literal for int(): x" 
-         elif sys.platform.startswith('java'):
-             expmsg = u"invalid literal for int() with base 10: x"
-+        # PyPy adds the u prefix, but only in versions lower than Python 3
-+        elif (platform.python_implementation() == "PyPy" and
-+              sys.version_info < (3, 0)):
-+            expmsg = u"invalid literal for int() with base 10: u'x'"
-+
-             
-         self.assertRaisesMsg(Exception, expmsg, 
-                              cssutils.profile.validate, u'-test-funcval', u'x')


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cssutils/, dev-python/cssutils/files/
@ 2021-10-22 15:16 Arthur Zamarin
  0 siblings, 0 replies; 3+ messages in thread
From: Arthur Zamarin @ 2021-10-22 15:16 UTC (permalink / raw
  To: gentoo-commits

commit:     fdbb4f160a23f80104844c3db6c4d220931d9b5d
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 22 14:56:40 2021 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 22 15:15:56 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdbb4f16

dev-python/cssutils: add 2.3.0, enable py3.10

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 dev-python/cssutils/Manifest                       |  1 +
 dev-python/cssutils/cssutils-2.3.0.ebuild          | 38 ++++++++++++++++++++++
 .../cssutils/files/cssutils-2.3.0-fix-py3.10.patch | 21 ++++++++++++
 .../cssutils/files/cssutils-2.3.0-fix-py3.8.patch  | 30 +++++++++++++++++
 4 files changed, 90 insertions(+)

diff --git a/dev-python/cssutils/Manifest b/dev-python/cssutils/Manifest
index 25ea44ec13a..c729a4620f0 100644
--- a/dev-python/cssutils/Manifest
+++ b/dev-python/cssutils/Manifest
@@ -1 +1,2 @@
 DIST cssutils-2.2.0.tar.gz 731024 BLAKE2B 8da0e8898e7126a6a84f053f6a3411c3830dc4ec1e20b80bba53b1004c0747f0510390e10c611ce655cc8af62bf657f3b69d3a12a49b781f1b20553cd038f601 SHA512 cd9c3d069e18516484894df38f8cbc9abb1ffc5b021538c99c06878d34195619d7928d553049309ac30c144210df6ed616bbd0d04e158d9fbfce166f9935d5a2
+DIST cssutils-2.3.0.tar.gz 725849 BLAKE2B 7c6f0280c24eb9cf8c6e4215fc6a102ea0b1f72f52b06d8396601a19ffe457fa628bbf5b9f6c020185378ddf26c96e4aec11026e686343513db9141c7ca22dfd SHA512 9919224a61222e860a99ec80e6375a472b89c52af72272c1de7bcd5fd31cf8570a04da7762c62a17a85bef2c41b1c67447583087df4c86c1f8969ad4875a76d2

diff --git a/dev-python/cssutils/cssutils-2.3.0.ebuild b/dev-python/cssutils/cssutils-2.3.0.ebuild
new file mode 100644
index 00000000000..11a1977ee61
--- /dev/null
+++ b/dev-python/cssutils/cssutils-2.3.0.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit distutils-r1
+
+DESCRIPTION="A CSS Cascading Style Sheets library"
+HOMEPAGE="https://pypi.org/project/cssutils/ https://cthedot.de/cssutils/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86"
+
+BDEPEND="
+	dev-python/setuptools_scm[${PYTHON_USEDEP}]
+	dev-python/toml[${PYTHON_USEDEP}]
+	test? (
+		dev-python/cssselect[${PYTHON_USEDEP}]
+		dev-python/lxml[${PYTHON_USEDEP}]
+		dev-python/mock[${PYTHON_USEDEP}]
+	)"
+
+PATCHES=(
+	"${FILESDIR}/${P}-fix-py3.8.patch"
+	"${FILESDIR}/${P}-fix-py3.10.patch"
+)
+
+distutils_enable_tests pytest
+
+EPYTEST_DESELECT=(
+	# network
+	encutils/__init__.py::encutils
+	cssutils/tests/test_parse.py::CSSParserTestCase::test_parseUrl
+	examples/website.py::website.logging
+)

diff --git a/dev-python/cssutils/files/cssutils-2.3.0-fix-py3.10.patch b/dev-python/cssutils/files/cssutils-2.3.0-fix-py3.10.patch
new file mode 100644
index 00000000000..540fc7a1cc0
--- /dev/null
+++ b/dev-python/cssutils/files/cssutils-2.3.0-fix-py3.10.patch
@@ -0,0 +1,21 @@
+From: Arthur Zamarin <arthurzam@gmail.com>
+Date: Fri, 22 Oct 2021 17:48:28 +0300
+Subject: [PATCH] Fix expected error message for python 3.10
+
+python 3.10 adds some words to it's errors, so catch if our expected
+are contained in the actual output
+
+Signed-off-by: Arthur Zamarin <arthurzam@gmail.com>
+https://github.com/jaraco/cssutils/pull/17
+
+--- a/cssutils/tests/basetest.py
++++ b/cssutils/tests/basetest.py
+@@ -126,7 +126,7 @@ class BaseTestCase(unittest.TestCase):
+             if not msg:
+                 # No message provided: any message is fine.
+                 return
+-            elif excMsg == msg:
++            elif msg in excMsg:
+                 # Message provided, and we got the right message: passes.
+                 return
+             else:

diff --git a/dev-python/cssutils/files/cssutils-2.3.0-fix-py3.8.patch b/dev-python/cssutils/files/cssutils-2.3.0-fix-py3.8.patch
new file mode 100644
index 00000000000..a3fff246b61
--- /dev/null
+++ b/dev-python/cssutils/files/cssutils-2.3.0-fix-py3.8.patch
@@ -0,0 +1,30 @@
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 24 May 2021 08:35:13 +0200
+Subject: [PATCH] Force using importlib_resources in Python < 3.9
+
+Force using the external importlib_resources package based on Python
+version rather than the presence of the built-in importlib.resources.
+The latter does not have the needed files() method in Python < 3.9,
+and therefore results in test failures:
+
+  E       AttributeError: module 'importlib.resources' has no attribute 'files'
+
+This affects specifically Python 3.7 and 3.8 that have an older version
+of importlib.resources module.
+
+https://github.com/jaraco/cssutils/pull/10
+
+--- a/cssutils/tests/basetest.py
++++ b/cssutils/tests/basetest.py
+@@ -6,9 +6,9 @@
+ import sys
+ import unittest
+
+-try:
++if sys.version_info >= (3, 9):
+     from importlib import resources
+-except ImportError:
++else:
+     import importlib_resources as resources
+
+ import cssutils


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-22 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-07 15:45 [gentoo-commits] repo/gentoo:master commit in: dev-python/cssutils/, dev-python/cssutils/files/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2021-10-22 15:16 Arthur Zamarin
2015-11-26  9:28 Justin Lecher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox