1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{6,7} pypy3 )
8 inherit distutils-r1 bash-completion-r1
13 DESCRIPTION="Pygments is a syntax highlighting package written in Python"
14 HOMEPAGE="http://pygments.org/ https://pypi.org/project/Pygments/"
15 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
19 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
21 RESTRICT="!test? ( test )"
23 RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
25 doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
27 dev-python/nose[${PYTHON_USEDEP}]
30 S="${WORKDIR}/${MY_P}"
33 # fix generators for python3.7+
34 "${FILESDIR}"/pygments-2.2.0-pep479.patch
35 # Fixing USE="doc" with sphinx1.7+. bug #662640
36 "${FILESDIR}"/pygments-2.2.0-sphinx17.patch
39 python_compile_all() {
40 use doc && emake -C doc html
44 cp -r -l tests "${BUILD_DIR}"/ || die
45 # With pypy3 there is 1 error out of 1556 tests when run as is and
46 # (SKIP=8, errors=1, failures=1) when run with 2to3; meh
47 nosetests --verbosity=3 -w "${BUILD_DIR}"/tests \
48 || die "Tests fail with ${EPYTHON}"
51 python_install_all() {
52 use doc && local HTML_DOCS=( doc/_build/html/. )
54 distutils-r1_python_install_all
55 newbashcomp external/pygments.bashcomp pygmentize