1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( pypy3 python3_6 )
9 DESCRIPTION="A JavaScript minifier written in Python"
10 HOMEPAGE="https://slimit.readthedocs.io/en/latest/"
11 SRC_URI="https://github.com/rspivak/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
15 KEYWORDS="~amd64 ~x86"
17 RESTRICT="!test? ( test )"
19 RDEPEND="dev-python/ply:=[${PYTHON_USEDEP}]
20 dev-python/setuptools[${PYTHON_USEDEP}]"
23 dev-python/pytest[${PYTHON_USEDEP}]
24 dev-python/pytest-runner[${PYTHON_USEDEP}]
27 PATCHES=( "${FILESDIR}/${P}-fix-python3.patch" )
30 distutils-r1_python_compile
32 rm "${BUILD_DIR}"/lib/slimit/*tab.py || die
34 # Regenerate yacctab.py and lextab.py files to avoid warnings whenever
35 # the module is imported. See https://github.com/rspivak/slimit/issues/97
37 "${EPYTHON}" -B -c 'import slimit;slimit.minify("")' || die
41 esetup.py pytest --addopts "${BUILD_DIR}" || die "Testing failed with ${EPYTHON}"