diff options
| author | Louis Sautier <sbraz@gentoo.org> | 2018-06-19 22:19:43 +0200 |
|---|---|---|
| committer | Louis Sautier <sbraz@gentoo.org> | 2018-06-19 22:21:39 +0200 |
| commit | fbed90f9e30a1a777976377bc0ae4f87568c8baa (patch) | |
| tree | 19337c4ccf96cdb73a805befb639243b56f64383 /dev-python/python-twitter/python-twitter-3.4.2.ebuild | |
| parent | a6b104f43aab949dd28beb9e2a1b48cdb2a58124 (diff) | |
| download | gentoo-fbed90f9e30a1a777976377bc0ae4f87568c8baa.tar.gz gentoo-fbed90f9e30a1a777976377bc0ae4f87568c8baa.tar.bz2 gentoo-fbed90f9e30a1a777976377bc0ae4f87568c8baa.zip | |
dev-python/python-twitter: v3.4.2, fix tests, examples, add doc
Require responses > 0.6.0 otherwise tests fail because of
https://github.com/getsentry/responses/issues/159
Closes: https://bugs.gentoo.org/582728
Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'dev-python/python-twitter/python-twitter-3.4.2.ebuild')
| -rw-r--r-- | dev-python/python-twitter/python-twitter-3.4.2.ebuild | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/dev-python/python-twitter/python-twitter-3.4.2.ebuild b/dev-python/python-twitter/python-twitter-3.4.2.ebuild new file mode 100644 index 0000000000000..bc33c87db6bc0 --- /dev/null +++ b/dev-python/python-twitter/python-twitter-3.4.2.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python{2_7,3_{4,5,6}} ) + +inherit distutils-r1 + +DESCRIPTION="Python wrapper around the Twitter API" +HOMEPAGE="https://github.com/bear/python-twitter" +# Upstream does not include tests or doc in the PyPI tarballs +# https://github.com/bear/python-twitter/pull/572 +SRC_URI="https://github.com/bear/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~x86-macos" +IUSE="doc examples test" + +RDEPEND=" + dev-python/oauth2[${PYTHON_USEDEP}] + dev-python/simplejson[${PYTHON_USEDEP}] + dev-python/requests[${PYTHON_USEDEP}] + dev-python/requests-oauthlib[${PYTHON_USEDEP}]" + +DEPEND=" + dev-python/setuptools[${PYTHON_USEDEP}] + test? ( + ${RDEPEND} + >=dev-python/responses-0.6.1[${PYTHON_USEDEP}] + dev-python/mock[${PYTHON_USEDEP}] + dev-python/hypothesis[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + ) +" + +python_prepare_all() { + # Not actually required unless we want to do setup.py test + # https://github.com/bear/python-twitter/pull/573 + sed -i "s/'pytest-runner'//" setup.py || die + distutils-r1_python_prepare_all +} + +python_compile_all() { + if use doc; then + sphinx-build doc doc/_build/html || die + HTML_DOCS=( doc/_build/html/. ) + fi +} + +python_test() { + py.test || die "tests failed with ${EPYTHON}" +} + +python_install_all() { + if use examples; then + docinto examples + dodoc -r examples/. + docompress -x /usr/share/doc/${PF}/examples + fi + distutils-r1_python_install_all +} |
