spacepaste

  1.  
  2. # Copyright 1999-2015 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. EAPI=6
  5. PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
  6. PYTHON_REQ_USE="sqlite(+)"
  7. inherit distutils-r1
  8. DESCRIPTION="A high-level Python Screen Scraping framework"
  9. HOMEPAGE="https://github.com/scrapy/scrapy/ https://pypi.python.org/pypi/Scrapy/"
  10. SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  11. LICENSE="BSD-2"
  12. SLOT="0"
  13. KEYWORDS="~amd64 ~x86"
  14. IUSE="boto doc ibl test ssl"
  15. RDEPEND="
  16. >=dev-python/six-1.5.2[${PYTHON_USEDEP}]
  17. dev-libs/libxml2[python,${PYTHON_USEDEP}]
  18. dev-python/pillow[${PYTHON_USEDEP}]
  19. >=dev-python/parsel-1.1.0[${PYTHON_USEDEP}]
  20. >=dev-python/lxml-3.4[${PYTHON_USEDEP}]
  21. ibl? ( dev-python/numpy[${PYTHON_USEDEP}] )
  22. ssl? (
  23. >=dev-python/pyopenssl-0.14[${PYTHON_USEDEP}]
  24. dev-python/cryptography[${PYTHON_USEDEP}] )
  25. boto? ( dev-python/boto3[${PYTHON_USEDEP}] )
  26. >=dev-python/twisted-14.0[${PYTHON_USEDEP}]
  27. >=dev-python/w3lib-1.8.0[${PYTHON_USEDEP}]
  28. dev-python/queuelib[${PYTHON_USEDEP}]
  29. >=dev-python/cssselect-0.9[${PYTHON_USEDEP}]
  30. >=dev-python/six-1.5.2[${PYTHON_USEDEP}]
  31. dev-python/service_identity[${PYTHON_USEDEP}]
  32. "
  33. DEPEND="
  34. dev-python/setuptools[${PYTHON_USEDEP}]
  35. doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
  36. test? ( ${RDEPEND}
  37. dev-python/mock[${PYTHON_USEDEP}]
  38. =net-proxy/mitmproxy-0.10.1[${PYTHON_USEDEP}]
  39. =dev-python/netlib-0.10.1[${PYTHON_USEDEP}]
  40. dev-python/jmespath[${PYTHON_USEDEP}]
  41. dev-python/testfixtures[${PYTHON_USEDEP}]
  42. net-ftp/vsftpd
  43. )"
  44. # pytest-twisted listed as a test dep but not in portage.
  45. # Testsuite currently survives without it, so appears optional
  46. REQUIRED_USE="test? ( ssl boto )"
  47. python_prepare_all() {
  48. # https://github.com/scrapy/scrapy/issues/1464
  49. # Disable failing tests known to pass according to upstream
  50. # Awaiting a fix planned by package owner.
  51. sed -e 's:test_https_connect_tunnel:_&:' \
  52. -e 's:test_https_connect_tunnel_error:_&:' \
  53. -e 's:test_https_tunnel_auth_error:_&:' \
  54. -e 's:test_https_tunnel_without_leak_proxy_authorization_header:_&:' \
  55. -i tests/test_proxy_connect.py || die
  56. distutils-r1_python_prepare_all
  57. }
  58. python_compile_all() {
  59. if use doc; then
  60. PYTHONPATH="${S}" emake -C docs html || die "emake html failed"
  61. fi
  62. }
  63. python_test() {
  64. py.test ${PN} tests || die "tests failed"
  65. }
  66. python_install_all() {
  67. use doc && local HTML_DOCS=( docs/build/html/. )
  68. distutils-r1_python_install_all
  69. }
  70.