dev-python/cssselect: Bump to 1.0.3, enable tests
authorMichał Górny <mgorny@gentoo.org>
Wed, 21 Mar 2018 12:37:56 +0000 (13:37 +0100)
committerMichał Górny <mgorny@gentoo.org>
Wed, 21 Mar 2018 14:31:59 +0000 (15:31 +0100)
dev-python/cssselect/Manifest
dev-python/cssselect/cssselect-1.0.3.ebuild [new file with mode: 0644]

index be84cd6dd78234030445d64b3dbf95d31702c9c7..1081cf50aa40163dee7a9cffea4e2b1d21010a1a 100644 (file)
@@ -1,2 +1,3 @@
 DIST cssselect-0.9.1.tar.gz 32952 BLAKE2B 7f7a78e8085036bed72c2a1a0e4a97cd1988e8d6981ae830f15d5fc03f5fdd43f0caa7b94d2923181f9dc926a6a11e970b3f091178640124286aa680fa023aaf SHA512 c4cd2c8d6fbfa99b836554685dd59e1e794e1fab06fcf4419a226b0608a05d58be5af54e507003f2a233a22f03d59d3d63c0bf19b3314f15c95ab3ce5f4db6cc
 DIST cssselect-1.0.1.tar.gz 21849 BLAKE2B cfe3637746329db224a44b680cda044238fa831ed0d05cf3484be6181de13bf8660330362626ddc03c7284a80e7c4a814bba293dfdca07a529d9c0c7163c95d2 SHA512 060c4b8d427a935b851b4b20d10ef89b9d6f685692b7144afc8f848e318abaa182ed60538355ea3f25050e358f24904fa0d9c01fe77e3d2428e2ef2a825e2928
+DIST cssselect-1.0.3.tar.gz 34027 BLAKE2B fff15a50d26ce83a0480020e54d00a027a7f21ca2c4c45d5552c6b4c19f7be21c390650c4befa61b7ae2b63946de88945deb488ebd6c7f7fc470950dab233671 SHA512 08feb3a515cc75089657a508cd1a80c6aaa97d710f27e99f9e749a1519adc13c5540134c6a4e0d7f548b022b8bd23dcbe360530d2329c5da36e43aca1f9627d1
diff --git a/dev-python/cssselect/cssselect-1.0.3.ebuild b/dev-python/cssselect/cssselect-1.0.3.ebuild
new file mode 100644 (file)
index 0000000..1b3b495
--- /dev/null
@@ -0,0 +1,47 @@
+# 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} )
+
+inherit distutils-r1
+
+DESCRIPTION="parses CSS3 Selectors and translates them to XPath 1.0"
+HOMEPAGE="https://cssselect.readthedocs.io/en/latest/
+       https://pypi.python.org/pypi/cssselect
+       https://github.com/scrapy/cssselect"
+SRC_URI="https://github.com/scrapy/cssselect/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-fbsd"
+IUSE="doc test"
+
+DEPEND="
+       dev-python/setuptools[${PYTHON_USEDEP}]
+       doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+       test? ( dev-python/lxml[${PYTHON_USEDEP}] )"
+
+RDEPEND=""
+
+python_prepare_all() {
+       # prevent non essential d'load of files in doc build
+       sed -e 's:intersphinx_:#&:' -i docs/conf.py || die
+       distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+       if use doc ; then
+               esetup.py build_sphinx
+       fi
+}
+
+python_test() {
+       "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+       use doc && local HTML_DOCS=( docs/_build/html/. )
+       distutils-r1_python_install_all
+}