diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-09-23 10:22:15 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-09-23 10:22:15 +0100 |
commit | 8b4ace9c50842c5b83401ea7b179dcab940387e1 (patch) | |
tree | 230f3135ceaace633cf93e9838b185c4a6664c2e /dev-python/tempita | |
parent | 9ee6d97c2883d42f204a533a8bc1f4562df778fb (diff) |
gentoo resync : 23.09.2020
Diffstat (limited to 'dev-python/tempita')
-rw-r--r-- | dev-python/tempita/Manifest | 2 | ||||
-rw-r--r-- | dev-python/tempita/files/tempita-0.5.3-cgi-escape.patch | 31 | ||||
-rw-r--r-- | dev-python/tempita/tempita-0.5.3-r3.ebuild | 52 |
3 files changed, 85 insertions, 0 deletions
diff --git a/dev-python/tempita/Manifest b/dev-python/tempita/Manifest index b4a2f9d9aede..4af515c3b034 100644 --- a/dev-python/tempita/Manifest +++ b/dev-python/tempita/Manifest @@ -1,4 +1,6 @@ +AUX tempita-0.5.3-cgi-escape.patch 1109 BLAKE2B bf11e4e5c284709c62d6ddb5413bececd76079a84352c806921585fed33e77c9b4f34a032e60d18f900546ce4ef716532a3901744752cee2dbfcabfb383e981e SHA512 da9e3c8adf984daa3da2d695e56633ea45fb2424f1cf10d8e939cb915fcfda3bee67ed0039838916ddb05d749e4229336eea51b7878e5ece9a4c66750ecf8f4a AUX tempita-0.5.3-pypy-tests.patch 933 BLAKE2B 9b49ab761c894a54f883645bbae9eba938d412aba65392fd78feffee1feadefe6f34f63f4aa7d61c5437d6697aae0dcd89434789d84055b6c089721ddb559cee SHA512 bad83c3e05d3aa8d151403ca71c527663b2268c3fee517ab5778a169b497ab491666bbb9be627369f41ba8444b6e98511953ece2744582d1abffd1ef206de312 DIST tempita-0.5.3-bitbucket.tar.gz 22756 BLAKE2B 59d273b1dc206eea452f7e5265d59b3ef1248b2d920eae559d74f4c569852b2a127e2a906f866cb748a12663dca944d9080413410edd5c69bd93b0d9574e3026 SHA512 cebe443bf0fc7705304fe127c796801acb6cdc54e79315c2afddb79ece1d04427852c1d0924ab9dd54520b584ae09a0644a20ff2dd6ed0408ee103f5b3fb9410 EBUILD tempita-0.5.3-r2.ebuild 1392 BLAKE2B 3a5a5450cd3275eeac43678663c2ef57698c123008c3efb13748a4f5ad894a9b3db87730a22be238c8edb08bc086a22e85b2f6471680ba52129215b70e079ee2 SHA512 927b6ce3a6d1e73e3fd618d113863cb4f01feac8dd3ef64cc914eb660e10eb1e35c178e247bf5c305d0caa8d5167d24cdbef7bc175cadacf9240731592cc7b8d +EBUILD tempita-0.5.3-r3.ebuild 1452 BLAKE2B 6709b703bacdf6b7694b452272285a4f699772a2132f230601a06c1bc7c3af437e45ba8f8db531bcc0981e13b88b28f726965649159fc829264bb8df700eecc2 SHA512 bc7d1d831c6f8c54082b0d2346ef078bc24dab0737411095ba8467da6abed7ee5013ef5c6943a001d0c3cf8eb73efb6af938955a6b532055a576d276995e4504 MISC metadata.xml 320 BLAKE2B d26cd9d2555b7d1a56ad44c86fb280a249a4f2d45c3f320cbb9a98de249e826701d49b814c209e6270d183084b8955e177fdac69af0136a7432cc5370b70fb3a SHA512 44f0ea2e06ab198180db9be4533b29c56e7cd0f3af9f522188e063cf787ad1eb1eff9fe2e09debe97be85769a09375385c1f838a7eedc2bc92835e846320f109 diff --git a/dev-python/tempita/files/tempita-0.5.3-cgi-escape.patch b/dev-python/tempita/files/tempita-0.5.3-cgi-escape.patch new file mode 100644 index 000000000000..d411d28ced48 --- /dev/null +++ b/dev-python/tempita/files/tempita-0.5.3-cgi-escape.patch @@ -0,0 +1,31 @@ +diff --git a/tempita/__init__.py b/tempita/__init__.py +index 137ba2d..acc2fd9 100755 +--- a/tempita/__init__.py ++++ b/tempita/__init__.py +@@ -31,12 +31,12 @@ can use ``__name='tmpl.html'`` to set the name of the template. + If there are syntax errors ``TemplateError`` will be raised. + """ + +-import cgi + import os + import re + import sys + import tokenize + from cStringIO import StringIO ++from html import escape + from urllib import quote as url_quote + from tempita._looper import looper + from tempita.compat3 import bytes, basestring_, next, is_unicode, coerce_text +@@ -445,10 +445,10 @@ def html_quote(value, force=True): + if not isinstance(value, basestring_): + value = coerce_text(value) + if sys.version >= "3" and isinstance(value, bytes): +- value = cgi.escape(value.decode('latin1'), 1) ++ value = escape(value.decode('latin1'), 1) + value = value.encode('latin1') + else: +- value = cgi.escape(value, 1) ++ value = escape(value, 1) + if sys.version < "3": + if is_unicode(value): + value = value.encode('ascii', 'xmlcharrefreplace') diff --git a/dev-python/tempita/tempita-0.5.3-r3.ebuild b/dev-python/tempita/tempita-0.5.3-r3.ebuild new file mode 100644 index 000000000000..d455c913ca0a --- /dev/null +++ b/dev-python/tempita/tempita-0.5.3-r3.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( pypy3 python3_{6,7,8,9} ) +# The package uses pkg_resources +DISTUTILS_USE_SETUPTOOLS=manual + +inherit distutils-r1 + +MY_COMMIT="97392d008cc8" + +DESCRIPTION="A very small text templating language" +HOMEPAGE="https://pypi.org/project/Tempita/" +# Tests are not published on PyPI +SRC_URI="https://bitbucket.org/ianb/${PN}/get/${MY_COMMIT}.tar.gz -> ${P}-bitbucket.tar.gz" +S="${WORKDIR}/ianb-${PN}-${MY_COMMIT}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]" +BDEPEND=" + dev-python/setuptools[${PYTHON_USEDEP}] + test? ( dev-python/pytest[${PYTHON_USEDEP}] ) +" + +PATCHES=( + "${FILESDIR}/${P}-pypy-tests.patch" + # cgi.escape has been removed in Python 3.9 + "${FILESDIR}/${P}-cgi-escape.patch" +) + +distutils_enable_sphinx docs + +python_prepare_all() { + # Remove reference to a non-existent CSS file + # in order to make sphinx use its default theme. + sed -i '/^html_style =/d' docs/conf.py || die + distutils-r1_python_prepare_all +} + +python_test() { + # We need to append to sys.path, otherwise pytest imports + # the module from ${S} (before it was 2to3'd) + pytest --import-mode=append -vv tests/test_template.txt docs/index.txt \ + || die "Tests failed with ${EPYTHON}" +} |