summaryrefslogtreecommitdiff
path: root/dev-python/pygments
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pygments')
-rw-r--r--dev-python/pygments/Manifest6
-rw-r--r--dev-python/pygments/files/pygments-2.2.0-pep479.patch46
-rw-r--r--dev-python/pygments/metadata.xml13
-rw-r--r--dev-python/pygments/pygments-2.1.1.ebuild52
-rw-r--r--dev-python/pygments/pygments-2.2.0.ebuild57
5 files changed, 174 insertions, 0 deletions
diff --git a/dev-python/pygments/Manifest b/dev-python/pygments/Manifest
new file mode 100644
index 000000000000..f4ccd08183e6
--- /dev/null
+++ b/dev-python/pygments/Manifest
@@ -0,0 +1,6 @@
+AUX pygments-2.2.0-pep479.patch 1669 BLAKE2B c39e582d85d5903831749ccf563b13a88f623ebe7279205465bba16640fb85df1d1f9d15020d7e19b9d0ca8fb409426dbcfec4729e8d1b16d90e9c075f674c25 SHA512 e6195c6f0c0fb0ba725621ad564e85e69db31a3e2e903279512d0af06db32d7fee1284ddd0db00c80312c29a19f345325a7353bc5fc2e1f0bc64f8c32f71d918
+DIST Pygments-2.1.1.tar.gz 2114190 BLAKE2B b0e5d5a62849c97aaac6f0edf26230d5573715fb759667ca888372666634ab68da4580b1337ec4ada013b643411c221c572651c6fca6745b976794d5c6246e5d SHA512 7eb35865074f573ef7d41a1f1ee7576a83c32855018d03570eb70fd6864ddfbbc3f93ae082c4ac7e4a274a0ef387ea4ccb0909423e01efb6bb8e4fefea8f2807
+DIST Pygments-2.2.0.tar.gz 2113944 BLAKE2B 58d5f2fa0e6d97f5b7d7a17314b82ef219f23b72f8da49b4f8ce9b892d54ffbc1b490e87e87efe8d727dab297f775d0d8abfc4a31a734c5a7f8df885e5eda82f SHA512 cc0a4f73e19fa6cbf46314de2e809460c807c631e39ba05cbe5edb5f40db1a687aafcd9715585a0ed45f791710eb6038305e273f282f8682df76f30e63710b29
+EBUILD pygments-2.1.1.ebuild 1670 BLAKE2B 646364f36a2c9b8a3a9f09d32c77d42f79f403ae6af47b88ae8254ccaf825cc8d99e77b26ff6f3262f559b08204e02772f603f8a7451e887206495ba2b167c18 SHA512 70f3d14b209d32bf5732cd1d1087ce539958a06ec1938335796208687adb1ed488c9f9a1e93c66fd346df5b51f186727b33c7ac4d24be6ffbad0d4db9dabc713
+EBUILD pygments-2.2.0.ebuild 1771 BLAKE2B 4e979054554dc59cf36f7c1e6fae1116ba1196b2a0ad368e2047ea7c29e7ae7596c8ac39e4f84d815437a96d8f386e8c60f183e1cc0c38be0e08939c2b7823a9 SHA512 0d9caf422b91f933c4c7322fa44269d9ac0cc158fd9947493e563d12b617c660b06c869d2bfe044029cf40ba682f9f6d617193a0c3b087ed0c4e26199daa7fb3
+MISC metadata.xml 542 BLAKE2B 88e44c4b6f29e096e67521c621724d1a5415d089f73612fb8d02ee714a4af1e8080cf98542d7f0c9b1331d919bbeba31b1fa8269a28cc1be841af069a497d889 SHA512 f15732bb743ed5ad4049036c7b87118c89be09e260ae483b4c7e25155a31c0ab8844f8a1050386a0ee81d2b1e55d240f90cab3e28749b8f943baf64ec176814b
diff --git a/dev-python/pygments/files/pygments-2.2.0-pep479.patch b/dev-python/pygments/files/pygments-2.2.0-pep479.patch
new file mode 100644
index 000000000000..28d40e9566a2
--- /dev/null
+++ b/dev-python/pygments/files/pygments-2.2.0-pep479.patch
@@ -0,0 +1,46 @@
+# HG changeset patch
+# User Miro HronĨok <miro@hroncok.cz>
+# Date 1530720528 -7200
+# Branch py37
+# Node ID 933b5f6afe35e6d554f46085a4e62dc5bf413c87
+# Parent 7941677dc77d4f2bf0bbd6140ade85a9454b8b80
+PEP 479: Raising StopIteration from a generator is now an error
+
+So we return instead. Fix needed for Python 3.7.
+
+Fixes https://bitbucket.org/birkenfeld/pygments-main/issues/1457
+
+diff --git a/pygments/lexers/lisp.py b/pygments/lexers/lisp.py
+--- a/pygments/lexers/lisp.py
++++ b/pygments/lexers/lisp.py
+@@ -2327,13 +2327,13 @@
+ token = Name.Function if token == Literal else token
+ yield index, token, value
+
+- raise StopIteration
++ return
+
+ def _process_signature(self, tokens):
+ for index, token, value in tokens:
+ if token == Literal and value == '}':
+ yield index, Punctuation, value
+- raise StopIteration
++ return
+ elif token in (Literal, Name.Function):
+ token = Name.Variable if value.istitle() else Keyword.Type
+ yield index, token, value
+diff --git a/pygments/lexers/sql.py b/pygments/lexers/sql.py
+--- a/pygments/lexers/sql.py
++++ b/pygments/lexers/sql.py
+@@ -347,7 +347,10 @@
+ # Emit the output lines
+ out_token = Generic.Output
+ while 1:
+- line = next(lines)
++ try:
++ line = next(lines)
++ except StopIteration:
++ return
+ mprompt = re_prompt.match(line)
+ if mprompt is not None:
+ # push the line back to have it processed by the prompt
diff --git a/dev-python/pygments/metadata.xml b/dev-python/pygments/metadata.xml
new file mode 100644
index 000000000000..c3ac451b5ed0
--- /dev/null
+++ b/dev-python/pygments/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <longdescription>Pygments is a syntax highlighting package written in Python. Pygments can output to html, bbcode, latex, rtf and other formats.</longdescription>
+ <upstream>
+ <remote-id type="pypi">Pygments</remote-id>
+ <remote-id type="bitbucket">birkenfeld/pygments-main</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/pygments/pygments-2.1.1.ebuild b/dev-python/pygments/pygments-2.1.1.ebuild
new file mode 100644
index 000000000000..82cfec6da8f3
--- /dev/null
+++ b/dev-python/pygments/pygments-2.1.1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy pypy3 )
+
+inherit distutils-r1 bash-completion-r1 vcs-snapshot
+
+MY_PN="Pygments"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Pygments is a syntax highlighting package written in Python"
+HOMEPAGE="http://pygments.org/ https://pypi.org/project/Pygments/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc test"
+
+RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+ test? (
+ dev-python/nose[${PYTHON_USEDEP}]
+ virtual/ttf-fonts )"
+# dev-texlive/texlive-latexrecommended
+# Removing / commenting out this dep. I can find no mention of it in tests other than
+# importing pygment's own tex module. If it's there and I missed it just uncomment and re-add
+# Tests pass without it
+
+S="${WORKDIR}/${MY_P}"
+
+python_compile_all() {
+ use doc && emake -C doc html
+}
+
+python_test() {
+ cp -r -l tests "${BUILD_DIR}"/ || die
+ # With pypy3 there is 1 error out of 1556 tests when run as is and
+ # (SKIP=8, errors=1, failures=1) when run with 2to3; meh
+ nosetests --verbosity=3 -w "${BUILD_DIR}"/tests \
+ || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( doc/_build/html/. )
+
+ distutils-r1_python_install_all
+ newbashcomp external/pygments.bashcomp pygmentize
+}
diff --git a/dev-python/pygments/pygments-2.2.0.ebuild b/dev-python/pygments/pygments-2.2.0.ebuild
new file mode 100644
index 000000000000..d9da923f8cdf
--- /dev/null
+++ b/dev-python/pygments/pygments-2.2.0.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy pypy3 )
+
+inherit distutils-r1 bash-completion-r1 vcs-snapshot
+
+MY_PN="Pygments"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Pygments is a syntax highlighting package written in Python"
+HOMEPAGE="http://pygments.org/ https://pypi.org/project/Pygments/"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc test"
+
+RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+ test? (
+ dev-python/nose[${PYTHON_USEDEP}]
+ virtual/ttf-fonts )"
+# dev-texlive/texlive-latexrecommended
+# Removing / commenting out this dep. I can find no mention of it in tests other than
+# importing pygment's own tex module. If it's there and I missed it just uncomment and re-add
+# Tests pass without it
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ # fix generators for python3.7+
+ "${FILESDIR}"/pygments-2.2.0-pep479.patch
+)
+
+python_compile_all() {
+ use doc && emake -C doc html
+}
+
+python_test() {
+ cp -r -l tests "${BUILD_DIR}"/ || die
+ # With pypy3 there is 1 error out of 1556 tests when run as is and
+ # (SKIP=8, errors=1, failures=1) when run with 2to3; meh
+ nosetests --verbosity=3 -w "${BUILD_DIR}"/tests \
+ || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( doc/_build/html/. )
+
+ distutils-r1_python_install_all
+ newbashcomp external/pygments.bashcomp pygmentize
+}