dev-python/slimit: revbump to silence warning on module import
authorPPed72 <paolo.pedroni@iol.it>
Fri, 6 Jul 2018 13:18:35 +0000 (15:18 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 10 Jul 2018 21:15:22 +0000 (23:15 +0200)
Closes: https://bugs.gentoo.org/660510
Closes: https://github.com/gentoo/gentoo/pull/9068
Package-Manager: Portage-2.3.40, Repoman-2.3.9

dev-python/slimit/slimit-0.8.1-r1.ebuild [moved from dev-python/slimit/slimit-0.8.1.ebuild with 67% similarity]

similarity index 67%
rename from dev-python/slimit/slimit-0.8.1.ebuild
rename to dev-python/slimit/slimit-0.8.1-r1.ebuild
index 6eb5f29a614671455254bd87117c66e77fab14e0..b4561d3f8de2c30c8d4f9d43c642f224c2ab9581 100644 (file)
@@ -15,7 +15,7 @@ SLOT="0"
 KEYWORDS="~amd64 ~x86"
 IUSE="test"
 
-RDEPEND="dev-python/ply[${PYTHON_USEDEP}]
+RDEPEND="dev-python/ply:=[${PYTHON_USEDEP}]
        dev-python/setuptools[${PYTHON_USEDEP}]"
 DEPEND="${RDEPEND}
        test? (
@@ -25,6 +25,17 @@ DEPEND="${RDEPEND}
 
 PATCHES=( "${FILESDIR}/${P}-fix-python3.patch" )
 
+python_compile() {
+       distutils-r1_python_compile
+
+       rm "${BUILD_DIR}"/lib/slimit/*tab.py || die
+
+       # Regenerate yacctab.py and lextab.py files to avoid warnings whenever
+       # the module is imported. See https://github.com/rspivak/slimit/issues/97
+       # for details
+       "${EPYTHON}" -B -c 'import slimit;slimit.minify("")' || die
+}
+
 python_test() {
        esetup.py pytest --addopts "${BUILD_DIR}" || die "Testing failed with ${EPYTHON}"
 }